Suggester.fromJson constructor

Suggester.fromJson(
  1. TermMapping termMapping,
  2. dynamic json, {
  3. bool unicode = true,
  4. double termIdfWeighting = 1,
  5. double termProximalityWeighting = 1,
  6. double sharedSequenceLengthWeighting = 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)));