Word count in Unicode

Richard Gaskin ambassador at fourthworld.com
Sun Jul 22 01:22:40 EDT 2012


Word counting is a snap with Latin-ISO:

on mouseUp
   put WordCount(fld 1)
end mouseUp

function WordCount pData
   repeat for each word tWord in pData
     add 1 to tCount[tWord]
   end repeat
   combine tCount with cr and tab
   set the itemdel to tab
   sort lines of tCount numeric descending by item 2 of each
   return tCount
end WordCount


How can I do the same for texts which may contain Unicode?

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys




More information about the use-livecode mailing list