[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Finding word matches without the frontier pattern
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 29 Dec 2009 12:50:25 -0200
> The problem du jour is to efficiently find single-word matches, that
> is if we match 'dog' we don't match 'dogged'.
How about this:
function single_word_match(s,w)
local m=s:match("%w*"..w..""%w*")
return m==w
end
That is, find the largest word that has your word and ensure it is exactly
that word.