delimiter_tree alternatives and similar shards
Based on the "Algorithms and Data structures" category.
Alternatively, view delimiter_tree alternatives based on common mentions on social networks and blogs.
-
graphlb
graphlb is a crystal library which contains all the graph Data-Structures and Algorithms implemented in crystal-lang. -
splay_tree_map
This is a Crystal implementation of a Splay Tree; which is a type of binary search tree that is semi-balanced and that tends to self-optimize so that the most accessed items are the fastest to retrieve. -
text
A collection of phonetic algorithms for Crystal. Including; Porter-Stemmer, Soundex, Metaphone, Double Metaphone & White Similarity -
haversine
Crystal implementation of the Haversine formula to calculate distances between two points given their latitudes and longitudes -
SPAKE2+
a crystal lang implementation of SPAKE2+, a Password Authenticated Key Exchange (PAKE) protocol
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of delimiter_tree or a related project?
README
Delimiter Tree
A delimiter tree is a tree that is built from a string based on the delimiter. For example, if you have a string "foo;bar" then you will have a parent node "foo" and a child node "bar". Each node will hold a payload.
The delimiter tree also supports two special characters.
- : is used for a parameter
- * is used to include a payload for all children nodes
The tree will return an array of payloads for all matching * as well as the specific payload for the final matching string.
Installation
Add this to your application's shard.yml
:
dependencies:
delimiter_tree:
github: drujensen/delimiter_tree
Usage
The delimiter tree is used to return a payload or an array of payloads for a particular delimited string. This can be used for url paths or any situation where you need to specifically hold data per each segment of a delimited string.
require "delimiter_tree"
tree = Delimiter::Tree(Symbol).new("/")
tree.add "/*", :all_children
tree.add "/products", :products
tree.add "/products/:id", :specific_product
result = tree.find "/products/2"
puts result.payload
# [:all_children, :products]
puts result.params
# :id => 2
Contributing
- Fork it ( https://github.com/drujensen/delimiter_tree/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
Contributors
- drujensen Dru Jensen - creator, maintainer
- TechMagister Arnaud Fernandés