com.groupdocs.search.dictionaries

Class SynonymDictionary

    • Constructor Detail

      • SynonymDictionary

        protected SynonymDictionary(String filePath,
                                    boolean saveOnChange)

        Initializes a new instance of the SynonymDictionary class.

        Parameters:
        filePath - The file name.
        saveOnChange - The save on change flag.
    • Method Detail

      • getCount

        public abstract int getCount()

        Gets the number of words contained in this SynonymDictionary.

        Returns:
        The number of words contained in this SynonymDictionary.
      • addRange

        public abstract void addRange(Iterable<String[]> synonyms)

        Adds the specified collection of synonym groups to this instance of the SynonymDictionary.

        Parameters:
        synonyms - The collection of synonym groups to add to the dictionary.
      • addRange

        public abstract void addRange(String[][] synonyms)

        Adds the specified collection of synonym groups to this instance of the SynonymDictionary.

        Parameters:
        synonyms - The collection of synonym groups to add to the dictionary.
      • clear

        public abstract void clear()

        Removes all words from this SynonymDictionary object.

      • getSynonyms

        public abstract String[] getSynonyms(String word)

        Gets the synonyms for the specified word. The resulting array does not contain the original word.

        Parameters:
        word - The word to suggest the synonyms.
        Returns:
        The synonyms for the specified word or empty array if the SynonymDictionary object does not contain the specified word.
      • getSynonymGroups

        public abstract String[][] getSynonymGroups(String word)

        Gets all groups of synonyms to which the specified word belongs.

        Parameters:
        word - The word for getting groups of synonyms.
        Returns:
        All groups of synonyms to which the specified word belongs.
      • getAllSynonymGroups

        public abstract String[][] getAllSynonymGroups()

        Gets all groups of synonyms contained in this dictionary.

        Returns:
        All groups of synonyms.
      • iterator

        public abstract Iterator<String> iterator()

        Returns an iterator that iterates through the collection.

        Specified by:
        iterator in interface Iterable<String>
        Returns:
        An iterator that can be used to iterate through the collection.