Skip to content
Compile-time Trie in Crystal
Crystal
Branch: master
Clone or download
Latest commit 13d941b Aug 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec add spec Aug 14, 2019
src use for in range literal Aug 14, 2019
.editorconfig initial commit Aug 14, 2019
.gitignore initial commit Aug 14, 2019
.travis.yml allow travis Aug 14, 2019
LICENSE initial commit Aug 14, 2019
README.md improve usage comments Aug 15, 2019
shard.yml fix crystal version Aug 14, 2019

README.md

Crie

Build Status GitHub license

Compile-time Trie in Crystal

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      crie:
        github: c910335/crie
  2. Run shards install

Usage

require "crie"

# Build Trie at compile time
Crie << "En aru'din Raszagal"
Crie << ["Khassar de templari", "Zhakul inok"]
Crie.add_suffixes_of("Terrie Khala")

# Search at compile time
Crie.search("En Taro Adun") # => 3
Crie.search("Khala dora") # => 5
Crie.search("Nas beru uhn'adarr") # => 0

# Search at run time
crie = Crie.new
crie.search("Zhara ku'nuul") # => 3
crie.search("Khas ara'shar") # => 4
crie.search("Shozak mok nul") # => 0

Contributing

  1. Fork it (https://github.com/c910335/crie/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

You can’t perform that action at this time.