Beispiel #1
0
        public static Hunspell GetSpellChecker(AvailableDictionaries dictionaryName = AvailableDictionaries.en_US)
        {
            string affFilePath        = GetFilePath(Enum.GetName(typeof(AvailableDictionaries), dictionaryName), ".aff");
            string dictionaryFilePath = GetFilePath(Enum.GetName(typeof(AvailableDictionaries), dictionaryName), ".dic");

            if (_spellChecker == null)
            {
                _spellChecker = new Hunspell(affFilePath, dictionaryFilePath);
            }
            return(_spellChecker);
        }
Beispiel #2
0
 public static void InitDictionaries()
 {
     dictionaries.Clear();
     string[] includedDictionaries = AvailableDictionaries.Split(splitterForAvailableDictionaries);
     foreach (Type type in AllDictionaries)
     {
         if (Array.IndexOf(includedDictionaries, type.FullName) != -1)
         {
             dictionaries.Add(type);
         }
     }
 }
Beispiel #3
0
 public SpellChecker(AvailableDictionaries dictionaryName = AvailableDictionaries.en_US)
 {
     if (_currentSpellChecker == null)
     {
         _currentSpellChecker = SpellCheckerFactory.GetSpellChecker(dictionaryName);
         var projectDictionaryWords = AryaTools.Instance.InstanceData.Dc.ProjectDictionaries.Select(pd => pd.Word);
         foreach (string word in projectDictionaryWords.ToList())
         {
             _currentSpellChecker.Add(word);
         }
     }
 }