We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

/processing/dictionary/update

Updates a given dictionary with new data and/or meta data.

The user must be authenticated and have write permissions to the associated site group.

Request

The request object has the following fields:

Name

Type

Required

Description

dictionaryId

String

Yes

The identifier of the dictionary to update.

name

String

No

A brief description of the dictionary's purpose and function.

description

String

No

A longer description of the dictionary's purpose and function.

workbook

String (Binary)

No

The dictionary data, provided as a base-64 encoded Excel workbook. The Excel workbook must adhere to certain

formatting rules

.

entries

Object

No

The dictionary data, provided as a JSON object. The JSON object must adhere to certain

formatting rules

.

The workbook and entries fields are mutually exclusive, only one of them can be provided.

See here for Excel workbook formatting rules, or here for the supported JSON syntax.

If workbook is provided and the workbook contains Japanese data, note that the workbook should not contain any phonetic run.aspx) data. Otherwise such data might be part of the data extracted from the workbook, and pollute the generated dictionaries. Possible ways to achieve this include, e.g., exporting the data to *.csv and then reimporting the data, or running a macro that deletes the phonetic run data.


Response

The response object has the following fields:

Name

Type

Description

dictionaryId

String

The identifier of the dictionary that was updated.

name

String

The name of the updated dictionary.

messages

Array of String

If workbook or entries were provided, a list of progress or warning messages may be have been produced during processing of the dictionary data.

Examples

Bash
$ # If the dictionary data is provided as an Excel workbook,
$ # we first base-64 encode the binary data.
$ WORKBOOK=$(base64 -i myworkbook.xlsx)

$ # Now upload the new dictionary data to replace the dictionary data
$ # that was already there, if anything. Inspect the messages to verify
$ # that everything went well.
$ echo '{"dictionaryId":"12345","workbook":"'$WORKBOOK'"}' | cx.py /processing/dictionary/update -
{
 "dictionaryId": "12345",
 "name": "My dictionary",
}

$ # We can change the description or rename it, too.
$ cx.py /processing/dictionary/update '{"dictionaryId":"12345","name":"My new name","description":"My new description."}'
{
 "dictionaryId": "12345",
 "name": "My new name"
}
Bash
$ # The dictionary data resides in a file in JSON format.
$ cat mydictionary.json | jq .
{
 "xyz-colors": {
 "pear": "green",
 "orange": "orange",
 "apple": [
 "green",
 "red"
 ],
 "coconut": "brown",
 "banana": [
 "yellow",
 "brown"
 ]
 },
 "global-properties": {
 "unique-count": 1,
 "count": 2,
 "swap-fields": true,
 "value-normalization-flags": 4,
 "key-normalization-flags": 4,
 "mode": "overlap",
 "tokenizer-context": "en"
 }
}

$ # Now upload the new dictionary data to replace the dictionary data
$ # that was already there, if anything. Inspect the messages to verify
$ # that everything went well.
$ echo '{"dictionaryId":"123454321","entries":'"$(<mydictionary.json)"'}' | cx.py /processing/dictionary/update -
{
 "dictionaryId": "123454321",
 "name": "My silly dictionary",
}

Last updated: