CharacterReplacementDictionary

CharacterReplacementDictionary class

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 a case-insensitive index.

public class CharacterReplacementDictionary : DictionaryBase, IEnumerable<int>

Properties

Name Description
Count { get; } Gets the number of Unicode code points contained in this CharacterReplacementDictionary.
override DictionaryType { get; } Gets the dictionary type.

Methods

Name Description
AddRange(CharacterReplacementPair[]) Adds the specified collection of character replacements to this instance of the CharacterReplacementDictionary.
AddRange(IEnumerable<CharacterReplacementPair>) Adds the specified collection of character replacements to this instance of the CharacterReplacementDictionary.
AddRange(IEnumerable<KeyValuePair<char, char>>) Adds the specified collection of character replacements to this instance of the CharacterReplacementDictionary.
AddRange(IEnumerable<KeyValuePair<int, int>>) Adds the specified collection of Unicode code point replacements to this instance of the CharacterReplacementDictionary.
override Clear() Removes all character replacements from a CharacterReplacementDictionary object.
Contains(int) Determines whether a CharacterReplacementDictionary object contains a replacement for the specified Unicode code point.
ExportDictionary(string) Exports the dictionary to a file with the specified name.
GetEnumerator() Returns an enumerator that iterates through the collection.
GetReplacement(int) Gets a replacement for the specified Unicode code point.
ImportDictionary(string) Imports a dictionary from the specified file.
RemoveRange(char[]) Removes the specified collection of character replacements from this instance of the CharacterReplacementDictionary.
RemoveRange(IEnumerable<char>) Removes the specified collection of character replacements from this instance of the CharacterReplacementDictionary.
RemoveRange(IEnumerable<int>) Removes the specified collection of Unicode code point replacements from this instance of the CharacterReplacementDictionary.
RemoveRange(int[]) Removes the specified collection of Unicode code point replacements from this instance of the CharacterReplacementDictionary.

Remarks

The dictionary defines how the text of documents is divided into terms. Therefore the dictionary of an index can be changed only while the index contains no documents and its status is Ready; otherwise a method that changes the dictionary throws InvalidOperationException. A call that does not change the content of the dictionary is always allowed. To use another content with documents that are indexed already, create a new index and index the documents again.

The replacements of an index are applied to the words of its searches as well, see UseCharacterReplacements.

A change of the dictionary of an index is saved in the index at once. If it cannot be saved, the method throws the exception that describes the failure, and the dictionary stays unchanged.

Learn more

See Also