![]() |
VOOZH | about |
dotnet add package rm.Trie --version 1.6.0
NuGet\Install-Package rm.Trie -Version 1.6.0
<PackageReference Include="rm.Trie" Version="1.6.0" />
<PackageVersion Include="rm.Trie" Version="1.6.0" />Directory.Packages.props
<PackageReference Include="rm.Trie" />Project file
paket add rm.Trie --version 1.6.0
#r "nuget: rm.Trie, 1.6.0"
#:package rm.Trie@1.6.0
#addin nuget:?package=rm.Trie&version=1.6.0Install as a Cake Addin
#tool nuget:?package=rm.Trie&version=1.6.0Install as a Cake Tool
A trie (prefix tree) data structure implementation in C#.
main: 👁 Build Status
dev: 👁 Build Status
Install-Package rm.Trie
// Adds a word to the Trie.
void AddWord(string word);
// Removes word from the Trie.
int RemoveWord(string word);
// Removes words by prefix from the Trie.
void RemovePrefix(string prefix);
// Gets all words in the Trie.
IEnumerable<string> GetWords();
// Gets words for given prefix.
IEnumerable<string> GetWords(string prefix);
// Returns true if the word is present in the Trie.
bool HasWord(string word);
// Returns true if the prefix is present in the Trie.
bool HasPrefix(string prefix);
// Gets the equivalent TrieNode in the Trie for given prefix.
TrieNode GetTrieNode(string prefix)
// Returns the count for the word in the Trie.
int WordCount(string word);
// Gets longest words from the Trie.
ICollection<string> GetLongestWords();
// Gets shortest words from the Trie.
ICollection<string> GetShortestWords();
// Gets longest prefix matching the word.
string GetLongestPrefixMatch(string word);
// Clears all words from the Trie.
void Clear();
// Gets total word count in the Trie.
int Count();
// Gets unique word count in the Trie.
int UniqueCount();
// Gets the root trieNode.
TrieNode GetRootTrieNode();
// Creates a new trie.
ITrie trie = new Trie();
// Adds words.
trie.AddWord("test");
trie.AddWord("this");
// Gets all words.
var allWords = trie.GetWords();
// Gets words for a prefix.
var tePrefixWords = trie.GetWords("te");
// Checks if a word is present.
var hasWord = trie.HasWord("test");
// Checks if a prefix is present.
var hasPrefix = trie.HasPrefix("tes");
// Gets trieNode for prefix.
TrieNode trieNode = trie.GetTrieNode("tes");
// Gets trieNode from trieNode by prefix.
TrieNode testTrieNode = trieNode.GetTrieNode("t");
// Gets word count for a word.
var wordCount = trie.WordCount("test");
// Removes word.
int removeCount = trie.RemoveWord("test"); // removeCount = 1
// Removes words by prefix.
trie.RemovePrefix("thi");
// Gets longest words.
var longestWords = trie.GetLongestWords();
// Gets shortest words.
var shortestWords = trie.GetShortestWords();
// Gets longest prefix matching the word.
var longestPrefixMatch = trie.GetLongestPrefixMatch("testing"); // longestPrefixMatch = "test"
// Clears all words.
trie.Clear();
// Gets counts.
trie.AddWord("test"); // adding "test" again
var count = trie.Count();
var uniqueCount = trie.UniqueCount();
// Gets the root trieNode.
var root = trie.GetRootTrieNode();
// Gets TValue item for key from TrieMap.
TValue ValueBy(string key);
// Gets TValue items by key prefix from TrieMap.
IEnumerable<TValue> ValuesBy(string keyPrefix);
// Gets all TValue items from TrieMap.
IEnumerable<TValue> Values();
// Gets keys by key prefix from TrieMap.
IEnumerable<string> KeysBy(string keyPrefix);
// Gets all keys from TrieMap.
IEnumerable<string> Keys();
// Gets string->TValue pairs by key prefix from TrieMap.
IEnumerable<KeyValuePair<string, TValue>> KeyValuePairsBy(string keyPrefix);
// Gets all string->TValue pairs from TrieMap.
IEnumerable<KeyValuePair<string, TValue>> KeyValuePairs();
// Adds TValue item for key to TrieMap.
void Add(string key, TValue value);
// Returns true if key present in TrieMap.
bool HasKey(string key);
// Returns true if key prefix present in TrieMap.
bool HasKeyPrefix(string keyPrefix);
// Gets TrieNode for given key prefix.
TrieNode<TValue> GetTrieNode(string keyPrefix)
// Removes key from TrieMap.
void Remove(string key);
// Removes key prefix from TrieMap and return true else false.
bool RemoveKeyPrefix(string keyPrefix);
// Gets string->TValue pairs for longest keys from the Trie.
IEnumerable<KeyValuePair<string, TValue>> GetLongestKeyValuePairs();
// Gets string->TValue pairs for shortest keys from the Trie.
IEnumerable<KeyValuePair<string, TValue>> GetShortestKeyValuePairs();
// Gets string->TValue pair for longest prefix matching the word from the Trie.
KeyValuePair<string, TValue>? GetLongestPrefixMatch(string word);
// Clears all values from TrieMap.
void Clear();
// Gets the root trieNode.
TrieNode<TValue> GetRootTrieNode();
ITrieMap<int> trieMap = new TrieMap<int>();
// Adds key-value.
trieMap.Add("key1", 1);
trieMap.Add("key12", 12);
trieMap.Add("key2", 2);
// Gets value item for key.
var value = trieMap.ValueBy("key1"); // value = 1
// Gets value items by key prefix.
var values = trieMap.ValuesBy("key1"); // values = { 1, 12 }
// Gets all value items.
var values = trieMap.Values(); // values = { 1, 12, 2 }
// Gets all value items.
var keys = trieMap.Keys(); // keys = { "key1", "key12", "key2" }
// Gets all key-value items.
var kvPairs = trieMap.KeyValuePairs();
// Returns true if key present.
bool hasKey = trieMap.HasKey("key1"); // hasKey = true
// Returns true if key prefix present.
bool hasKeyPrefix = trieMap.HasKeyPrefix("key"); // hasKeyPrefix = true
// Gets trieNode for key prefix.
TrieNode<int> key1TrieNode = trie.GetTrieNode("key1");
// Gets trieNode from trieNode by prefix.
TrieNode<int> key12TrieNode = key1TrieNode.GetTrieNode("2");
// Removes key.
trieMap.Remove("key1");
trieMap.Remove("key"); // throws
// Removes by key prefix.
bool isKeyPrefixRemoved = trieMap.RemoveKeyPrefix("key"); // isKeyPrefixRemoved = true
// Gets string->TValue pairs for longest keys from the Trie.
IEnumerable<KeyValuePair<string, TValue>> longestKeyValuePairs = trieMap.GetLongestKeyValuePairs();
// Gets string->TValue pairs for shortest keys from the Trie.
IEnumerable<KeyValuePair<string, TValue>> shortestKeyValuePairs = trieMap.GetShortestKeyValuePairs();
// Get key-value item for longest prefix matching the word.
KeyValuePair<string, TValue>? kvPairForKey12 = trieMapGetLongestPrefixMatch("key12345"); // "key12"
// Clears triemap.
trieMap.Clear();
// Gets the root trieNode.
var root = trie.GetRootTrieNode();
Not thread-safe.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on rm.Trie:
| Package | Downloads |
|---|---|
|
OrbintSoft.Yauaa.NetStandard
This is a .NET standard library that tries to parse and analyze the user agent string and extract as many relevant attributes as possible. The library aims to provides a reliable and extensible user agent parsing, browser and device detection. This is a semantic analyzer, so it doesn't rely on any database (except for some very little lookup tables), that means it is able to parse and recognize every day new kind of user agents and new patterns without updates. That makes the library very fast, flexible and easy to mantain, on the contrary the library can't extract info that are not present on user agent string without a proper mapping. The library doesn't aim to recognize every device in the world (there are several thousands), but it is able to work, analyze and extract all attributes available in the user agent. For most common devices we provide a lookup table in yaml file to identify device brand/model based on the few info available in the user agent. The library can be easily extended thanks to yaml files and a simple syntax (we don't rely on regular expression). Thanks to custom yaml definitions, you can make the library able to identify your company applications/ tools and extract your custom fields. |
|
|
Geohash.SpatialIndex.Core
A spatial index backed by geohashing and Trie (prefix tree) maps. Geometries are encoded as geohashes and stored in a prefix tree, and reverse lookups are performing by encoding the queried geometry and using the prefix tree as an inverted lookup index. The index size can be tuned with the precision parameter. The geohasher and prefix tree map providers can be injected by implementing the IGeohasher and/or IGeohashTrieMap interfaces. |
|
|
Reallyliri.Yauaa
This is a .NET standard library that tries to parse and analyze the user agent string and extract as many relevant attributes as possible. The library aims to provides a reliable and extensible user agent parsing, browser and device detection. This is a semantic analyzer, so it doesn't rely on any database (except for some very little lookup tables), that means it is able to parse and recognize every day new kind of user agents and new patterns without updates. That makes the library very fast, flexible and easy to mantain, on the contrary the library can't extract info that are not present on user agent string without a proper mapping. The library doesn't aim to recognize every device in the world (there are several thousands), but it is able to work, analyze and extract all attributes available in the user agent. For most common devices we provide a lookup table in yaml file to identify device brand/model based on the few info available in the user agent. The library can be easily extended thanks to yaml files and a simple syntax (we don't rely on regular expression). Thanks to custom yaml definitions, you can make the library able to identify your company applications/ tools and extract your custom fields. |
|
|
TAO3
TAO3 is a .NET Interactive extension for writing data transformation quickly. |
|
|
Umbra.Avalonia.Router
Cross platform view (model) router library for AvaloniaUI |
Showing the top 1 popular GitHub repositories that depend on rm.Trie:
| Repository | Stars |
|---|---|
|
BG-IT-Edu/School-Programming
Хранилище за свободно учебно съдържание по програмиране, информатика и ИТ за българските училища в помощ на ИТ учителите
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.0 | 100,991 | 1/30/2024 |
| 1.5.0 | 638 | 11/19/2023 |
| 1.5.0-alpha0 | 130 | 11/3/2023 |
| 1.4.0 | 127 | 11/19/2023 |
| 1.4.0-alpha2 | 116 | 11/3/2023 |
| 1.4.0-alpha1 | 127 | 11/3/2023 |
| 1.4.0-alpha0 | 120 | 11/2/2023 |
| 1.3.6 | 366 | 9/24/2023 |
| 1.3.5 | 47,018 | 11/19/2021 |
| 1.3.5-alpha0 | 281 | 11/19/2021 |
| 1.3.4 | 282 | 11/19/2021 |
| 1.3.3 | 8,626 | 8/23/2021 |
| 1.3.3-alpha1 | 197 | 8/24/2021 |
| 1.3.3-alpha | 201 | 8/23/2021 |
| 1.3.2-alpha | 4,079 | 11/28/2020 |
| 1.3.1-alpha | 587 | 9/17/2020 |
| 1.3.0-alpha | 543 | 9/17/2020 |
| 1.2.1-alpha | 583 | 9/17/2020 |
| 1.2.0-alpha | 635 | 9/13/2020 |
| 1.1.0 | 145,339 | 8/24/2020 |
tag: v1.6.0