lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 13 Feb 2009, at 17:39, Sérgio Medeiros wrote:
I could really do with some advice on how to speed up a script I've written.

Basically, the script does a string.find on a large piece of text (500 words-ish - sometimes more) for occurrences of any word from a list of over 40,000. At the moment, I'm going through a table which contains the 40,000 "check words" and performing this string.find on each one.


Build a hash of all the words you want to find, split the source text into words and check each one against the hash.

--
Andy Armstrong, Hexten