配置语言工具以便与 Linux 上的 TexStudio 配合使用

配置语言工具以便与 Linux 上的 TexStudio 配合使用

我已经安装

sudo apt-get install default-jre
sudo apt-get install icedtea-plugin

下列的在 Ubuntu 上安装 Java。 我试过这个答案之后尝试按照步骤操作语言工具 HTTPS 服务器 唯一的区别是上述答案是我将语言工具保存在主文件夹中,而不是 opt 中。尝试运行语言工具服务器会导致

尝试运行语言工具服务器 这是

跑步

curl --data "language=en-US&text=a simple test" http://localhost:8081/v2/check

结果是

{"software":{"name":"LanguageTool","version":"5.4",
"buildDate":"2021-06-25 10:24:16 +0000","apiVersion":1,
"premium":false,
"premiumHint": "You might be missing errors only the Premium version can find. 
Contact us at support<at>languagetoolplus.com.",
"status":""},"warnings":{"incompleteResults":false},
"language":{"name":"English (US)","code":"en-US",
"detectedLanguage":{"name":"French","code":"fr","confidence":0.815771}},
"matches":[{"message":"This sentence does not start with an uppercase letter.","shortMessage":"",
"replacements":[{"value":"A"}],
"offset":0,"length":1,
"context":{"text":"a simple test","offset":0,"length":1},"sentence":"a simple test",
"type":{"typeName":"Other"},
"rule":{"id":"UPPERCASE_SENTENCE_START",
"description":"Checks that a sentence starts with an uppercase letter",
"issueType":"typographical","category":{"id":"CASING","name":"Capitalization"}},
"ignoreForIncompleteSentence":true,"contextForSureMatch"

同样地 http://localhost:8082/v2/check?language=en-US&text=my+text

导致

{"software":{"name":"LanguageTool","version":"5.4",
"buildDate":"2021-06-25 10:24:16 +0000",
"apiVersion":1,"premium":false,
"premiumHint": "You might be missing errors only the Premium version can find. Contact us at support<at>languagetoolplus.com.",
"status":""},"warnings":{"incompleteResults":false},
"language":{"name":"English (US)",
"code":"en-US",
"detectedLanguage":{"name":"English (US)","code":"en-US",
"confidence":0.65618557}},
"matches":[{"message": "This sentence does not start with an uppercase letter.",
"shortMessage":"",
"replacements":[{"value":"My"}],
"offset":0,"length":2,
"context":{"text":"my text","offset":0,"length":2},
"sentence":"my text","type":{"typeName":"Other"},
"rule":{"id":"UPPERCASE_SENTENCE_START",
"description":"Checks that a sentence starts with an uppercase letter",
"issueType":"typographical",
"category":{"id":"CASING","name":"Capitalization"}},
"ignoreForIncompleteSentence":true,"contextForSureMatch":-1}]}

奇怪的是,语言工具的独立版本可以 java -jar languagetool.jar 在终端中输入时使用 独立语言工具

我的 TeX 工作室设置 Texstudio 设置

Texstudio>帮助>检查语言工具的输出是

哪个 java:/usr/bin/java

JAVA:java -version openjdk 版本“11.0.11”2021-04-20 OpenJDK 运行环境(版本 11.0.11+9-Ubuntu-0ubuntu2.18.04)OpenJDK 64 位服务器 VM(版本 11.0.11+9-Ubuntu-0ubuntu2.18.04,混合模式)

实时检查已启用。语法检查已启用。

尝试自动启动。

LT 当前状态:正在运行

LT-URL:http://localhost:8081/v2/check

答案1

最好的办法是重新安装语言工作室。

的输出 curl --data "language=en-US&text=a simple test" http://localhost:8081/v2/check 清楚地表明您的浏览器无法呈现语言工具的输出。

相关内容