Comments (5)
Not sure if I want the same thing, but it sounds like it -
given
Trie([u'some.long.name', u'some.short.name'])
I'd like a way to get back
[u'some.long', u'some.short'])
from marisa-trie.
I'm not sure if this is possible using the public API of marisa-trie
the C++ library. Need to check and then maybe forward the issue upstream.
from marisa-trie.
When I originally posted that, I for some reason didn't realize 'prefixes' returned them in order (duh), so what I needed was basically already implemented satisfactorily.
What you stuaxo want is something else. I'm not completely sure what you want though...
from marisa-trie.
In the end, I implemented this using a different library, + what I needed turned out to be slightly different - I needed something like this:
t = Trie([u'some.long.name', u'some.short.name'])
t.longest_unique_prefixes()
u['some.']
t = Trie([u'some.long.name', u'some.short.name', 'blah.1', 'blah.2'])
t.longest_unique_prefixes()
u['some.', 'blah.']
from marisa-trie.
^ I guess what I wanted needed here is the 'roots' of the Trie.
from marisa-trie.
Related Issues (20)
- Removal of has_keys_with_prefix Method HOT 1
- Build not working with Python 3.13.0b1 HOT 2
- Generated wheel names on PyPi don't match setuptools format requirements
- No bug - just a thanks
- Build fails under Pyhton 3.7 and MacOS Catalina HOT 1
- libmarisa-trie fails on macOS Big Sur and Python 3.8 HOT 1
- no marisa
- Build under Python 3.9 failed HOT 2
- [INFO] New repository HOT 5
- Dropping support for Python 3.4 and 3.5?
- Drop support for Python 2.7? HOT 3
- marisa-trie==0.7.7 listed on PyPI but unavailable for installation HOT 6
- how to insert new node? HOT 4
- Can't install HOT 1
- Unable to add string values to RecordTrie
- Python 3.11 support HOT 7
- How to build from source?
- Seems like python 3.12 is not supported HOT 3
- API docs are empty
- Test failures on armv7 and armhf, Bus error (core dumped) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marisa-trie.