-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathlanguagetool.json
342 lines (342 loc) · 14.5 KB
/
languagetool.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
{
"swagger": "2.0",
"info": {
"title": "LanguageTool API",
"description": "Check texts for style and grammar issues with LanguageTool. See <a href='http://wiki.languagetool.org/public-http-api'>our wiki</a> for access limitations.",
"version": "1.0.2"
},
"host": "localhost:8081",
"schemes": [
"http"
],
"basePath": "/v2",
"produces": [
"application/json"
],
"consumes": [
"application/x-www-form-urlencoded"
],
"paths": {
"/check": {
"post": {
"summary": "Check a text",
"description": "The main feature - check a text with LanguageTool for possible style and grammar issues.",
"parameters": [
{
"name": "text",
"in": "formData",
"type": "string",
"description": "The text to be checked. This or 'data' is required.",
"required": false
},
{
"name": "data",
"in": "formData",
"type": "string",
"description": "The text to be checked, given as a JSON document that specifies what's text and what's markup. This or 'text' is required. Markup will be ignored when looking for errors. Example text: <pre>A <b>test</b></pre>JSON for the example text: <pre>{\"annotation\":[\n {\"text\": \"A \"},\n {\"markup\": \"<b>\"},\n {\"text\": \"test\"},\n {\"markup\": \"</b>\"}\n]}</pre> <p>If you have markup that should be interpreted as whitespace, like <tt><p></tt> in HTML, you can have it interpreted like this: <pre>{\"markup\": \"<p>\", \"interpretAs\": \"\\n\\n\"}</pre><p>The 'data' feature is not limited to HTML or XML, it can be used for any kind of markup.",
"required": false
},
{
"name": "language",
"in": "formData",
"type": "string",
"description": "A language code like `en-US`, `de-DE`, `fr`, or `auto` to guess the language automatically (see `preferredVariants` below). For languages with variants (English, German, Portuguese) spell checking will only be activated when you specify the variant, e.g. `en-GB` instead of just `en`.",
"required": true
},
{
"name": "altLanguages",
"in": "formData",
"type": "string",
"description": "EXPERIMENTAL: Comma-separated list of language codes to check if a word is not similar to one of the main language (parameter `language`). Unknown words that are similar to a word from the main language will still be considered errors but with type `Hint`. For languages with variants (English, German, Portuguese) you need to specify the variant, e.g. `en-GB` instead of just `en`.",
"required": false
},
{
"name": "motherTongue",
"in": "formData",
"type": "string",
"description": "A language code of the user's native language, enabling false friends checks for some language pairs."
},
{
"name": "preferredVariants",
"in": "formData",
"type": "string",
"description": "Comma-separated list of preferred language variants. The language detector used with `language=auto` can detect e.g. English, but it cannot decide whether British English or American English is used. Thus this parameter can be used to specify the preferred variants like `en-GB` and `de-AT`. Only available with `language=auto`."
},
{
"name": "enabledRules",
"in": "formData",
"type": "string",
"description": "IDs of rules to be enabled, comma-separated"
},
{
"name": "disabledRules",
"in": "formData",
"type": "string",
"description": "IDs of rules to be disabled, comma-separated"
},
{
"name": "enabledCategories",
"in": "formData",
"type": "string",
"description": "IDs of categories to be enabled, comma-separated"
},
{
"name": "disabledCategories",
"in": "formData",
"type": "string",
"description": "IDs of categories to be disabled, comma-separated"
},
{
"name": "enabledOnly",
"in": "formData",
"type": "boolean",
"default": false,
"description": "If true, only the rules and categories whose IDs are specified with `enabledRules` or `enabledCategories` are enabled."
}
],
"responses": {
"200": {
"description": "the result of checking the text",
"schema": {
"properties": {
"software": {
"type": "object",
"required": [
"name",
"version",
"buildDate",
"apiVersion"
],
"properties": {
"name": {
"type": "string",
"description": "Usually 'LanguageTool'."
},
"version": {
"type": "string",
"description": "A version string like '3.3' or '3.4-SNAPSHOT'."
},
"buildDate": {
"type": "string",
"description": "Date when the software was built, e.g. '2016-05-25'."
},
"apiVersion": {
"type": "integer",
"description": "Version of this API response. We don't expect to make incompatible changes, so this can also be increased for newly added fields."
},
"status": {
"type": "string",
"description": "An optional warning, e.g. when the API format is not stable."
},
"premium": {
"type": "boolean",
"description": "true if you're using a Premium account with all the premium text checks (since LanguageTool 4.2)"
}
}
},
"language": {
"type": "object",
"description": "The language used for checking the text.",
"required": [
"name",
"code",
"detectedLanguage"
],
"properties": {
"name": {
"type": "string",
"description": "Language name like 'French' or 'English (US)'."
},
"code": {
"type": "string",
"description": "ISO 639-1 code like 'en', 'en-US', or 'ca-ES-valencia'."
},
"detectedLanguage": {
"type": "object",
"description": "The automatically detected text language (might be different from the language actually used for checking).",
"required": [
"name",
"code"
],
"properties": {
"name": {
"type": "string",
"description": "Language name like 'French' or 'English (US)'."
},
"code": {
"type": "string",
"description": "ISO 639-1 code like 'en', 'en-US', or 'ca-ES-valencia'."
},
"confidence": {
"type": "number",
"description": "Estimate of the probability of the submitted text being in the detected language. Between 0 and 1."
}
}
}
}
},
"matches": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"offset",
"length",
"replacements",
"context",
"sentence"
],
"properties": {
"message": {
"type": "string",
"description": "Message about the error displayed to the user."
},
"shortMessage": {
"type": "string",
"description": "An optional shorter version of 'message'."
},
"offset": {
"type": "integer",
"description": "The 0-based character offset of the error in the text."
},
"length": {
"type": "integer",
"description": "The length of the error in characters."
},
"replacements": {
"type": "array",
"description": "Replacements that might correct the error. The array can be empty, in this case there is no suggested replacement.",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "the replacement string"
}
}
}
},
"context": {
"type": "object",
"required": [
"text",
"offset",
"length"
],
"properties": {
"text": {
"type": "string",
"description": "Context of the error, i.e. the error and some text to the left and to the left."
},
"offset": {
"type": "integer",
"description": "The 0-based character offset of the error in the context text."
},
"length": {
"type": "integer",
"description": "The length of the error in characters in the context."
}
}
},
"sentence": {
"type": "string",
"description": "The sentence the error occurred in (since LanguageTool 4.0 or later)"
},
"rule": {
"type": "object",
"required": [
"id",
"description",
"category"
],
"properties": {
"id": {
"type": "string",
"description": "An rule's identifier that's unique for this language."
},
"subId": {
"type": "string",
"description": "An optional sub identifier of the rule, used when several rules are grouped."
},
"description": {
"type": "string"
},
"urls": {
"type": "array",
"description": "An optional array of URLs with a more detailed description of the error.",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "the URL"
}
}
}
},
"issueType": {
"type": "string",
"description": "The <a href=\"http://www.w3.org/International/multilingualweb/lt/drafts/its20/its20.html#lqissue-typevalues\">Localization Quality Issue Type</a>. This is not defined for all languages, in which case it will always be 'Uncategorized'."
},
"category": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A category's identifier that's unique for this language."
},
"name": {
"type": "string",
"description": "A short description of the category."
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"/languages": {
"get": {
"summary": "Get a list of supported languages.",
"responses": {
"200": {
"description": "An array of language objects.",
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"code",
"longCode"
],
"properties": {
"name": {
"type": "string",
"description": "a language name like 'French' or 'English (Australia)'"
},
"code": {
"type": "string",
"description": "a language code like 'en'"
},
"longCode": {
"type": "string",
"description": "a language code like 'en-US' or 'ca-ES-valencia'"
}
}
}
}
}
}
}
}
}
}