public CharacterSimilarityResolverFactory AddPersianCommonMistakes()
        {
            if (File.Exists("CommonPersianCharacterMistakes.xml"))
            {
                var repo     = MistakesFactory.FromXml <char>("CommonPersianCharacterMistakes.xml");
                var mistakes = repo.GetMistakes();

                foreach (var mistake in mistakes)
                {
                    _resolver.SetMistakeSimilarity(mistake.Left, mistake.Right, mistake.Similarity);
                }
            }

            return(this);
        }
Exemple #2
0
        public WordSimilaritytResolverFactory AddEnglishCommonMistakes()
        {
            if (File.Exists("CommonEnglishWordMistakes.xml"))
            {
                var repo     = MistakesFactory.FromXml <Word>("CommonEnglishWordMistakes.xml");
                var mistakes = repo.GetMistakes();

                foreach (var mistake in mistakes)
                {
                    _resolver.SetMistakeSimilarity(mistake.Left, mistake.Right, mistake.Similarity);
                }
            }

            return(this);
        }