notes:internals:trie
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:internals:trie [2025/08/12 19:51] – smj-edison | notes:internals:trie [2025/09/07 01:51] (current) – smj-edison | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== The Trie ===== | ===== The Trie ===== | ||
- | A Trie is the data structure that underlies Folk's database. It is the index to all Wishes, Claims, | + | A Trie is the data structure that underlies Folk's database. It is the database' |
- | and Whens. The Trie works by inserting and removing Clauses. A Clause is an array of space-seperated | + | Let's look at an example Statement |
- | words*, | + | |
- | become [" | + | |
- | Let's insert | + | Let's insert |
{{notes: | {{notes: | ||
Line 14: | Line 12: | ||
{{notes: | {{notes: | ||
- | As seen, a Trie is just a tree, with each successive Term placed one level deeper in the tree†. | + | As seen, a Trie is just a tree, with each successive Term placed one level deeper in the tree*. |
We've now covered inserting, but what about querying? Let's try querying | We've now covered inserting, but what about querying? Let's try querying | ||
Line 42: | Line 40: | ||
also get the value " | also get the value " | ||
- | + | === Footnotes === | |
- | * This is a little misleading, as the Trie can have Terms with spaces in them. For example, | + | * Technically, |
- | the last Term in `Wish $this has name "Mason Jones" | + | |
- | space seperated (without quotes or escaping), and all the tcl commands for the Trie take in lists. | + | |
- | + | ||
- | † Technically, | + | |
not for each word. It makes more sense to be for each word in Folk though. | not for each word. It makes more sense to be for each word in Folk though. | ||
notes/internals/trie.1755028283.txt.gz · Last modified: by smj-edison