API for executing dictionary requests. See /processing/dictionary/create for how to create dictionaries for this API.
Request
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
input |
String |
Yes |
The input string used when executing a dictionary request |
|
dictionaryId |
String |
Yes |
The dictionary id used in the request |
Response
|
Name |
Type |
Description |
|---|---|---|
|
matches |
array of DictionaryMatch objects |
The result of the dictionary request using the input from the client |
DictionaryMatch
|
Name |
Type |
Description |
|---|---|---|
|
sheet |
String |
The dictionary sheet for the match |
|
key |
String |
The dictionary key for the match |
|
value |
String |
The dictionary value for the match or null if there is no value associated with the key |
Supported dictionary modes
Not all dictionary modes are designed to support sheet/key/value. The following modes are supported:
-
complete
-
prefix
-
phrase
-
ranked
-
ngram
-
overlap
-
head
-
tail
-
keystroke
If a dictionary mode you need is not listed here, please contact support.
Examples
$ cx.py /processing/dictionary/search {"input":"merc","dictionaryId":"<dictionaryId>"}
{
"matches": [
{
"sheet": "xxx-car",
"key": "mercedes",
"value": "German car"
},
{
"sheet": "xxx-element",
"key": "mercury",
"value": "Metallic chemical element"
}
]
}