Text Lodestar.Text - CyrilB1531/lodestar GitHub Wiki

Development build. This page describes main, not a released package. The latest published Lodestar.Text is 0.7.0 — read its documentation.

Home › Text

Lodestar.Text

String distances, phonetic codes, set similarity, stemmers, tokenizers and sparse text vectorizers, native and allocation-lean. Levenshtein with a bit-parallel path, Jaro-Winkler, Damerau-Levenshtein and the rest of the edit distances; Soundex, Metaphone, Double Metaphone and NYSIIS; Snowball stemmers for fifteen languages; CountVectorizer, TfidfVectorizer and HashingVectorizer producing a sparse matrix; BM25 and keyword search; RAKE and TextRank keyword extraction; a BK-tree for dictionary lookup; MinHash, SimHash and LSH sketches.

Install

dotnet add package Lodestar.Text

Example

using Lodestar.Text.Distances;

int edits = Levenshtein.Distance("kitten", "sitting");                   // 3
double similarity = Levenshtein.NormalizedSimilarity("kitten", "sitting"); // 0.5714…

Parity

Each function is replayed against the Python library it mirrors: rapidfuzz, jellyfish, textdistance, difflib, scikit-learn's text feature extraction and nltk's Snowball stemmers. docs/equivalence.md maps each Python call to its C# counterpart, with every deliberate divergence.

Dependencies

A core package (decision 0003), built for net10.0 and netstandard2.0:

  • Lodestar.Abstractions 0.2.0 or later

Documentation