Discussion:
counting words
(too old to reply)
Laila Hayat
2012-10-23 21:30:09 UTC
Permalink
I am unable to count total number of words in a text image plz some 1 help by providing code how to count total number of words plz reply as soon as possible thanx
Ryan
2012-10-24 04:55:08 UTC
Permalink
Take a look at these links:
http://www.mathworks.com/matlabcentral/fileexchange/19505-wordcount

http://www.mathworks.com/help/bioinfo/ref/seqwordcount.html

http://www.mathworks.com/matlabcentral/newsreader/view_thread/2257
Post by Laila Hayat
I am unable to count total number of words in a text image plz some 1 help by providing code how to count total number of words plz reply as soon as possible thanx
Laila Hayat
2012-10-24 07:23:07 UTC
Permalink
Post by Ryan
http://www.mathworks.com/matlabcentral/fileexchange/19505-wordcount
http://www.mathworks.com/help/bioinfo/ref/seqwordcount.html
http://www.mathworks.com/matlabcentral/newsreader/view_thread/2257
Post by Laila Hayat
I am unable to count total number of words in a text image plz some 1 help by providing code how to count total number of words plz reply as soon as possible thanx
.
thanx again but i already have viewed these page last like shows counting characters in same mannar i have to count words instead of characters
eg. i am a human, i eat all kind of food. i love my country
in this sentense i need to count words and answer must be 14
regards
Ryan
2012-10-24 14:14:09 UTC
Permalink
What about something like this:
seqwordcount('i am a human, i eat all kind of food. i love my country',' ') + 1

ans = 14

I don't have Matlab installed on my office machine, so I can't test this.

Also, take a look at this:
http://www.mathworks.com/matlabcentral/fileexchange/27184-allwords
Post by Laila Hayat
Post by Ryan
http://www.mathworks.com/matlabcentral/fileexchange/19505-wordcount
http://www.mathworks.com/help/bioinfo/ref/seqwordcount.html
http://www.mathworks.com/matlabcentral/newsreader/view_thread/2257
Post by Laila Hayat
I am unable to count total number of words in a text image plz some 1 help by providing code how to count total number of words plz reply as soon as possible thanx
.
thanx again but i already have viewed these page last like shows counting characters in same mannar i have to count words instead of characters
eg. i am a human, i eat all kind of food. i love my country
in this sentense i need to count words and answer must be 14
regards
Lucio Cetto
2012-10-24 18:23:08 UTC
Permalink
I think regexp is better suited for this task;

numel(regexp('i am a human, i eat all kind of food. i love my country','\w+'))

HTH
L.
Ryan
2012-10-25 04:02:08 UTC
Permalink
Good one, Lucio! I totally forgot about Regex.
That's a notch better than my solution! Maybe a bit more eloquent too!!
Post by Lucio Cetto
I think regexp is better suited for this task;
numel(regexp('i am a human, i eat all kind of food. i love my country','\w+'))
HTH
L.
Loading...