The trie data structure is used for quick access to words and data that should be associated with them.
Basic Trie is implemented as a tree where each node holds a single character that could point at any other character thus allowing insertion of arbitrary words. Each node also holds a vector of the data that is associated with it.
For example, when inserting a whole book in the trie, you could insert every word with the corresponding page number it's on. Later when searching for the word, you could get all the pages the word is on with no added performance cost.
unicode-segmentation
crateunicode-segmentation
The software is licensed under the MIT license.