项目作者: c910335

项目描述 :
Compile-time Trie in Crystal
高级语言: Crystal
项目地址: git://github.com/c910335/crie.git
创建时间: 2019-08-14T12:08:31Z
项目社区:https://github.com/c910335/crie

开源协议:MIT License

下载


Crie

Crystal CI
GitHub license

Compile-time Trie in Crystal

Installation

  1. Add the dependency to your shard.yml:

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

Usage

  1. require "crie"
  2. # Build Trie at compile time
  3. Crie << "En aru'din Raszagal"
  4. Crie << ["Khassar de templari", "Zhakul inok"]
  5. Crie.add_suffixes_of("Terrie Khala")
  6. # Search at compile time
  7. Crie.search("En Taro Adun") # => 3
  8. Crie.search("Khala dora") # => 5
  9. Crie.search("Nas beru uhn'adarr") # => 0
  10. # Search at run time
  11. crie = Crie.new
  12. crie.search("Zhara ku'nuul") # => 3
  13. crie.search("Khas ara'shar") # => 4
  14. 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