首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IBM Watson Assistant -变音

IBM Watson Assistant -变音
EN

Stack Overflow用户
提问于 2020-06-17 19:37:13
回答 1查看 54关注 0票数 0

最近,我尝试使用IBM的Watson文本助手。我选择用Java对它进行编程,一切都很好,直到我尝试使用德语短语,也就是使用元音,ö,ü。

技能语言也是德语。

当收到接口的响应时,所有的变音都替换为�。

代码如下:

代码语言:javascript
复制
public String inquiry(String anfrage){
    MessageInput input = new MessageInput();
    input.setText(anfrage);

    MessageOptions options = new MessageOptions.Builder(WORKSPACEID)
            .input(input)
            .build();

    MessageResponse response = assistant.message(options)
            .execute()
            .getResult();

    return response.getOutput().getGeneric().get(0).text();
}

您知道从IBM API中正确获取变音的方法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-17 21:43:12

在我的例子中,这行代码做到了。(感谢@data_henrik)

代码语言:javascript
复制
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out), true, "UTF-8"));
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62428061

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档