Decompounder
The decompounder
filter splits compound words into individual components based on a specified dictionary, making it easier to search for parts of compound terms. This filter is particularly useful for languages that frequently use compound words, such as German.
Configuration
The decompounder
filter is a custom filter in Zilliz Cloud. To use it, specify "type": "decompounder"
in the filter configuration, along with a word_list
parameter that provides the dictionary of word components to recognize.
- Python
- Java
- NodeJS
- Go
- cURL
analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "decompounder", # Specifies the filter type as decompounder
"word_list": ["dampf", "schiff", "fahrt", "brot", "backen", "automat"],
}],
}
Map<String, Object> analyzerParams = new HashMap<>();
analyzerParams.put("tokenizer", "standard");
analyzerParams.put("filter",
Collections.singletonList(
new HashMap<String, Object>() {{
put("type", "decompounder");
put("word_list", Arrays.asList("dampf", "schiff", "fahrt", "brot", "backen", "automat"));
}}
)
);
const analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "decompounder", // Specifies the filter type as decompounder
"word_list": ["dampf", "schiff", "fahrt", "brot", "backen", "automat"],
}],
};
// go
# restful
analyzerParams='{
"tokenizer": "standard",
"filter": [
{
"type": "decompounder",
"word_list": [
"dampf",
"schiff",
"fahrt",
"brot",
"backen",
"automat"
]
}
]
}'
The decompounder
filter accepts the following configurable parameters.
Parameter | Description |
---|---|
| A list of word components used to split compound terms. This dictionary determines how compound words are decomposed into individual terms. |
The decompounder
filter operates on the terms generated by the tokenizer, so it must be used in combination with a tokenizer. For a list of tokenizers available in Zilliz Cloud, refer to Tokenizer Reference.
After defining analyzer_params
, you can apply them to a VARCHAR
field when defining a collection schema. This allows Zilliz Cloud to process the text in that field using the specified analyzer for efficient tokenization and filtering. For details, refer to Example use.
Examples
Before applying the analyzer configuration to your collection schema, verify its behavior using the run_analyzer
method.
Analyzer configuration:
- Python
- Java
- NodeJS
- Go
- cURL
analyzer_params = {
"tokenizer": "standard",
"filter":[{
"type": "decompounder", # Specifies the filter type as decompounder
"word_list": ["dampf", "schiff", "fahrt", "brot", "backen", "automat"],
}],
}
// java
// javascript
// go
# restful
analyzerParams='{
"tokenizer": "standard",
"filter": [
{
"type": "decompounder",
"word_list": [
"dampf",
"schiff",
"fahrt",
"brot",
"backen",
"automat"
]
}
]
}'
**Verification using run_analyzer
:
- Python
- Java
- NodeJS
- Go
- cURL
# Sample text to analyze
sample_text = "dampfschifffahrt brotbackautomat"
# Run the standard analyzer with the defined configuration
result = MilvusClient.run_analyzer(sample_text, analyzer_params)
print(result)
// java
// javascript
// go
# restful
Expected output:
['dampf', 'schiff', 'fahrt', 'brotbackautomat']