Suggester.fromJson constructor
Suggester.fromJson(
- TermMapping termMapping,
- dynamic json, {
- bool unicode = true,
- double termIdfWeighting = 1,
- double termProximalityWeighting = 1,
Construct a new Suggester from json
.
Implementation
Suggester.fromJson(TermMapping termMapping, dynamic json,
{bool unicode = true,
double termIdfWeighting = 1,
double termProximalityWeighting = 1,
double sharedSequenceLengthWeighting = 1})
: this._(
termMapping.runtimeType.toString() == json[_JSONKEY_TERMMAPPING]
? termMapping
: throw ArgumentError.value(json,
'Expected termMapping:${termMapping.runtimeType.toString()}, got termMapping:${json[_JSONKEY_TERMMAPPING]}'),
json[_JSONKEY_CASESENSITIVE] as bool,
unicode,
termIdfWeighting,
termProximalityWeighting,
sharedSequenceLengthWeighting,
<String, Entry>{},
(json[_JSONKEY_ENTRIES] as List).map((e) => Entry._fromJson(e)));