how to recognize word from sentence?
-
i try to recognize by using space, but unsuccess. it might be the coding error. can someone pls show me the coding.thanks. ur reponse will be appreciated for me.
you will also have to use punctuation marks such as '.',',',';' etc. Hyphens are also wierd as they can indicate a joining of words or that a word has been split to allow it to wrap at the end of a line (not end of sentence), this normally happens after the 3rd charcter. eg con- tinutation
Stupidity dies. The end of future offspring. Evolution wins. - A Darwin Awards Haiku
-
you will also have to use punctuation marks such as '.',',',';' etc. Hyphens are also wierd as they can indicate a joining of words or that a word has been split to allow it to wrap at the end of a line (not end of sentence), this normally happens after the 3rd charcter. eg con- tinutation
Stupidity dies. The end of future offspring. Evolution wins. - A Darwin Awards Haiku
Splitting of words happens between two syllables. e.g.: Split-ting, not Spl-itting :)
-
Splitting of words happens between two syllables. e.g.: Split-ting, not Spl-itting :)
true - but I remember a 3 letter rule as well that you do not break the word if the first part is less than 3 letters but just start it on the next line.
Stupidity dies. The end of future offspring. Evolution wins. - A Darwin Awards Haiku
-
true - but I remember a 3 letter rule as well that you do not break the word if the first part is less than 3 letters but just start it on the next line.
Stupidity dies. The end of future offspring. Evolution wins. - A Darwin Awards Haiku
-
Somebody is not doing their homework. How do you expect to learn how to program if you dont want to do the work? I sugest switching courses. Youll get no help here. Heres some assistance though. Define "what" a word is. Is is a series of alpha characters followed by a space or possibly a form of punctuation? . , ; ' : - or is your programs definition of a word slighly simpler? can a word have numerical characters in it? is l33t a word? Ryan Baillargeon Software Specialist Fuel Cell Technologies Inc.
-
Somebody is not doing their homework. How do you expect to learn how to program if you dont want to do the work? I sugest switching courses. Youll get no help here. Heres some assistance though. Define "what" a word is. Is is a series of alpha characters followed by a space or possibly a form of punctuation? . , ; ' : - or is your programs definition of a word slighly simpler? can a word have numerical characters in it? is l33t a word? Ryan Baillargeon Software Specialist Fuel Cell Technologies Inc.
I think you should be misunderstanding, or else it is my fault. i suppose to post my coding and lets you all expertise and checking the error for me. However, the system now is workable for space. one more question is if i would like to get some particular word, lets say 3rd word from the sentence. then what should i add inside? the following is the coding: #include using std::cout; using std::endl; using std::cin; #include int main() { char string[256]; char *tokenPtr; cout << "Enter sentence\n"; cin.getline(string,sizeof(string),'\n'); cout << "The string to be tokenized is:\n" << string << "\n\nThe tokens are:\n"; tokenPtr = strtok( string, " " ); while ( tokenPtr != NULL ) { cout << tokenPtr << '\n'; tokenPtr = strtok( NULL, " " ); } return 0; }