Class DictionaryManager

java.lang.Object
org.omegat.core.spellchecker.DictionaryManager

public class DictionaryManager extends Object
Dictionary manager. Spell checking dictionaries' utility functions.
  • Constructor Details

    • DictionaryManager

      public DictionaryManager(File dir)
      Creates a new instance of DictionaryManager.
      Parameters:
      dir - : the directory where the spell checking dictionary files (*.(aff|dic) are available locally
  • Method Details

    • getDirectory

      public String getDirectory()
      returns the dictionary directory
    • getDictionaryNameList

      public List<String> getDictionaryNameList(List<String> aList)
      returns a list of full names of dictionaries from a dictionary code list
    • getLocalDictionaryNameList

      public List<String> getLocalDictionaryNameList()
      return a list of full names of the local dictionaries
    • getLocalDictionaryCodeList

      public List<String> getLocalDictionaryCodeList()
      returns a list of available dictionaries in the xx_YY form
    • getLocalDictionaryEntries

      public List<DictionaryManager.SpellingDictionaryEntry> getLocalDictionaryEntries()
      returns a list of available dictionaries.
    • uninstallDictionary

      @Deprecated public boolean uninstallDictionary(String lang)
      Deprecated.
      Uninstall (delete) a given dictionary from the dictionary directory
      Parameters:
      lang - : the language code (xx_YY) of the dictionary to be deleted
      Returns:
      true upon success, otherwise false
    • getInstallableDictionaryNameList

      public List<String> getInstallableDictionaryNameList() throws IOException
      return a list of names of installable dictionaries (e.g. en_US - english (USA))
      Throws:
      IOException
    • getInstallableDictionaryCodeList

      public List<String> getInstallableDictionaryCodeList() throws IOException
      returns a list of codes (xx_YY) of installable dictionaries
      Throws:
      IOException
    • installRemoteDictionary

      @Deprecated public void installRemoteDictionary(String langCode) throws IOException
      Deprecated.
      installs a remote dictionary by downloading the corresponding zip file from the net and by installing the aff and dic file to the dictionary directory.
      Parameters:
      langCode - : the language code (xx_YY)
      Throws:
      IOException