AnalyzeTextOptions Class
Specifies some text and analysis components used to break that text into tokens.
All required parameters must be populated in order to send to Azure.
- Inheritance
-
azure.search.documents.indexes._generated._serialization.ModelAnalyzeTextOptions
Constructor
AnalyzeTextOptions(*, text: str, analyzer_name: str | None = None, tokenizer_name: str | None = None, normalizer_name: str | None = None, token_filters: List[str] | None = None, char_filters: List[str] | None = None, **kwargs)
Keyword-Only Parameters
Name | Description |
---|---|
text
Required
|
|
analyzer_name
Required
|
|
tokenizer_name
Required
|
|
normalizer_name
Required
|
|
token_filters
Required
|
|
char_filters
Required
|
|
Variables
Name | Description |
---|---|
text
|
Required. The text to break into tokens. |
analyzer_name
|
The name of the analyzer to use to break the given text. If this parameter is not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". |
tokenizer_name
|
The name of the tokenizer to use to break the given text. If this parameter is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". |
token_filters
|
An optional list of token filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. |
char_filters
|
An optional list of character filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. |
Methods
as_dict |
Return a dict that can be serialized using json.dump. |
deserialize |
Parse a str using the RestAPI syntax and return a AnalyzeTextOptions instance. |
enable_additional_properties_sending | |
from_dict |
Parse a dict using given key extractor return a model. By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor) |
is_xml_model | |
serialize |
Return the JSON that would be sent to server from this model. :param bool keep_readonly: If you want to serialize the readonly attributes :returns: A dict JSON compatible object :rtype: dict |
as_dict
Return a dict that can be serialized using json.dump.
as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
keep_readonly
|
If you want to serialize the readonly attributes Default value: True
|
key_transformer
|
A callable that will transform the key of the dict |
Returns
Type | Description |
---|---|
A dict JSON compatible object |
deserialize
Parse a str using the RestAPI syntax and return a AnalyzeTextOptions instance.
deserialize(data: Any, content_type: str | None = None) -> Self | None
Parameters
Name | Description |
---|---|
data
Required
|
A str using RestAPI structure. JSON by default. |
content_type
|
JSON by default, set application/xml if XML. Default value: None
|
Returns
Type | Description |
---|---|
A AnalyzeTextOptions instance |
Exceptions
Type | Description |
---|---|
DeserializationError if something went wrong
|
enable_additional_properties_sending
enable_additional_properties_sending() -> None
from_dict
Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) -> Self | None
Parameters
Name | Description |
---|---|
data
Required
|
A dict using RestAPI structure |
key_extractors
|
A callable that will extract a key from a dict Default value: None
|
content_type
|
JSON by default, set application/xml if XML. Default value: None
|
Returns
Type | Description |
---|---|
A AnalyzeTextOptions instance |
Exceptions
Type | Description |
---|---|
DeserializationError if something went wrong
|
is_xml_model
is_xml_model() -> bool
serialize
Return the JSON that would be sent to server from this model. :param bool keep_readonly: If you want to serialize the readonly attributes :returns: A dict JSON compatible object :rtype: dict
serialize(keep_readonly: bool = False, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
keep_readonly
|
Default value: False
|
Azure SDK for Python