Comments (8)
Thank you so much for the quick turnaround! It looks like exactly what we need. As a minor side note, String word
parameter is missing in the readme file
from csharp-trie.
Thank you so much! IMHO the method name is exactly what it should be because it is a well known algorithm. But the parameter name should not be 'prefix' because it is actually a full word and the trie itself is acting as a collection of prefixes (from which we choose the longest).
/// <summary>
/// Get longest matching prefix from the Trie.
/// </summary>
string GetLongestPrefixMatch(string word);
from csharp-trie.
Just a quick follow up, would you also be willing to add a corresponding TrieMap method? Same logic, but returning a value associated with the longest prefix, instead of the prefix itself. Something like this?
ITrieMap<TValue>.GetValueByLongestPrefixMatch(String word)
from csharp-trie.
Sure. I'll let the prerelease versions sit for a few days before cutting out release versions. Thanks.
from csharp-trie.
I've added it in 591b297 ("trie: Add GetLongestPrefixMatch()", 2023-11-02)
, but I'm not sure of the name yet, and will mostly change it. Any suggestions?
See 1.4.0-alpha0, and 1.4.0-alpha0.
from csharp-trie.
I've added. Please verify.
// ITrie
string GetLongestPrefixMatch(string word);
// ITrieMap<TValue>
KeyValuePair<string, TValue>? GetLongestPrefixMatch(string word);
See 1.4.0-alpha2, and 1.4.0-alpha2.
from csharp-trie.
In case you're interested, I also added
// ITrieMap<TValue>
IEnumerable<KeyValuePair<string, TValue>> GetLongestKeyValuePairs();
IEnumerable<KeyValuePair<string, TValue>> GetShortestKeyValuePairs();
See 1.5.0-alpha0, and 1.5.0-alpha0.
from csharp-trie.
from csharp-trie.
Related Issues (1)
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 csharp-trie.