crystal-dawg
Version, currently master branch1 version
- master branchlatestFeb 2, 2017
github.com/baltavay/crystal-dawg
Deterministic acyclic finite state automaton in crystal
2 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
crystal-dawg:
github: baltavay/crystal-dawg
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.20.5- License
- MIT
- Author
- Max
Dependencies
This version declares no dependencies.
README
crystal-dawg
Deterministic acyclic finite state automaton in crystal
Installation
Add this to your application's shard.yml:
dependencies:
crystal-dawg:
github: baltavay/crystal-dawg
Usage
require "crystal-dawg"
# create dawg
dawg = Dawg.create
# add words in alphabetical order
dawg.add("taps")
dawg.add("tops")
dawg.finish
# query word
dawg.query("t")
-> [taps, tops]
# saving
Dawg.save("dawg.dawg", dawg)
# there is two variants of loading dawg structure
# 1: fast but eats more memory
dawg = Dawg.load("dawg.dawg", Dawg::Type::Fast)
# 2: little memory usage but slower
dawg = Dawg.load("dawg.dawg", Dawg::Type::Small)
Contributing
- Fork it ( https://github.com/baltavay/crystal-dawg/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Feb 2, 2017
- Crystal
0.20.5- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/baltavay/crystal-dawg
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1