SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Share your advanced PureBasic knowledge/code with the community.
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by jassing »

Nice work!
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by idle »

jassing wrote: Sun Sep 03, 2023 8:29 pmNice work!
thanks.

I've migrated it to github
https://github.com/idle-PB/Squint3
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by idle »

Image
Image
Image
dcr3
Enthusiast
Enthusiast
Posts: 181
Joined: Fri Aug 04, 2017 11:03 pm

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by dcr3 »

It is very rewarding to see you keep on tweaking, and make it compatible across the board.

Excellent. :D

As a side note, the example on the github, needs a small fix.
[code
Repeat
PrintN("enter a key to search for of type quit to end")
key = LCase(Input())
If key <> "quit" Or key <> "end"
sq\Enum(@key,@CBSearch()) ;search the dictionary
Else
Break
EndIf

ForEver

][/code]
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by idle »

Thanks I was in a bit of a rush... I'm far from done with it. I've been holding off on facilitating caseless mode as you have to store a copy of the key but I think I have a good solution and it will also facilitate shortening the path...
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by DarkDragon »

This also runs on linux, the only line I had to change was in the bibletext example:

Code: Select all

XIncludeFile "..\squint3.pbi"
should be

Code: Select all

XIncludeFile "../squint3.pbi"
(forward slash)
Squint Numeric lookup items 14,888,545 p/s avg per thread 2,126,935
lookup rate 113.59 mb p/s
lookup time 67.17 ns
Squint Numeric writes items 589,006
Write rate 4.49 mb p/s
num items 4,194,304 mem 222.74mb keysize 16.00 mb
thread 0 2,018,353
thread 1 2,127,369
thread 2 2,145,545
thread 3 2,138,433
thread 4 2,129,635
thread 5 2,159,261
thread 6 2,169,949
thread 7 589,006
bye,
Daniel
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by idle »

Thanks I'll fix the example.
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by Shardik »

DarkDragon wrote: Wed Oct 04, 2023 5:56 pm This also runs on linux, the only line I had to change was in the bibletext example:

Code: Select all

XIncludeFile "..\squint3.pbi"
should be

Code: Select all

XIncludeFile "../squint3.pbi"
(forward slash)

For cross-platform compatibility you should never use "/" or "\" in your file paths but instead use the constant #PS$ which is compiled to the correct path separator on your target operating system:

Code: Select all

XIncludeFile ".." + #PS$ + "squint3.pbi"
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by Kuron »

Shardik wrote: Thu Oct 05, 2023 7:23 am For cross-platform compatibility you should never use "/" or "\" in your file paths but instead use the constant #PS$ which is compiled to the correct path separator on your target operating system:

Code: Select all

XIncludeFile ".." + #PS$ + "squint3.pbi"
Ole' Kuron learned his new thing for the day.
Best wishes to the PB community. Thank you for the memories. ♥️
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by DarkDragon »

Shardik wrote: Thu Oct 05, 2023 7:23 am
DarkDragon wrote: Wed Oct 04, 2023 5:56 pm This also runs on linux, the only line I had to change was in the bibletext example:

Code: Select all

XIncludeFile "..\squint3.pbi"
should be

Code: Select all

XIncludeFile "../squint3.pbi"
(forward slash)

For cross-platform compatibility you should never use "/" or "\" in your file paths but instead use the constant #PS$ which is compiled to the correct path separator on your target operating system:

Code: Select all

XIncludeFile ".." + #PS$ + "squint3.pbi"
That's true, however / is supported on all of the systems and if there's going to be refactoring in the IDE somewhen, a composed string is for sure more difficult to automatically refactor.
bye,
Daniel
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by idle »

I hope you all realize /\ look the same to me \/ /\ it's not easy coding as a dyslexic :lol:
Olli
Addict
Addict
Posts: 1200
Joined: Wed May 27, 2020 12:26 pm

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by Olli »

But, idle... What are you hiding here ? I thank 'squint' was a word we found only on the sites for adults... With which external library is it attached ?
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by idle »

If you're playing a round of poker you'll likely squint at your opponents and I'm sure if you read my code you'll be squinting too and it probably smells bad too. :lol:
Olli
Addict
Addict
Posts: 1200
Joined: Wed May 27, 2020 12:26 pm

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by Olli »

It is a high level stand alone purely purebascly code !
Have you got several memory comparisons (/ maps) ?
And howmany size is allocated for one key ?

I imagine the concept. It is very simple to understand with

abba
aka
alias

Code: Select all

A - B - B - A
| \
|  K - A
 \
  L - I - A - S

But the result with longer lists is very complex to understand. You are dislexic, you said, but you imagine very easily the big scale chained links.This means you do not see only 3 words above : you see a fourth word << SAIL >>.

As an ambidextrous who never knows how to remember to take easily for use the right-handed scissors.
Olli
Addict
Addict
Posts: 1200
Joined: Wed May 27, 2020 12:26 pm

Re: SQUINT 3, Sparse Quad Union Indexed Nibble Trie

Post by Olli »

When I will have the time to code, I will do a version named "Alias sail". Because this technic, I did it only to compress the datas. (french wordlist) It was in 1997. So, since, I had a time to trip about it !
Post Reply