How to get word offset all instances of a string in a chunk of text?
Mike Kerner
MikeKerner at roadrunner.com
Fri Aug 31 16:33:35 EDT 2018
Since the topic of processes came up a few weeks ago I've been thinking
about what it would take to build a process/threading framework. I wonder
if a text processing subprocessor, written and copiled in 6 would be worth
everyone's time. The main app would hand off the data and the command to
the subprocessor and be handed the results back. I wonder how large the
dataset would have to be to make the overhead worth while.
On Fri, Aug 31, 2018 at 10:43 AM Keith Clarke via use-livecode <
use-livecode at lists.runrev.com> wrote:
> Thanks Alex, HH & Jim for all the help & ideas.
>
> Just to close out the thread with a solution for future reference, the
> code below now extracts from a text source a list of unique words, cleaned
> up against a noise-word list, with word frequency, word & and a
> comma-delimited string of the word number within the original source.
>
>
> # Build unique words array
> repeat for each trueWord W in tSource
>
> add 1 to tWordNum
>
> if tANoise[W] then next repeat
>
> put comma & tWordNum after tAWords[W]
>
> end repeat
>
>
> # Convert unique words array to list
>
> repeat for each key K in tAWords
>
> put K && tAWords[K] & CR after tTemp
>
> end repeat
>
>
> repeat for each line tLine in tTemp
>
> put the number of items in tLine & comma & tLine & cr after tWords
>
> end repeat
>
>
> sort lines of tWords descending numeric by item 1 of each
>
> put tWords into field "Words"
>
>
> Thanks & regards,
> Keith
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
and did a little diving.
And God said, "This is good."
More information about the use-livecode
mailing list