User Tools

Site Tools


notes:internals:trie

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:internals:trie [2025/09/07 01:15] smj-edisonnotes: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 database's index for all Statements. A Trie is the data structure that underlies Folk's database. It is the database's index for all Statements.
 +Let's look at an example Statement with the Clause "the sky is blue".
  
-Let's insert the Clause into the Trie and see what happens:+Let's insert that Clause into the Trie and see what happens:
  
 {{notes:pxl_20250811_192744566.jpg?200|}} {{notes:pxl_20250811_192744566.jpg?200|}}
Line 11: Line 12:
 {{notes:pxl_20250811_193540816.jpg?200|}} {{notes:pxl_20250811_193540816.jpg?200|}}
  
-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 40: Line 41:
  
 === Footnotes === === Footnotes ===
-This is a little misleading, as the Trie can have Terms with spaces in them. For example, +* Technically, the definition of a trie uses a level for each letter,
-the last Term in `Wish $this has name "Mason Jones"` has spaces in it. It's just that in tcl, lists are +
-space seperated by default, and all the Trie commands run in tcl. +
- +
-† Technically, the definition of a trie uses a level for each letter,+
 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.1757207710.txt.gz · Last modified: by smj-edison

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki