An instance of the Alphabet class contains types of characters used for indexing. For detailed information on the types of characters, see the Character types page.
The GetCharacterType method is used to get the type of a specific character.
The Count property returns the number of characters of a type other than CharacterType.Separator.
To set the type of characters in the alphabet, use the SetRange method.
To set the CharacterType.Separator type for all characters in the alphabet, use the Clear method.
To export types of all characters to a file, use the ExportDictionary method.
To import types of all characters from a file, use the ImportDictionary method.
The following example demonstrates the use of methods of the alphabet.
C#
stringindexFolder=@"c:\MyIndex\";// Creating or opening an index from the specified folderIndexindex=newIndex(indexFolder);if(index.Dictionaries.Alphabet.Count>0){// Setting a type of all characters to Separatorindex.Dictionaries.Alphabet.Clear();}if(index.Dictionaries.Alphabet.GetCharacterType('-')!=CharacterType.Blended){// Setting a type of hyphen character to Blendedindex.Dictionaries.Alphabet.SetRange(newchar[]{'-'},CharacterType.Blended);}// Export the alphabet to a fileindex.Dictionaries.Alphabet.ExportDictionary(@"C:\Alphabet.dat");// Import the alphabet from a fileindex.Dictionaries.Alphabet.ImportDictionary(@"C:\Alphabet.dat");
More resources
GitHub examples
You may easily run the code from documentation articles and see the features in action in our GitHub examples: