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.

HomeTextString indexing

BkTree.AddRange

Adds every item in a sequence, skipping duplicates.

public void AddRange(IEnumerable<string> items)

Parametersitems 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;   // => 4

Remarks — 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 alsoBkTree.Add, BkTree.Count.

⚠️ **GitHub.com Fallback** ⚠️