-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(Trie): completion API #138
base: main
Are you sure you want to change the base?
Conversation
@favonia I decided on the name |
@kentookura I'm not 100% if tags should be used to remember the edit distances. Anyway, it seems we do not need to see the internal implementations of tries? Is it technically possible to separate it out as an individual module? If we want to combine these altogether, apparently the current data structure is bad for calculation distances, and maybe it's better to redesign the whole thing (?) |
As far as I can tell this could be implemented by a consumer of Yuujinchou, so yes. It's interesting that string based tries are used to implement autocomplete, but this fact is not used here. Maybe a guiding principle for redesign can be to share code between path-based and string-based tries? Maybe an API that converts a namespace into a datastructure that can be used to power an autocomplete engine? |
I pushed a branch of forester that implements this functionality using the existing API, so the changes I made aren't strictly necessary. |
@kentookura I will check the code after I finish my current work on asai... |
@favonia As far as I understand the trie implementation of yuujinchou, it does Suppose that problem is solved. Here is a rough sketch of the API I envision: type path_trie = Path_trie.t
type string_trie = String_trie.t
val make_completion : ?cutoff -> ?fuzzy -> ?filter -> Path_trie -> string_trie
val suggest : string -> string_trie -> Completion_item.t list where the arguments of It would also be neat if it were possible to feed individual characters or |
closes #122
@favonia The stuff added to
Example.ml
might not be according to your aesthetic preference, please advise :)I think that the
complete
function should actually return the data in the trie as well, since we might want to further filter the results. For example, we might only want to suggest items that match a certain type. Will update sometime soon.tagging @jonsterling