09-18-2014, 12:37 PM
Macro Macro2431
str s=
;I have this text, stored in a string. What i would like is to devide it in sentences and know how many there are. Afterwards I like to know how many words each sentence counts.
;
;Anyone an idea of how i can realise this?
;
;Thanks !
ARRAY(str) sentences words
int is iw
tok s sentences -1 ".?!" 0x2000
out "%i sentences" sentences.len
int totalWords
for is 0 sentences.len
,tok sentences[is] words -1 ""
,;out words.len
,totalWords+words.len
,;for(iw 0 words.len) out words[iw]
out "average words/sentence: %i" totalWords/sentences.len