Hi! I found a text file on the internet with 10000 words in it. I wanted to create a spell checker with it, but it has a lot of garbage. Example:
pillow 28 piercing
Is there some sort of built in function that I can use to parse every , [space], and number out of the file? I don't need an entire program or anything, just a couple of lines to get me going.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could probobly use a standard for loop to eat out the block characters and spaces, but unless my copy of the c/c++ programmers reference is grossly incomplete there isn't a built in function to do such a thing. Search around google for "fstream loops text editing" and you should probobly find a nice long example.
Zero Valintine
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The class CString in Microcrap VC++ does have a bulit in parser. But I also believe old 'c' does as well. Talk to Kip he knows about standard 'c' more than I do. I have put some source on my ftp site: ftp://66.222.198.62 in the Source Folder. The file is converter.cpp and can be modified to do what you want it to. For my reference, I would appreciate a upload of the updated code if you decide to use it (don't feel that you have to though). I have also done a word wrap for c++ as well and it is also in there.
Curtis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! I found a text file on the internet with 10000 words in it. I wanted to create a spell checker with it, but it has a lot of garbage. Example:
pillow 28 piercing
Is there some sort of built in function that I can use to parse every , [space], and number out of the file? I don't need an entire program or anything, just a couple of lines to get me going.
You could probobly use a standard for loop to eat out the block characters and spaces, but unless my copy of the c/c++ programmers reference is grossly incomplete there isn't a built in function to do such a thing. Search around google for "fstream loops text editing" and you should probobly find a nice long example.
Zero Valintine
Thanks. One more question. How do I get the total number of characters in the file for the for loop?
You probably don't want to use a for loop. You should probably use a while loop as follows:
while (!myFile.eof())
{
<various processing>
}
Hope this helps.
http://www.codeproject.com/cpp/spellchecker_mg.asp
j@ck_
The class CString in Microcrap VC++ does have a bulit in parser. But I also believe old 'c' does as well. Talk to Kip he knows about standard 'c' more than I do. I have put some source on my ftp site: ftp://66.222.198.62 in the Source Folder. The file is converter.cpp and can be modified to do what you want it to. For my reference, I would appreciate a upload of the updated code if you decide to use it (don't feel that you have to though). I have also done a word wrap for c++ as well and it is also in there.
Curtis