-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the use of the free ngram data #113
Comments
This is already possible with |
Duplicate of valentjn/vscode-ltex#3. |
I have my ngrams unzipped in the home directory like so:
and my Neovim config looks like:
I am using the text they suggest to test for the ngram feature and it is not working:
Is there something wrong with |
You need to set it to the parent directory of I clarified this in the docs. |
Brilliant! It now picks them up. Strangely
|
There are code actions, at least in VS Code. I'm pretty sure LTEX LS is working as intended. Code action request and response for Sending request 'textDocument/codeAction - (1)'.
Params: {
"textDocument": {
"uri": "untitled:Untitled-1"
},
"range": {
"start": {
"line": 0,
"character": 27
},
"end": {
"line": 0,
"character": 33
}
},
"context": {
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 27
},
"end": {
"line": 0,
"character": 33
}
},
"message": "'breaks' (interruptions) seems less likely than 'brakes' (mechanical device to stop motion).",
"code": "CONFUSION_RULE_BREAKS_BRAKES",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_BREAKS_BRAKES?lang%3Den-US"
},
"severity": 3,
"source": "LTeX"
}
],
"only": [
"quickfix"
]
}
}
Received response 'textDocument/codeAction - (1)' in 32ms.
Result: [
{
"title": "Use 'brakes'",
"kind": "quickfix.ltex.acceptSuggestions",
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 27
},
"end": {
"line": 0,
"character": 33
}
},
"severity": 3,
"code": "CONFUSION_RULE_BREAKS_BRAKES",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_BREAKS_BRAKES?lang=en-US"
},
"source": "LTeX",
"message": "'breaks' (interruptions) seems less likely than 'brakes' (mechanical device to stop motion)."
}
],
"edit": {
"documentChanges": [
{
"textDocument": {
"version": 1,
"uri": "untitled:Untitled-1"
},
"edits": [
{
"range": {
"start": {
"line": 0,
"character": 27
},
"end": {
"line": 0,
"character": 33
}
},
"newText": "brakes"
}
]
}
]
}
},
{
"title": "Hide false positive",
"kind": "quickfix.ltex.hideFalsePositives",
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 27
},
"end": {
"line": 0,
"character": 33
}
},
"severity": 3,
"code": "CONFUSION_RULE_BREAKS_BRAKES",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_BREAKS_BRAKES?lang=en-US"
},
"source": "LTeX",
"message": "'breaks' (interruptions) seems less likely than 'brakes' (mechanical device to stop motion)."
}
],
"command": {
"title": "Hide false positive",
"command": "_ltex.hideFalsePositives",
"arguments": [
{
"uri": "untitled:Untitled-1",
"falsePositives": {
"en-US": [
"{\"rule\":\"CONFUSION_RULE_BREAKS_BRAKES\",\"sentence\":\"^\\\\QDon't forget to put on the breaks\\\\E$\"}"
]
}
}
]
}
},
{
"title": "Disable rule",
"kind": "quickfix.ltex.disableRules",
"diagnostics": [
{
"range": {
"start": {
"line": 0,
"character": 27
},
"end": {
"line": 0,
"character": 33
}
},
"severity": 3,
"code": "CONFUSION_RULE_BREAKS_BRAKES",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_BREAKS_BRAKES?lang=en-US"
},
"source": "LTeX",
"message": "'breaks' (interruptions) seems less likely than 'brakes' (mechanical device to stop motion)."
}
],
"command": {
"title": "Disable rule",
"command": "_ltex.disableRules",
"arguments": [
{
"uri": "untitled:Untitled-1",
"ruleIds": {
"en-US": [
"CONFUSION_RULE_BREAKS_BRAKES"
]
}
}
]
}
}
] Code action request and response for Sending request 'textDocument/codeAction - (3)'.
Params: {
"textDocument": {
"uri": "untitled:Untitled-1"
},
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 5
}
},
"context": {
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 5
}
},
"message": "'there' (as in 'Is there an answer?') seems less likely than 'their' (as in 'It’s not their fault.').",
"code": "CONFUSION_RULE_THERE_THEIR",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_THERE_THEIR?lang%3Den-US"
},
"severity": 3,
"source": "LTeX"
}
],
"only": [
"quickfix"
]
}
}
Received response 'textDocument/codeAction - (3)' in 5ms.
Result: [
{
"title": "Use 'their'",
"kind": "quickfix.ltex.acceptSuggestions",
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 5
}
},
"severity": 3,
"code": "CONFUSION_RULE_THERE_THEIR",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_THERE_THEIR?lang=en-US"
},
"source": "LTeX",
"message": "'there' (as in 'Is there an answer?') seems less likely than 'their' (as in 'It’s not their fault.')."
}
],
"edit": {
"documentChanges": [
{
"textDocument": {
"version": 1,
"uri": "untitled:Untitled-1"
},
"edits": [
{
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 5
}
},
"newText": "their"
}
]
}
]
}
},
{
"title": "Hide false positive",
"kind": "quickfix.ltex.hideFalsePositives",
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 5
}
},
"severity": 3,
"code": "CONFUSION_RULE_THERE_THEIR",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_THERE_THEIR?lang=en-US"
},
"source": "LTeX",
"message": "'there' (as in 'Is there an answer?') seems less likely than 'their' (as in 'It’s not their fault.')."
}
],
"command": {
"title": "Hide false positive",
"command": "_ltex.hideFalsePositives",
"arguments": [
{
"uri": "untitled:Untitled-1",
"falsePositives": {
"en-US": [
"{\"rule\":\"CONFUSION_RULE_THERE_THEIR\",\"sentence\":\"^\\\\Qthere last chance\\\\E$\"}"
]
}
}
]
}
},
{
"title": "Disable rule",
"kind": "quickfix.ltex.disableRules",
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 0
},
"end": {
"line": 2,
"character": 5
}
},
"severity": 3,
"code": "CONFUSION_RULE_THERE_THEIR",
"codeDescription": {
"href": "https://community.languagetool.org/rule/show/CONFUSION_RULE_THERE_THEIR?lang=en-US"
},
"source": "LTeX",
"message": "'there' (as in 'Is there an answer?') seems less likely than 'their' (as in 'It’s not their fault.')."
}
],
"command": {
"title": "Disable rule",
"command": "_ltex.disableRules",
"arguments": [
{
"uri": "untitled:Untitled-1",
"ruleIds": {
"en-US": [
"CONFUSION_RULE_THERE_THEIR"
]
}
}
]
}
}
] |
Working fine on nvim 0.5.1 (and most possibly on vim) through coc.nvim as well: @David-Else careful to not confuse actions at the cursor (just one at a time) with actions for the whole document (two actions). Gif above illustrates that. Not sure whether that's the case or not in your setup. |
@oblitum Thanks! You were right, I needed to move the cursor over the word :) |
@David-Else nice. In case you're unaware I'd like to share that it's possible to trigger it for code comments, I find it a great feature. You would have to figure out how to do that on your setup though. |
Language Tool can be greatly enhanced using the free ngram data, all the info is here: https://dev.languagetool.org/finding-errors-using-n-gram-data
It would be great if the user could supply the directory that they have downloaded this to and
ltex-ls
could use it.Thanks.
The text was updated successfully, but these errors were encountered: