Re: [fpc-pascal] Partial text search in a dictionary

2017-05-16 Thread Torsten Bonde Christiansen

On 2017-05-16 10:26, leledumbo via fpc-pascal wrote:

However i would like to be able to do a partial text search on the

strings, prefeably with a result as a list of matching string/object
pairs but getting an index to the first matching pair would be fine. The
match only has to be done from the first character of both strings, so a
complex solution like Regex search is not needed.

Google for prefix tree (or radix tree or trie) implementation. I believe
I've seen one in either Blaise Pascal Magazine or Pascal Gamer Magazine, the
topic is about building autocomplete combobox if I'm not mistaken.


Exactly... couldn't remeber the name of the trees... :)

thanks
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Partial text search in a dictionary

2017-05-16 Thread leledumbo via fpc-pascal
> However i would like to be able to do a partial text search on the 
strings, prefeably with a result as a list of matching string/object 
pairs but getting an index to the first matching pair would be fine. The 
match only has to be done from the first character of both strings, so a 
complex solution like Regex search is not needed. 

Google for prefix tree (or radix tree or trie) implementation. I believe
I've seen one in either Blaise Pascal Magazine or Pascal Gamer Magazine, the
topic is about building autocomplete combobox if I'm not mistaken.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Partial-text-search-in-a-dictionary-tp5728562p5728601.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Partial text search in a dictionary

2017-05-15 Thread duilio foschi
a pointer is - after all - just an integer.

See
http://delphi.cjcsoft.net/viewthread.php?tid=44049

Instead of TStringLIst use a SQLite (open source) in-memory table to
store your data.

The table can be indexed and searched using function Locate with
option loPartialKey.

Just my 2c

Peppe



2017-05-15 14:19 GMT+02:00 Jürgen Hestermann :
> Am 2017-05-15 um 13:14 schrieb Torsten Bonde Christiansen:
>> however I was hoping someone might know of an implementation that works
>> more or less out of the box.
>
> To me it was very seldom that an existing solution
> severed all my needs. Either not all requirements were
> complied from the beginning or, even worse, I invested time
> using an existing "solution" only to find out much later
> that some detail does not work so I had to write my own solution anyway.
> I wasted time in understanding an (often poorly
> documented) existing routine, fighting with bugs in it
> and then had to write it more or less from cratch anyway.
>
> If I understand your requirements correctly it should not be
> too much work to write your own solution.
> You would also have the freedom to exactly adapt it to your needs
> without fiddling with parameters and adjustments of an existing
> library which are superfluous for your purpose.
>
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Partial text search in a dictionary

2017-05-15 Thread Jürgen Hestermann

Am 2017-05-15 um 13:14 schrieb Torsten Bonde Christiansen:
> however I was hoping someone might know of an implementation that 
works more or less out of the box.


To me it was very seldom that an existing solution
severed all my needs. Either not all requirements were
complied from the beginning or, even worse, I invested time
using an existing "solution" only to find out much later
that some detail does not work so I had to write my own solution anyway.
I wasted time in understanding an (often poorly
documented) existing routine, fighting with bugs in it
and then had to write it more or less from cratch anyway.

If I understand your requirements correctly it should not be
too much work to write your own solution.
You would also have the freedom to exactly adapt it to your needs
without fiddling with parameters and adjustments of an existing
library which are superfluous for your purpose.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal