PureBasic Forum
http://forums.purebasic.com/english/

autocomplete Trie
http://forums.purebasic.com/english/viewtopic.php?f=18&t=74372
Page 2 of 2

Author:  idle [ Tue Jan 21, 2020 4:22 am ]
Post subject:  Re: autocomplete Trie

switched to utf8 and converted to array based so it can be saved and restored from file or memory and sorted the Enum out

pros
save and restore
same memory use on x86 amd x64
more cache friendly
utf8 shorter strings
nibbles smaller alphabet
cons
may create page faults reallocating, need to create trie with enough space initially
twice the number of nodes to access a token

Author:  idle [ Fri Jan 24, 2020 12:32 am ]
Post subject:  Re: autocomplete Trie

mashed it into a ScintillaGadget using Scintillas Autocomplete, I don't see any issues speed wise.
Tested on x64 linux and windows xp vm

It still has a slight problem with the positioning if you return at end of line the list will appear at the wrong location as I'm missing to trap a message
Space cancels the list, Return enters the item
I still have to abstract it a little to manage contexts, that can be done in the trie itself but I need to study the ide code a little more before deciding how to facilitate it.

Can you please test and report back how it performs on your platform.

Edit
fixed bug in enum position with the change to support Unicode and UTF8 keys

Author:  idle [ Sat Jan 25, 2020 7:13 am ]
Post subject:  Re: autocomplete Trie

Fixed bug in enum position with the change to support both Unicode and UTF8 keys.

Page 2 of 2 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/