Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text counting
#2
Use function tok.

Macro Macro2429
Code:
Copy      Help
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
for is 0 sentences.len
,tok sentences[is] words -1 ""
,out words.len
,for(iw 0 words.len) out words[iw]
,


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)