com.groupdocs.search.dictionaries

Class HomophoneDictionary

    • Constructor Detail

      • HomophoneDictionary

        protected HomophoneDictionary(EventHub events,
                           String filePath,
                           boolean saveOnChange)

        Initializes a new instance of the HomophoneDictionary class.

        Parameters:
        events - The event hub.
        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 HomophoneDictionary.

        Returns:
        The number of words.
      • addRange

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

        Adds the specified collection of homophone groups to this instance of the HomophoneDictionary.

        Parameters:
        homophones - The collection of homophone groups to add to the dictionary.
      • addRange

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

        Adds the specified collection of homophone groups to this instance of the HomophoneDictionary.

        Parameters:
        homophones - The collection of homophone groups to add to the dictionary.
      • clear

        public abstract void clear()

        Removes all words from a HomophoneDictionary object.

      • getHomophones

        public abstract String[] getHomophones(String word)

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

        Parameters:
        word - The word to suggest the homophones.
        Returns:
        The homophones for the specified word or empty array if the HomophoneDictionary object does not contain the specified word.
      • getHomophoneGroups

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

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

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

        public abstract String[][] getAllHomophoneGroups()

        Gets all groups of homophones contained in this dictionary.

        Returns:
        All groups of homophones.
      • 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.