Skip to content

ezgraphs/rtrie

Repository files navigation

rtrie

Description

This package is a super-simple trie implementation specifically geared for processing lists of words. It can be used to quickly find words that are in a word list or sets of words that match the beginning of a given character string.

This type of processing is required when implementing auto-complete / word-suggestions or in word games like Scrabble or Boggle.

The latest release available from CRAN.

Sample Usage

At present, it is possible to create a trie, check if it contains a given word, or find words that start with a given chacter string.


library(rtrie)
trie <- char_tree(c('able', 'act', 'acts', 'across','act','bat','babble','bobble'), 'X')

cat(is_word('able',trie))
## TRUE

matching_words('act',trie)
## act acts

More information

More examples of Usage in vignette.

About

Simple implementation of Tries in R

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages