com.groupdocs.search.dictionaries

Class CharacterReplacementDictionary

  • All Implemented Interfaces:
    Iterable<Character>


    public abstract class CharacterReplacementDictionary
    extends DictionaryBase
    implements Iterable<Character>

    Represents a character replacement dictionary that is used during the indexing process. Character replacement can be used, for example, to remove accents from accented characters or to make case-insensitive index.

    • Constructor Detail

      • CharacterReplacementDictionary

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

        Initializes a new instance of the CharacterReplacementDictionary 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 characters contained in this CharacterReplacementDictionary.

        Returns:
        The number of characters in the dictionary.
      • addRange

        public abstract void addRange(Iterable<CharacterReplacementPair> characterReplacements)

        Adds the specified collection of character replacements to this instance of the CharacterReplacementDictionary.

        Parameters:
        characterReplacements - The collection of character replacements to add to the dictionary.
      • addRange

        public abstract void addRange(CharacterReplacementPair[] characterReplacements)

        Adds the specified collection of character replacements to this instance of the CharacterReplacementDictionary.

        Parameters:
        characterReplacements - The collection of character replacements to add to the dictionary.
      • removeRange

        public abstract void removeRange(char[] characters)

        Removes the specified collection of character replacements from this instance of the CharacterReplacementDictionary.

        Parameters:
        characters - The collection of characters to remove.
      • contains

        public abstract boolean contains(char character)

        Determines whether a CharacterReplacementDictionary object contains a replacement for the specified character.

        Parameters:
        character - The character to locate in the CharacterReplacementDictionary object.
        Returns:
        true if the CharacterReplacementDictionary object contains the specified character; otherwise, false.
      • getReplacement

        public abstract char getReplacement(char character)

        Gets a replacement for the specified character.

        Parameters:
        character - The character to get a replacement for.
        Returns:
        The replacement for the specified character.
      • clear

        public abstract void clear()

        Removes all character replacements from a CharacterReplacementDictionary object.

      • iterator

        public abstract Iterator<Character> iterator()

        Returns an iterator that iterates through the collection.

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