DArek, looks great, thanks.
I will be happy to test your further versions .
The RestAPI does support bitext rule checking. Okapi CheckMate in the Rainbow suite uses it. And I used it programmatically to check entries from a database. It works like a charm…
You need to have a valid bitext file in the respective language folder. LT comes with bitext rules for RU, PL and GL.
Copy the attached bitext.xml into the languagetool org\languagetool\rules\de folder.
bitext.zip (692 Bytes)
With the http call:
http://localhost:8081/v2/check?language=de-DE&motherTongue=en-US&enabledonly=no&srctext=Choose Select Instance in the dropdown list.&text=Wählen Sie in der Dropdown-Liste Variante wählen.
you should get the following answer from LT:
{
“software”: {
“name”: “LanguageTool”,
“version”: “3.5”,
“buildDate”: “2016-09-30 09:59”,
“apiVersion”: “1”,
“status”: “”
},
“language”: {
“name”: “German (Germany)”,
“code”: “de-DE”
},
“matches”: [
{
“message”: “Möglicher Rechtschreibfehler gefunden”,
“shortMessage”: “Rechtschreibfehler”,
“replacements”: [],
“offset”: 18,
“length”: 14,
“context”: {
“text”: “Wählen Sie in der Dropdown-Liste Variante wählen.”,
“offset”: 18,
“length”: 14
},
“rule”: {
“id”: “GERMAN_SPELLER_RULE”,
“description”: “Möglicher Rechtschreibfehler”,
“issueType”: “misspelling”,
“category”: {
“id”: “TYPOS”,
“name”: “Mögliche Tippfehler”
}
}
},
{
“message”: “Falsche Terminologie: EN: ‘Select Instance’: ‘Variante’ ändern in ‘Variante auswählen’. Fehlerkategorie: WT;Serious (5)”,
“shortMessage”: “”,
“replacements”: [],
“offset”: 33,
“length”: 15,
“context”: {
“text”: “Wählen Sie in der Dropdown-Liste Variante wählen.”,
“offset”: 33,
“length”: 15
},
“rule”: {
“id”: “SELECT_INSTANCE”,
“subId”: “1”,
“description”: “EN: Select Instance, DE Variante wählen -> Variante auswählen”,
“issueType”: “terminology”,
“category”: {}
}
}
]
}
You can ignore the first message. The second error message comes from the bitext rulel
Please let me know if you need more information.
Thanks