Package com.chatopera.bot.sdk
Class DictsMgr
java.lang.Object
com.chatopera.bot.sdk.DictsMgr
词典管理
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObject
createCustomVocabDict
(String dictname) 创建自定义词汇表词典org.json.JSONObject
createCustomVocabDict
(String dictname, String description) 创建自定义词汇表词典boolean
deleteCustomDict
(String dictname) Remove custom dict by nameboolean
deleteCustomVocabDictWord
(String dictname, String dictword) 删除自定义词典词条:指定标准词org.json.JSONObject
getCustomDict
(String dictname) 获得自定义词典的基本信息getCustomDicts
(int page, int limit) Get Custom Vocab Dicts by page 支持分页:page 第几页,从 1 开始;limit 每页数据条数getCustomVocabDictWord
(String dictname, String dictword) 返回自定义词典词条,指定词典标识和标准词getCustomVocabDictWords
(String dictname, int page, int limit) Get Custom Vocab Dictwords by page 支持分页:page 第几页,从 1 开始;limit 每页数据条数boolean
putCustomVocabDictWord
(String dictname, DictWord dictword) 创建或更新自定义词条词典的词条 如果存在该标准词的词条,将会使用传入的 synonyms 作为近义词进行覆盖
-
Constructor Details
-
DictsMgr
public DictsMgr(String clientId, String clientSecret, String baseUrl) throws MalformedURLException, ChatbotException -
DictsMgr
public DictsMgr(String clientId, String clientSecret) throws MalformedURLException, ChatbotException
-
-
Method Details
-
getCustomDicts
Get Custom Vocab Dicts by page 支持分页:page 第几页,从 1 开始;limit 每页数据条数- Parameters:
page
- Pagelimit
- Page size, records in page- Returns:
- Throws:
ChatbotException
-
getChatbot
-
deleteCustomDict
Remove custom dict by name- Parameters:
dictname
- 词典标识名- Returns:
- true, 删除成功;false,删除失败
- Throws:
ChatbotException
-
getCustomDict
public org.json.JSONObject getCustomDict(String dictname) throws ChatbotException, ResourceNotExistException 获得自定义词典的基本信息- Parameters:
dictname
-- Returns:
- Throws:
ChatbotException
ResourceNotExistException
-
createCustomVocabDict
public org.json.JSONObject createCustomVocabDict(String dictname) throws ResourceExistedException, ResourceNotCreatedException, ChatbotException 创建自定义词汇表词典- Parameters:
dictname
- 词典标识- Returns:
- Throws:
ResourceExistedException
ResourceNotCreatedException
ChatbotException
-
createCustomVocabDict
public org.json.JSONObject createCustomVocabDict(String dictname, String description) throws ChatbotException, ResourceNotCreatedException, ResourceExistedException 创建自定义词汇表词典- Parameters:
dictname
-- Returns:
- Throws:
ChatbotException
ResourceNotCreatedException
ResourceExistedException
-
putCustomVocabDictWord
创建或更新自定义词条词典的词条 如果存在该标准词的词条,将会使用传入的 synonyms 作为近义词进行覆盖- Parameters:
dictName
-dictWord
-- Returns:
- Throws:
ChatbotException
-
getCustomVocabDictWord
public DictWord getCustomVocabDictWord(String dictname, String dictword) throws ChatbotException, ResourceNotExistException, ResourceInvalidException 返回自定义词典词条,指定词典标识和标准词- Parameters:
dictname
-dictword
-- Returns:
- Throws:
ChatbotException
ResourceNotExistException
ResourceInvalidException
-
deleteCustomVocabDictWord
public boolean deleteCustomVocabDictWord(String dictname, String dictword) throws ChatbotException, ResourceOperationException 删除自定义词典词条:指定标准词- Parameters:
dictname
- 词典标识dictword
- 标准词- Returns:
- Throws:
ChatbotException
ResourceOperationException
-
getCustomVocabDictWords
public Response getCustomVocabDictWords(String dictname, int page, int limit) throws ChatbotException Get Custom Vocab Dictwords by page 支持分页:page 第几页,从 1 开始;limit 每页数据条数- Parameters:
dictname
- Custom vocab dict namepage
- Pagelimit
- Page size, records in page- Returns:
- Throws:
ChatbotException
-