Text bktree addrange - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Text is 0.6.0 — read its documentation.
Home › Text › String indexing
Adds every item in a sequence, skipping duplicates.
public void AddRange(IEnumerable<string> items)Parameters — items is the sequence to index. It is enumerated once.
Returns — nothing. Read Count to see how many were distinct.
Example — one duplicate among five.
using Lodestar.Text.Indexing;
BkTree tree = BkTree.OverLevenshtein();
tree.AddRange(["book", "books", "boo", "cook", "book"]);
int count = tree.Count; // => 4Remarks — exactly Add in a loop, which is what makes the tree incremental:
there is no build step, so a dictionary can take a new word without a rebuild. That is the
difference from a VP-tree, which takes its whole array up front.
Applies to — net10.0, netstandard2.0.
See also — BkTree.Add, BkTree.Count.