0
A code for obtaining word frequency
I want to count not only the number of words but also get each word's frequency in a 2100 page book i own. please how can i do that in C ++ or C even
2 Antworten
+ 1
Okay:
1. enter your whole Text as String
2. get the word you wanna know about as string
3. loop through the first string, and every time a letter matches the first one in your second one, look if the next one matches the second and so on, and if you got [length of word] matches in a row, increase counter. Also for every ' ' there is, increase a spaceCounter
Then, divide the first counter by the spaceCounter and you got it.
Could that help? Tell me, if you didn't get some part
0
i am a newbie so I don't even understand what you are talking about.