String requestJson = "{text:'我要看复仇者联盟'}";
ResponseResult respResult = NLUAPIService.getInstance().
getWordSegment(requestJson,
NLUConstants.REQUEST_TYPE_LOCAL);
if (null != respResult)
{
//获取接口返回结果,参考接口文档返回使用
String result = respResult.getJsonRes();
}
{"code":0,"message":"success","words":
["我","要","看","复仇","者","联盟"]}
目前分词,支持中文。
分词是端测的,用户在手机断网的情况下,仍然可以使用这个功能。
SDK设计为单例,最好在application的onCreate里面初始化,onDestroy里面销毁。