Commit 255aedd1 authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent 8fa85cfc
{
"software": {
"name": "LanguageTool",
"version": "4.5-SNAPSHOT",
"buildDate": "2019-02-11 21:01",
"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": "French",
"code": "fr",
"detectedLanguage": {
"name": "French",
"code": "fr",
"confidence": 0.99
}
},
"matches": [
{
"message": "Le verbe « es » devrait être à la 3e personne du singulier.",
"shortMessage": "",
"replacements": [],
"offset": 11,
"length": 2,
"context": {
"text": "La voiture es ici. vous voulez quoie",
"offset": 11,
"length": 2
},
"sentence": "La voiture es ici.",
"type": {
"typeName": "Other"
},
"rule": {
"id": "ACCORD_NOM_VERBE",
"subId": "4",
"description": "sujet singulier + verbe 3e personne singulier",
"issueType": "uncategorized",
"category": {
"id": "CAT_GRAMMAIRE",
"name": "Grammaire"
}
},
"ignoreForIncompleteSentence": false
},
{
"message": "Cette phrase ne commence pas par une majuscule",
"shortMessage": "",
"replacements": [
{
"value": "Vous"
}
],
"offset": 19,
"length": 4,
"context": {
"text": "La voiture es ici. vous voulez quoie",
"offset": 19,
"length": 4
},
"sentence": "vous voulez quoie",
"type": {
"typeName": "Other"
},
"rule": {
"id": "UPPERCASE_SENTENCE_START",
"description": "Absence de majuscule en début de phrase",
"issueType": "typographical",
"category": {
"id": "CASING",
"name": "Majuscules"
}
},
"ignoreForIncompleteSentence": false
},
{
"message": "Faute de frappe possible trouvée",
"shortMessage": "Faute de frappe",
"replacements": [
{
"value": "cause"
},
{
"value": "côté"
},
{
"value": "code"
},
{
"value": "coupe"
},
{
"value": "côte"
},
{
"value": "quoi"
},
{
"value": "copie"
},
{
"value": "coule"
},
{
"value": "causé"
},
{
"value": "coin"
},
{
"value": "coulé"
},
{
"value": "coupé"
},
{
"value": "cône"
},
{
"value": "cote"
},
{
"value": "coude"
},
{
"value": "codé"
},
{
"value": "coke"
},
{
"value": "copié"
},
{
"value": "coté"
},
{
"value": "crie"
}
],
"offset": 31,
"length": 5,
"context": {
"text": "La voiture es ici. vous voulez quoie",
"offset": 31,
"length": 5
},
"sentence": "vous voulez quoie",
"type": {
"typeName": "UnknownWord"
},
"rule": {
"id": "FR_SPELLING_RULE",
"description": "Faute de frappe possible",
"issueType": "misspelling",
"category": {
"id": "TYPOS",
"name": "Faute de frappe possible"
}
},
"ignoreForIncompleteSentence": false
}
]
}
......@@ -36,6 +36,7 @@ void LanguageToolParserTest::shouldParseJson_data()
QTest::addColumn<int>("numberOfElement");
QTest::newRow("noerror") << QStringLiteral("noerror") << 0;
QTest::newRow("test1") << QStringLiteral("test1") << 1;
QTest::newRow("test2") << QStringLiteral("test2") << 3;
}
void LanguageToolParserTest::shouldParseJson()
......
......@@ -37,6 +37,8 @@ void LanguagetoolGrammarError::parse(const QJsonObject &obj, int blockindex)
mStart = obj[QStringLiteral("offset")].toInt(-1);
mLength = obj[QStringLiteral("length")].toInt(-1);
mSuggestions = parseSuggestion(obj);
//TODO generate specific color!
mColor = QColor(Qt::red);
//TODO ???
// mRule = obj[QStringLiteral("sRuleId")].toString();
// mOption = obj[QStringLiteral("sType")].toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment