TermMapping class abstract

Maps from a String to a sequence of terms.

f : SS

such that

  • S is the set of all non empty Strings
  • ℕ is the set of Natural numbers
  • S is the set of all functions ℕ ↦ S

The sequence of terms is pairwise distinct, i.e. a term can occur only once in the returned sequence.

Suggester works by tokenising both suggestions and input using a Term Mapping and finding partial matches between them via prefix searching.

For example a TermMapping that groups inputs and suggestions into sequences of letters and numbers:

print(AlphaOrNumeric().map('Armani.Klein3@veda.io', false, false));
{armani, klein, 3, veda, io}

TermMapping that groups inputs and suggestions into NGrams of size 3, i.e. trigrams.

print(Ngrams(3).map('Armani.Klein3@veda.io', false, false));
{arm, rma, man, ani, ni., i.k, .kl, kle, lei, ein, in3, n3@, 3@v, @ve, ved, eda, da., a.i, .io}
Implementers

Constructors

TermMapping(Iterable<String> map(String entry, bool caseSensitive, bool unicode), double termDecay)
Construct TermMapping with specified map function.

Properties

hashCode int
The hash code for this object.
no setterinherited
map Iterable<String> Function(String entry, bool caseSensitive, bool unicode)
Performs mapping
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
termDecay double
Exponential decay value for term proximality calculation.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tpFromTermIdx(int termIdx) double
Weight terms inversely according to their proximality. Exponential decay of termIdx ensures that proximal terms are heavily weighted compared to distal.

Operators

operator ==(Object other) bool
The equality operator.
inherited