Sets the character type for each character in the specified collection.
def set_range(self, characters, type):
...
| Parameter |
Type |
Description |
| characters |
list[str] |
The collection of characters to set the type for. Can be a list of Unicode code points (int) or strings. |
| type |
CharacterType |
The character type (CharacterType). |
| Raises |
Description |
RuntimeError |
If the dictionary belongs to an index that contains documents, is not in the IndexStatus.ready status, or has been disposed. |
from groupdocs.search import Index
from groupdocs.search.dictionaries import CharacterType
index = Index("./MyIndex")
# Treat the hyphen and the ampersand as blended characters
index.dictionaries.alphabet.set_range(["-", "&"], CharacterType.BLENDED)
Sets the type for each character in the specified collection for this Alphabet instance.
def set_range(self, characters, type):
...
| Parameter |
Type |
Description |
| characters |
list[str] |
The collection of characters, surrogate pairs, or Unicode code points to set the type. |
| type |
CharacterType |
The character type (CharacterType). |
| Raises |
Description |
RuntimeError |
If the dictionary belongs to an index that contains documents, is not in the IndexStatus.ready status, or has been disposed. |
from groupdocs.search import Index
from groupdocs.search.dictionaries import CharacterType
index = Index("./MyIndex")
# A character outside the Basic Multilingual Plane is given as a string
index.dictionaries.alphabet.set_range(["\U0001D41A", "\U0001D41B"], CharacterType.LETTER) # Mathematical bold small a and b
Sets the character type for each Unicode code point in the given collection.
def set_range(self, code_points, type):
...
| Parameter |
Type |
Description |
| code_points |
list[int] |
The collection of Unicode code points to set the type. |
| type |
CharacterType |
The character type. |
| Raises |
Description |
RuntimeError |
The call changes the dictionary of an index that contains documents, is not in the Ready status or is disposed. |
from groupdocs.search.dictionaries import CharacterType
# Set the type for characters outside the Basic Multilingual Plane
alphabet.set_range([0x1D400, 0x1D401], CharacterType.LETTER) # Mathematical bold capital A and B
alphabet.set_range(["\U0001D41A"], CharacterType.LETTER) # Mathematical bold small A
These names call set_range too, limited to the overloads listed.
| Alias |
Accepts |
set_range_files |
set_range_files(characters, type) |
set_range_strings |
set_range_strings(characters, type) |
set_range_int32 |
set_range_int32(code_points, type) |
set_range_char |
set_range_char(characters, type) |
We value your opinion. Your feedback will help us improve our documentation.