Class DictionaryManager


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

      Constructors 
      Constructor Description
      DictionaryManager​(java.io.File dir)
      Creates a new instance of DictionaryManager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getDictionaryNameList​(java.util.List<java.lang.String> aList)
      returns a list of full names of dictionaries from a dictionary code list
      java.lang.String getDirectory()
      returns the dictionary directory
      java.util.List<java.lang.String> getInstallableDictionaryCodeList()
      returns a list of codes (xx_YY) of installable dictionaries
      java.util.List<java.lang.String> getInstallableDictionaryNameList()
      return a list of names of installable dictionaries (e.g.
      java.util.List<java.lang.String> getLocalDictionaryCodeList()
      returns a list of available dictionaries in the xx_YY form
      java.util.List<java.lang.String> getLocalDictionaryNameList()
      return a list of full names of the local dictionaries
      void installRemoteDictionary​(java.lang.String langCode)
      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.
      boolean uninstallDictionary​(java.lang.String lang)
      Uninstall (delete) a given dictionary from the dictionary directory
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DictionaryManager

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

      • getDirectory

        public java.lang.String getDirectory()
        returns the dictionary directory
      • getDictionaryNameList

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

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

        public java.util.List<java.lang.String> getLocalDictionaryCodeList()
        returns a list of available dictionaries in the xx_YY form
      • uninstallDictionary

        public boolean uninstallDictionary​(java.lang.String lang)
        Uninstall (delete) a given dictionary from the dictionary directory
        Parameters:
        lang - : the language code (xx_YY) of the dictionary to be deleted
      • getInstallableDictionaryNameList

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

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

        public void installRemoteDictionary​(java.lang.String langCode)
                                     throws java.io.IOException
        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:
        java.io.IOException