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

Consider: deleteSubmap and other prefix operations #7

Closed
gozzarda opened this issue Apr 20, 2019 · 1 comment
Closed

Consider: deleteSubmap and other prefix operations #7

gozzarda opened this issue Apr 20, 2019 · 1 comment

Comments

@gozzarda
Copy link

The submap function is extremely useful for retrieving a map for all strings (or suffixes of strings, rather) that contain a specified prefix, and does it very efficiently.

Logically, it is possible to produce a map with all strings with a given prefix removed, and to do this efficiently. The currently provided functions do not seem to allow for this however, and instead require using alterBy or similar to delete every key that has the prefix.

Given that prefixes are such a fundamental part of the logic of tries, I think some more useful prefix operations would be valuable in this library. Consider, for example, the ability to add a common prefix to all keys in the trie, or delete the longest common prefix. Tries make these options inherently efficient, but currently the user does not have the tools to do this efficiently.

@QuietJoon
Copy link

I didn't see this issue before I make the pull request. Please check it. There is deleteSubmap.
#10

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

2 participants