-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements of Trie Structure #756
Improvements of Trie Structure #756
Conversation
end | ||
end | ||
|
||
partial_path(t::Trie, str::AbstractString) = TrieIterator(t, str) | ||
Base.IteratorSize(::Type{TrieIterator}) = Base.SizeUnknown() | ||
|
||
function find_prefixes(t::Trie, str::AbstractString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this requires a docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in the latest commit
docs/src/trie.md
Outdated
|
||
```julia | ||
t = Trie(["A", "ABC", "ABCD", "BCE"]) | ||
find_prefixes(t, "ABCDE") # "A", "ABC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this not return ABCD
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my mistake. I fixed it.
Thanks. Note that we are currently feature frozen pending #479 The fix TrieIterator to correctly handle non-ascii characters change is a good bug fix, which we can backpoint to the 0.18.x line. |
Thank you for your comment. I updated my commits according to your suggestion. |
Squashed version of commits in JuliaCollections#756 with relevant changes only. Backport to v0.18, meaning we're not including `find_prefixes`. Co-authored-by: Du Shiqiao <lucidfrontier.45@gmail.com> Co-authored-by: Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com>
This PR improved
Trie
with the following two points.TrieIterator
to correctly handle non-ascii charactersfind_prefixes
function which is equivalent toprefixes
method of https://github.com/pytries/marisa-trie