lua-users home
lua-l archive

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


Petite Abeille <petite.abeille@gmail.com> [13-10-27 13:24]:
> 
> On Oct 27, 2013, at 12:15 PM, meino.cramer@gmx.de wrote:
> 
> > is there anything more sophisticated than linear search, which I can
> > do to match a key (string) in a table from a user input, which is only
> > a part of that key?
> 
> With a plain table, linear search it it. But you could always use a more appropriate structure such as, say, a Trie or similar.
> 
> http://en.wikipedia.org/wiki/Trie
> 
> Alternatively, depending on your circumstances, you might even want to consider a little embedded db, such as sqlite which, among other things, sports a nifty full text search engine.
> 
> http://www.sqlite.org/
> http://www.sqlite.org/fts3.html

Hi Petite,

thank you fo your help! :)

I will take a look at the tries. For curiosity reasons I want to
try to avoid "ready solutions" (like sqlite). But if my keyboard
gets spilled with blood til afternoon, I think I will be less
curious... ;)

Best regards,
mcc