Click here to Skip to main content
15,921,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPossible to make structures with arrays dynamic? Pin
KanuAMBC20-Aug-06 0:12
KanuAMBC20-Aug-06 0:12 
AnswerRe: Possible to make structures with arrays dynamic? Pin
Cedric Moonen20-Aug-06 2:39
Cedric Moonen20-Aug-06 2:39 
AnswerRe: Possible to make structures with arrays dynamic? Pin
Waldermort20-Aug-06 3:10
Waldermort20-Aug-06 3:10 
AnswerRe: Possible to make structures with arrays dynamic? Pin
Hamid_RT22-Aug-06 7:25
Hamid_RT22-Aug-06 7:25 
Questionbuilt-in variables for VC? Pin
George_George19-Aug-06 23:35
George_George19-Aug-06 23:35 
AnswerRe: built-in variables for VC? Pin
Mike Dimmick20-Aug-06 5:53
Mike Dimmick20-Aug-06 5:53 
GeneralRe: built-in variables for VC? Pin
George_George20-Aug-06 17:37
George_George20-Aug-06 17:37 
QuestionComparing strings to a table of values Pin
Rigsby6619-Aug-06 23:07
Rigsby6619-Aug-06 23:07 
Using Visual C++ 6 in Visual Studio 6

I need a c++ function to find particular patterns in single word strings and remove them from the string. These patterns are either always at the right of the string or at the left of the string, never in the middle. I have over 300,000 patterns to search for, currently stored in an Excel table. An example is as follows:

I give the function “recyclable” and the pattern “able” is removed, thus returning “recycl”. The spelling error is irrelevant. If you take another example, “recycling” and the function removes “ing” thus again returning “recycl” you can see where I am coming from. Both words, “recyclable” and “recycling” return the same result. This is what I want.

As I said, I have over 300,000 of these patterns that need to be searched for and removed. All values have been converted to lower case.


Here is an example of how I am currently doing this in Filemaker Pro, in plain English using the word “photographer”

I feed the word “photographer” to the variable X. “er” exists as a right value in my table, and because X is longer than 2, “er” is removed. The length needs to always be bigger than the table value, or X might be set to empty. If you consider that my table contains the right values “er” “ic” “y” etc. than you will see that the following results can be obtained:

photographer = photograph
photography = photograph
photographic = photograph

And so on.

I am not a C++ programmer. I need to know how to reference a table of values in c++ (what form should the table be?) I presume Excel is not correct. I need to know how to compare my input with the table (i.e. find “able” only if the 4 right-most characters of my input match. If I’m finding on the 4 right-most characters then the function should only be performed if my input is longer than 4.

I guess this system is a little like a spell check system with auto correction. If you look at the Auto correction (not the spell check) from Microsoft Word, for example, this is exactly what I am looking for, except that the correction is only based on part of the string, and will simply remove it.

I know you cannot solve this problem for me, but perhaps you can set me in the right direction. For example, what table format should I use? How do I reference this table in C++. How do I compare parts of strings with a table (database) of values.


Any help at all would be fantastic. I know this is a big job for someone who has never used c++ before, but I am determined to do it!

Rigsby
Questionhow to get the execution path of dll Pin
mt_samiei19-Aug-06 22:28
mt_samiei19-Aug-06 22:28 
AnswerRe: how to get the execution path of dll Pin
Mike Dimmick20-Aug-06 6:07
Mike Dimmick20-Aug-06 6:07 
GeneralRe: how to get the execution path of dll Pin
mt_samiei22-Aug-06 19:27
mt_samiei22-Aug-06 19:27 
QuestionPortrait to LandScape Pin
georgekjolly19-Aug-06 21:50
georgekjolly19-Aug-06 21:50 
AnswerRe: Portrait to LandScape Pin
bob1697220-Aug-06 4:48
bob1697220-Aug-06 4:48 
AnswerRe: Portrait to LandScape Pin
Hamid_RT22-Aug-06 7:25
Hamid_RT22-Aug-06 7:25 
QuestionSprite Animation Pin
lman81719-Aug-06 21:35
lman81719-Aug-06 21:35 
AnswerRe: Sprite Animation Pin
Mike Dimmick20-Aug-06 6:24
Mike Dimmick20-Aug-06 6:24 
Questioncapturing keyboard events Pin
Vissu8919-Aug-06 20:04
Vissu8919-Aug-06 20:04 
AnswerRe: capturing keyboard events [modified] Pin
bob1697220-Aug-06 4:40
bob1697220-Aug-06 4:40 
GeneralRe: capturing keyboard events Pin
Vissu8920-Aug-06 14:39
Vissu8920-Aug-06 14:39 
AnswerRe: capturing keyboard events Pin
Hamid_RT22-Aug-06 7:13
Hamid_RT22-Aug-06 7:13 
QuestionIcons Pin
Waldermort19-Aug-06 17:20
Waldermort19-Aug-06 17:20 
AnswerRe: Icons Pin
Michael Dunn20-Aug-06 6:10
sitebuilderMichael Dunn20-Aug-06 6:10 
Questioncontrol the frame WM_CLOSE message in MDI sub window, and must capture it and judge If can close the frame Pin
balconysun19-Aug-06 15:26
balconysun19-Aug-06 15:26 
AnswerRe: control the frame WM_CLOSE message in MDI sub window, and must capture it and judge If can close the frame Pin
cje22-Aug-06 10:33
cje22-Aug-06 10:33 
QuestionReturning Spoken Text from SAPI Pin
Bob X19-Aug-06 9:01
Bob X19-Aug-06 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.