StringSimilarityEngine class
Engine for performing string similarity comparisons and fuzzy matching.
Inputs are normalized according to SimilarityOptions.normalization before scoring. Caches are per-engine and controlled by SimilarityOptions.cache.
Constructors
- StringSimilarityEngine({SimilarityOptions options = const SimilarityOptions(), SimilarityMetricRegistry? registry})
-
Creates a StringSimilarityEngine with the given
options.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- options → SimilarityOptions
-
The configuration options for this engine.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
compare(
String a, String b, {SimilarityAlgorithm algorithm = SimilarityAlgorithm.jaroWinkler, SimilarityMetric? metric}) → SimilarityScore -
Calculates the similarity score (0.0 to 1.0) between
aandb. -
compareWithDetails(
String a, String b, {SimilarityAlgorithm algorithm = SimilarityAlgorithm.jaroWinkler}) → SimilarityResult - Calculates similarity with detailed metadata (execution time, normalization, etc.).
-
findBestMatch(
String query, Iterable< String> candidates, {SimilarityAlgorithm algorithm = SimilarityAlgorithm.jaroWinkler, double minScore = 0.0, bool includeNormalized = false}) → FuzzyMatch<String> ? -
Finds the single best match for
queryincandidates. -
findMatches(
String query, Iterable< String> candidates, {SimilarityAlgorithm algorithm = SimilarityAlgorithm.jaroWinkler, double minScore = 0.0, int? topK, bool sort = true, bool includeNormalized = false}) → List<FuzzyMatch< String> > -
Finds matches for
queryincandidateswith a score >=minScore. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rankByRelevance(
String query, Iterable< String> candidates, {SimilarityAlgorithm algorithm = SimilarityAlgorithm.jaroWinkler, double minScore = 0.0, bool includeNormalized = false}) → List<FuzzyMatch< String> > -
Ranks
candidatesby similarity toquery. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited