Package com.swabunga.spell.engine

Examples of com.swabunga.spell.engine.SpellDictionary


 
  private boolean isCorrect(String word) {
   // if (userdictionary.isCorrect(word)) return true;
    for (Enumeration<SpellDictionary> e = dictionaries.elements(); e.hasMoreElements();) {
      SpellDictionary dictionary = e.nextElement();
      if (dictionary.isCorrect(word)) return true;
    }
    return false;
  }
View Full Code Here


 

  public List<Word> getSuggestions(String word, int threshold) {
    List<Word> suggestions = new Vector<Word>();//userdictionary.getSuggestions(word, threshold);
    for (Enumeration<SpellDictionary> e = dictionaries.elements(); e.hasMoreElements();) {
      SpellDictionary dictionary = e.nextElement();
      LinkedHashSet<Word> suggestionsWithoutDuplicate=new LinkedHashSet<Word>(dictionary.getSuggestions(word, threshold));
      suggestions.addAll(suggestionsWithoutDuplicate);
    }
    return suggestions;
  }
View Full Code Here

    {
      disabled=true;
      return;
    }
    String defaultLanguage =Preferences.getString("spell","defaultLanguage", null);
    SpellDictionary dictionary = (SpellDictionary)dictionaries.get(defaultLanguage);
    if(dictionary==null)
    {
      dictionary = (SpellDictionary)dictionaries.values().iterator().next();
    }
    spellChecker = new JTextComponentSpellChecker(dictionary);
View Full Code Here

          if(!dictionaries.containsKey(language))
          {
            String path =Start.path  + "dictionaries" + File.separator;
            loadDictionary(path,item.getActionCommand(),false);
          }
          SpellDictionary dictionary = (SpellDictionary)dictionaries.get(language);
          spellChecker = new JTextComponentSpellChecker(dictionary);
        }
      });
      subMenu.add(item);
    }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
public boolean isCorrect(String word) {
    if (userdictionary.isCorrect(word)) return true;
    for (Enumeration e = dictionaries.elements(); e.hasMoreElements();) {
      SpellDictionary dictionary = (SpellDictionary) e.nextElement();
      if (dictionary.isCorrect(word)) return true;
    }
    return false;
  }
View Full Code Here

    if (suggestions == null) {
       suggestions = new ArrayList(50);
   
       for (Enumeration e = dictionaries.elements(); e.hasMoreElements();) {
           SpellDictionary dictionary = (SpellDictionary) e.nextElement();
          
           if (dictionary != userdictionary)
              VectorUtility.addAll(suggestions, dictionary.getSuggestions(word, threshold), false);
       }

       if (cache != null && cache.size() < cacheSize)
         cache.put(word, suggestions);
    }
View Full Code Here

TOP

Related Classes of com.swabunga.spell.engine.SpellDictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.