Text 0.6.0 keywordmatch - CyrilB1531/lodestar GitHub Wiki

Lodestar.Text 0.6.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

KeywordMatch

One extracted phrase and the score that ranked it.

public readonly record struct KeywordMatch(string Phrase, double Score)

Example — reading a hit apart.

using Lodestar.Text.Keywords;

var rake = new Rake();
var hits = rake.Extract("linear constraints and linear constraints");

KeywordMatch hit = hits[0];
string phrase = hit.Phrase;  // => linear constraints

RemarksPhrase is the extractor's own assembly of the source text — a RAKE run verbatim, or a TextRank glue of adjacent survivors. Score is higher-is-better and on a scale specific to the extractor that produced it: a Rake score and a TextRank score are never comparable, even on the same document.

Being a record struct, it compares by value and deconstructs — var (phrase, score) = hit; works.

Applies to — net10.0, netstandard2.0.

See alsoRake.Extract, TextRank.Extract, the keyword extraction guide.