你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
DictionaryDecompounderTokenFilter 类
分解在许多日耳曼语系中找到的复合词。 此令牌筛选器是使用 Apache Lucene 实现的。
必须填充所有必需的参数才能发送到 Azure。
- 继承
-
azure.search.documents.indexes._generated.models._models_py3.TokenFilterDictionaryDecompounderTokenFilter
构造函数
DictionaryDecompounderTokenFilter(*, name: str, word_list: List[str], min_word_size: int = 5, min_subword_size: int = 2, max_subword_size: int = 15, only_longest_match: bool = False, **kwargs: Any)
仅限关键字的参数
名称 | 说明 |
---|---|
name
|
令牌筛选器的名称。 它必须仅包含字母、数字、空格、短划线或下划线,只能以字母数字字符开头和结尾,且最多包含 128 个字符。 必需。 |
word_list
|
要匹配的字词列表。 必需。 |
min_word_size
|
最小字大小。 仅处理超过此长度的单词。 默认值为 5。 最大值为 300。 默认值: 5
|
min_subword_size
|
最小子字大小。 仅输出超过此长度的子字。 默认值为 2。 最大值为 300。 默认值: 2
|
max_subword_size
|
最大子字大小。 仅输出短于此的子字。 默认为 15. 最大值为 300。 默认值: 15
|
only_longest_match
|
一个值,该值指示是否仅将最长匹配子字添加到输出。 默认值为 false。 |
变量
名称 | 说明 |
---|---|
odata_type
|
指定令牌筛选器类型的 URI 片段。 必需。 |
name
|
令牌筛选器的名称。 它必须仅包含字母、数字、空格、短划线或下划线,只能以字母数字字符开头和结尾,且最多包含 128 个字符。 必需。 |
word_list
|
要匹配的字词列表。 必需。 |
min_word_size
|
最小字大小。 仅处理超过此长度的单词。 默认值为 5。 最大值为 300。 |
min_subword_size
|
最小子字大小。 仅输出超过此长度的子字。 默认值为 2。 最大值为 300。 |
max_subword_size
|
最大子字大小。 仅输出短于此的子字。 默认为 15. 最大值为 300。 |
only_longest_match
|
一个值,该值指示是否仅将最长匹配子字添加到输出。 默认值为 false。 |
方法
as_dict |
返回可使用 json.dump 进行序列化的 dict。 高级用法可以选择使用回调作为参数: Key 是 Python 中使用的属性名称。 Attr_desc是元数据的一个听写。 当前包含具有 msrest 类型的“type”和包含 RestAPI 编码键的“key”。 值是此对象中的当前值。 返回的字符串将用于序列化密钥。 如果返回类型是列表,则这被视为分层结果听写。 请参阅此文件中的三个示例:
如果需要 XML 序列化,可以传递 kwargs is_xml=True。 |
deserialize |
使用 RestAPI 语法分析 str 并返回模型。 |
enable_additional_properties_sending | |
from_dict |
使用给定的键提取程序分析 dict 返回一个模型。 默认情况下,请考虑密钥提取程序 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor和last_rest_key_case_insensitive_extractor) |
is_xml_model | |
serialize |
返回将从此模型发送到服务器的 JSON。 这是as_dict (full_restapi_key_transformer的别名 ,keep_readonly=False) 。 如果需要 XML 序列化,可以传递 kwargs is_xml=True。 |
as_dict
返回可使用 json.dump 进行序列化的 dict。
高级用法可以选择使用回调作为参数:
Key 是 Python 中使用的属性名称。 Attr_desc是元数据的一个听写。 当前包含具有 msrest 类型的“type”和包含 RestAPI 编码键的“key”。 值是此对象中的当前值。
返回的字符串将用于序列化密钥。 如果返回类型是列表,则这被视为分层结果听写。
请参阅此文件中的三个示例:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
如果需要 XML 序列化,可以传递 kwargs is_xml=True。
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]
参数
名称 | 说明 |
---|---|
key_transformer
|
<xref:function>
密钥转换器函数。 |
keep_readonly
|
默认值: True
|
返回
类型 | 说明 |
---|---|
与 dict JSON 兼容的对象 |
deserialize
使用 RestAPI 语法分析 str 并返回模型。
deserialize(data: Any, content_type: str | None = None) -> ModelType
参数
名称 | 说明 |
---|---|
data
必需
|
使用 RestAPI 结构的 str。 默认情况下为 JSON。 |
content_type
|
默认情况下,如果 XML,则设置 application/xml。 默认值: None
|
返回
类型 | 说明 |
---|---|
此模型的实例 |
例外
类型 | 说明 |
---|---|
DeserializationError if something went wrong
|
enable_additional_properties_sending
enable_additional_properties_sending() -> None
from_dict
使用给定的键提取程序分析 dict 返回一个模型。
默认情况下,请考虑密钥提取程序 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor和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) -> ModelType
参数
名称 | 说明 |
---|---|
data
必需
|
使用 RestAPI 结构的 dict |
content_type
|
默认情况下,如果 XML,则设置 application/xml。 默认值: None
|
key_extractors
|
默认值: None
|
返回
类型 | 说明 |
---|---|
此模型的实例 |
例外
类型 | 说明 |
---|---|
DeserializationError if something went wrong
|
is_xml_model
is_xml_model() -> bool