mirror of
https://gitea.invidious.io/iv-org/shard-radix.git
synced 2024-08-15 00:43:21 +00:00
97ef407aec
Properly recognize and organize non-ascii keys into nodes, allowing usage with entries in other languages. With this change, it is possible to use 2 or 3 bytes wide characters (Unicode) without issues: tree = Radix::Tree(Symbol).new tree.add "/", :root tree.add "/日本語", :japanese tree.add "/日本は難しい", :japanese_is_difficult Which produces the following node hierarchy: # ( 1) / (:root) # ( 6) 日本 # (12) は難しい (:japanese_is_difficult) # ( 3) 語 (:japanese) And lookup works as expected: result = tree.find "/日本は難しい" puts result.found? # => true |
||
---|---|---|
.. | ||
radix | ||
spec_helper.cr |