A spelling correction algorithm that can identify and fix spelling mistakes.
To install spelling-correction, go to the Playground (Ctrl+OW) in your Pharo image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):
Metacello new
baseline: 'AISpellingCorrection';
repository: 'github://pharo-ai/spelling-correction/src';
load.If you want to add a dependency on spelling-correction to your project, include the following lines into your baseline method:
spec
baseline: 'AISpellingCorrection'
with: [ spec repository: 'github://pharo-ai/spelling-correction/src' ].If you are new to baselines and Metacello, check out the Baselines tutorial on Pharo Wiki.
corrector := AISpellingCorrector new.languageFile := 'pharo-local/iceberg/pharo-ai/spelling-correction/data/english.json' asFileReference.
corrector loadLanguageModelFrom: languageFile.corrector isKnownWord: 'something'. "true"
corrector isKnownWord: 'somthing'. "false"corrector correctionsFor: 'somthing'. "an OrderedCollection('something' 'soothing')"