dart_phonetics 1.0.1 copy "dart_phonetics: ^1.0.1" to clipboard
dart_phonetics: ^1.0.1 copied to clipboard

A collection of phonetic algorithms. These algorithms help find words or names that sound similar by generating an encoding that can be compared or indexed for fuzzy searching.

example/main.dart

import 'package:dart_phonetics/dart_phonetics.dart';

void _printResult(PhoneticEncoder encoder, String input) {
  final encoding = encoder.encode(input);
  print(
      '${encoder.runtimeType.toString()} - "$input"\n  primary = ${encoding?.primary}\n  alternate = ${encoding?.alternates}\n');
}

void main() {
  final inputString = 'Cardillo-Ashcroft';

  final soundex = Soundex.americanEncoder;
  _printResult(soundex, inputString);

  final customSoundex = Soundex.fromMapping(Soundex.americanMapping,
      maxLength: 0, paddingEnabled: false, ignoreHW: false);
  _printResult(customSoundex, inputString);

  final refinedSoundex = RefinedSoundex.defaultEncoder;
  _printResult(refinedSoundex, inputString);

  final nysiisOriginal = Nysiis.originalEncoder;
  _printResult(nysiisOriginal, inputString);

  final nysiisModified = Nysiis.withOptions(maxLength: 0, enableModified: true);
  _printResult(nysiisModified, inputString);

  final doubleMetaphone = DoubleMetaphone.withMaxLength(12);
  _printResult(doubleMetaphone, inputString);
}
18
likes
130
pub points
77%
popularity

Publisher

verified publishercardilloonline.com

A collection of phonetic algorithms. These algorithms help find words or names that sound similar by generating an encoding that can be compared or indexed for fuzzy searching.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

charcode

More

Packages that depend on dart_phonetics