Skip to content
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

Trie should not be specific to subclasses of AbstractString #220

Open
oxinabox opened this issue Oct 26, 2016 · 4 comments
Open

Trie should not be specific to subclasses of AbstractString #220

oxinabox opened this issue Oct 26, 2016 · 4 comments

Comments

@oxinabox
Copy link
Member

Tries work find for any collection of elements of a free monoid (I think I have that term right).
Not just strings,
but also things like arrays of Ints.
Technically arrays of Float64s but that causes other problems.

Wikipedia gets several examples on nonstrings.
I haven't have a close look at the code, but it seems like this is simply a matter of relaxing a type constraint.
Particularly since these are uncompressed dict based Tries.

@kmsquire
Copy link
Member

@oxinabox, care to take a stab at implementing this?

@rofinn
Copy link

rofinn commented Feb 27, 2018

I could probably look into this. @oxinabox I'm not very familiar with the term "free monoid" and the wikipedia entry is a bit dense, but would that include Strings or Symbols?

@oxinabox
Copy link
Member Author

oxinabox commented Feb 28, 2018

Yeah, strings, but symbols (except if you convert them to strings).
We actually don't even need free moniods, thinking about it (because that requires a concat operation)

Basically a try can be indexed with
anything that is a finite-length iterable of elements from a finite set really.

I'm in no hurry for this, it is more of a nice-to-have.
(Otherwise I'ld have implemented it myself)

@rofinn
Copy link

rofinn commented Feb 28, 2018

@oxinabox Alright, I have a prototype of supporting both AbstractString and Vector{T}. JuliaCollections/Tries.jl#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants