lua-users home
lua-l archive

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


> 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.

How about extracting the words in the text and then see if they're one of
the "check words"? You'll need to invert the table you have, but that's
easy:
	function invert(t)
		local z={}
		for k,v in pairs(t) do z[v]=true end
		return z
	end