Loading Custom Word Dictionary
Function
This API is used to load custom word dictionaries stored on OBS.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/thesaurus | Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details, see Obtaining the Project ID and Account ID. |
| cluster_id | Yes | String | ID of the cluster where custom word dictionaries are to be configured. |
Request
Table 2 describes the request parameters.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| bucketName | Yes | String | OBS bucket where word dictionary files are stored. The bucket must be a standard storage or infrequently accessed storage and cannot be the archived storage. |
| mainObject | At least one of mainObject, stopObject, and synonymObject must be specified. | String | Main word dictionary file object, which must be a text file encoded in UTF-8 without BOM. Each line contains one sub-word. The maximum file size is 100 MB. |
| stopObject | String | Stop word dictionary file object, which must be a text file encoded in UTF-8 without BOM. Each line contains one sub-word. The maximum file size is 20 MB. | |
| synonymObject | String | Synonym word dictionary file, which must be a text file encoded in UTF-8 without BOM. Each line contains one group of sub-words. The maximum file size is 20 MB. |
Response
None
Examples
Example request
POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/thesaurus
{
"bucketName":"test-bucket",
"mainObject":"word/main.dic",
"stopObject":"word/stop.dic",
"synonymObject":"word/synonym.dic"
} Status Code
Table 3 describes the status code.
| Status Code | Code | Status Code Description |
|---|---|---|
| 200 | OK | The request is processed successfully. |
| 403 | Forbidden | The server understood the request, but is refusing to fulfill it. The client should not repeat the request without modifications. |
| 500 | InternalServerError | The server is able to receive the request but it could not understand the request. |
Last Article: IK Word Splitting
Next Article: Querying the Status of a Custom Word Dictionary
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.