public FrequencyCounterTest() { DictionaryManager manager = new DictionaryManager(@"C:\dev\git\Pspell\SpellCheckerConsole\bin\Debug\dictionaries"); Dictionary enUs = manager.GetDictionary("en_US"); charCounter = new CharFrequencyCounter(enUs.GetAlphabetForErrorModel(true)); twoCharCounter = new TwoCharFrequencyCounter(enUs.GetAlphabetForErrorModel(true)); }
public DictionaryGenerator(Dictionary dictionary, string directory, string outputDirectory) { this.dictionary = dictionary; this.outputDirectory = outputDirectory; this.directory = directory; this.errorModel = new MPSpell.Correction.ErrorModel(dictionary); this.languageModel = new LanguageModel(dictionary); int initValue = 1; char[] alphabetWithSpace = dictionary.GetAlphabetForErrorModel(true).ToCharArray(); char[] alphabet = dictionary.GetAlphabetForErrorModel().ToCharArray(); insGen = new InsertionsMatrixGenerator(alphabetWithSpace, initValue); delGen = new DeletionsMatrixGenerator(alphabetWithSpace, initValue); subGen = new SubstitutionsMatrixGenerator(alphabet, initValue); trnGen = new TranspositionsMatrixGenerator(alphabet, initValue); charCounter = new CharFrequencyCounter(alphabetWithSpace.ToStringArray()); twoCharCounter = new TwoCharFrequencyCounter(alphabetWithSpace.ToStringArray()); }