3.4 语义理解示例

# 3.4 示例 </br> ## 3.4.1 用法示例 ~~~ //请联系灵聚科技工作人员获取专属产品的key与授权码值 static const std::string KEY = " xxx"; static const std::string AUTHCODE = "xxx"; static std::string city; static std::string lat; static std::string lng; static const int TIMEOUT_SECONDS = 10*1000; boost::shared_ptr<SemanticUnderstand> suInstance = emanticUnderstand::getInstance(); suInstance->init(KEY, AUTHCODE, city, lat, lng, TIMEOUT_SECONDS); SemanticResult result=suInstance->getAnswer("你叫什么名字"); ~~~ </br> ## 3.4.2 用法例子项目 * 位于:LingjuSdk/(window或linux)平台/LingjuSdk/SemanticExample。具体详见[9.项目打开方式](doc:2HufZRB1) * 请把从开发平台申请到的key和authcode替换LingjuSdk/SemanticExample/com/lingju/init/ExampleTest.cpp文件中相应的值, 如图下所示: ![](images/screenshot_1497353388060.png)