wysiib / linter-languagetool Goto Github PK
View Code? Open in Web Editor NEWIntegration of Languagetool into the Atom text editor.
License: MIT License
Integration of Languagetool into the Atom text editor.
License: MIT License
No offend, but I don't really like the LT info thing in the status bar.
Is it possible to add an option to disable this icon?
Best,
Michael
I am running linter-languagetool
with a locally installed languagetool
server. I am trying to pass a config file to languagetool
server using the settings interface of linter-languagetool
.
However, linter-languagetool
does not seem to respect the config file.
For testing purposes I use the following .languagetool.cfg
:
maxTextLength=1
However, languagetool
server started by linter-languagetool
will not consider this config file. For example, if I send a POST
➜ http POST http://localhost:8081/v2/check text=="I can't remember how to go their." language==en-US
HTTP/1.1 200 OK
Content-length: 436
Content-type: application/json
Date: Mon, 06 May 2019 13:05:53 GMT
{
"language": {
"code": "en-US",
"detectedLanguage": {
"code": "en-US",
"confidence": 0.99999094,
"name": "English (US)"
},
"name": "English (US)"
},
"matches": [],
"software": {
"apiVersion": 1,
"buildDate": "2019-03-26 11:37",
"name": "LanguageTool",
"premium": false,
"premiumHint": "You might be missing errors only the Premium version can find. Contact us at support<at>languagetoolplus.com.",
"status": "",
"version": "4.5"
},
"warnings": {
"incompleteResults": false
}
}
Now, to remove the possibility of problems with the config file itself, I check top
for what is actually run and run the server myself.
➜ /usr/bin/java -cp /usr/local/Cellar/languagetool/4.5/libexec/languagetool-server.jar org.languagetool.server.HTTPServer --port 8082 --config /Users/daniel/.languagetool.cfg
Resulting in the expected behavior
➜ http POST http://localhost:8082/v2/check text=="I can't remember how to go their." language==en-US
HTTP/1.1 413 Request Entity Too Large
Content-length: 102
Date: Mon, 06 May 2019 13:21:39 GMT
Error: Your text exceeds the limit of 1 characters (it's 33 characters). Please submit a shorter text.
OS: macOS 10.14.4
Atom: 1.36.1
linter-languagetool: 0.9.0
languagetool 4.5
(installed via brew)
I am not very familiar with Atom plugins, but did some further testing/exploration by modifying linter-languagetool
's sources files directly.
It looks like the problem is originating from here
and here
If I modify it in a way that --config
is passed hardcodedly via jvmoptions.concat
the languagetool
server correctly picks up the config file.
add preference for user's mother tongue and submit to language tool upon request. enables check for false friends.
Hi, I use your plugin every day. It is great :). Unfortunately when I work with long text files language tool plugin consumes 100% cpu power. I guess it's because plugin (linter?) scans (checks) whole document at once, not just the new sentence. Is it possible to make same workaround and, for example, manually exclude some files from being linted? Maybe you've got other ideas? I would be grateful for any help.
Suggests a full stop here ------------------------|
v
This is an example sentence in Markdown. Sentences
after a full stop which then flow on to a new line
results in a fullstop being wrongly suggested.
This does not happen when you flow onto a new line
without a fullstop on the line.
Not sure whether it's possible to work around this here. According to a LanguageTool maintainer, plugins like this should fix this issue:
danielnaber
I consider this out of scope for LT. Instead, editors should integrate LT and they should do the parsing of the text (markup vs. text, hand only the text to LT).
This is similar to #7 except this is about whitespace rather than about ignoring markup
This is probably a pretty rare situation. I happened to have multiple windows open, and when I closed the original window, the LanguageTool service was shut down, causing errors on lint in the remaining opened windows.
I have some thoughts on how to address this, but my coffeescript / javascript / node skills are weak so not sure I could implement either of these.
I have two machines where port 8081 is already in use. I cannot change those existing services (work laptops). I'd like to add a configuration item for port, defaulting to 8081.
Would love some tips on how to use to find errors using n-gram data. I downloaded the data, and extraded it.
In the folder, there is an en/ folder. Is that correct? I don't see any additional suggestions compared to the online https://languagetool.org/ .. I would really love your input on this
Hi, I would like to use this package in Atom alone. Is it possible?
If I understand correctly, at least the LanguageTool
commandline allows to disable certain categories like checks for passive voice
. Is it possible to retain this in the package?
If one wants to disable spelling mistakes, you can disable the TYPOS
rule category but it will block any other rules in that category, e.g. N-Gram verification.
To fix that, and block only rule and not entire category, you can put, in your config file, which contains the path to you ngram dir, the path to another (!) config file with the list of rule you want to disable.
The first config file (you give its path to linter-languagetool in the settings) looks like this:
# Path to N-gram directory
languageModel=/Users/foo/bar/bin/ngrams
# Path to your disabled rules
rulesFile=/Users/foo/bar/bin/languagetool_rules.cfg
And the rulesFile looks like this, to solve the above mentioned problem:
# Disable rules for linter languagetool in Atom
disabledRules.en-US=MORFOLOGIK_RULE_EN_US
If the doc could be updated it would be nice for others, and this issue could be closed.
I'm receiving the following on Mac:
500 - "Error: Internal Error: java.lang.RuntimeException: Path /en/wrongWordInContext.txt not found in class path at /org/languagetool/rules/en/wrongWordInContext.txt"
I've tried using LanguageTool 4.1 via Homebrew, and manually downloading and unzipping LanguageTool 4.1 and 4.0 to local directories, all with the same results. Not seeing this on my Linux box.
Thoughts?
On MacOS, the LanguageTool server continues to run after I shut down Atom. A quick look at the code says this is by design. Would it be possible to automatically shut down the server on close, or perhaps make it an option, or is there a specific reason not to do so?
I'd like to either add two configuration items to control JVM memory consumption - -Xms and -Xms - set to reasonable defaults (like 256m and 512m) or possibly add a single configuration item with free-form jvm options like the JAVA_OPTS environment variable to give more control over how the language tool service runs.
Thoughts?
linter-lnaguagetool set to user local server under /usr/share/java/languagetool/languagetool-server.jar
platform: Arch Linux
Upon starting atom, I receive an error message that linter-languagetool was unable to start the local server and will thus default to use the public API. The linter continues to work with the external API.
I am using Atom to write reports for my clients and sending the contents of a report that is considered confidential to an external API is absolutely out of the question. This is the precise reason I configured linter-languagetool to use a local server. If using this local server does not work for some reason, linter-languagetool should not use an public API unless explicitly instructed to do so.
One could argue, that the user is warned about this behavior, but the warning is only displayed for a few seconds so the fact that LT will use the public API might be missed by a user.
V2 of the atom linter api supports suggested fixes
Hi, I got the following error when installing your package:
Step to reproduce:
Atom: 1.19.7 x64
Electron: 1.6.9
OS: Mac OS X 10.11.5
Thrown From: linter-languagetool package 0.5.0
Uncaught SyntaxError: Unexpected token E in JSON at position 0
At file:///Applications/Atom.app/Contents/Resources/app/static/index.html:1
SyntaxError: Unexpected token E in JSON at position 0
at JSON.parse (<anonymous>)
at /packages/linter-languagetool/lib/linter-provider.coffee:103:29)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
-1:35.5.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-when-scrolling)
2x -1:01.3.0 linter-ui-default:toggle-panel (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-light-syntax.theme-one-light-ui)
-0:42.3.0 core:backspace (input.hidden-input)
-0:40.1.0 core:confirm (input.hidden-input)
atom-beautify 0.30.5
autocomplete-bibtex 0.7.0
autocomplete-python 1.10.2
busy-signal 1.4.3
color-picker 2.2.5
dictionary 0.5.0
file-icons 2.1.11
git-blame 1.2.2
git-plus 7.9.3
git-time-machine 1.5.9
hyperclick 0.1.3
indent-guide-improved 1.4.12
intentions 1.1.5
language-latex 1.1.1
language-restructuredtext 1.1.0
languagetool 0.1.1
latex-autocomplete 1.0.0
latex-completions 0.3.3
latex-plus 0.9.1
latexer 0.3.0
latextools 0.8.5
linter 2.2.0
linter-chktex 1.3.1
linter-just-say-no 0.7.3
linter-languagetool 0.5.0
linter-ui-default 1.6.8
linter-write-good 0.9.0
minimap 4.29.6
pdf-view 0.59.0
pigments 0.39.1
project-manager 3.3.5
rst-preview 1.3.1
rst-preview-pandoc 0.1.12
wordcount 2.10.4
Zen 0.18.0
403 - "Error: Access from X.X.X.X denied: Request size limit of 75000 bytes per 60 seconds exceeded"
Currently, the languagetools server is running in public mode. This is not needed as it only is access via the local loopback. This will prevent other people on the network using languagetools and reduce the risk of someone exploiting the open port.
Below is the code that includes the public parameter located here:
ltserver = child_process.exec 'java -cp ' + ltjar + ' org.languagetool.server.HTTPServer --public "$@"', (error, stdout, stderr) ->
I'm from the group running Pulsar a fork of Atom and working to maintain it. While we're making updates to it, and we wanted to replace the functionality of the default spell checker with something more up to date. It seems plausible that this would be a suitable add-on to have whether it's still maintained by you and contributions come from interested users or if there's no problem with us forking it to use as a core add-on.
If it helps we also have a discord you can join since we're trying to build up our native add-ons that aren't just backups of the old Atom ones. I'll attach a link to that below (and hope this doesn't seem to out of place making this issue here and that you don't consider it to be spam somehow)
This linter is doing a great job. In case of writing a document with markup language like LaTeX it could be improved, because is shows errors on every latex command. As a quick and dirty solution a add following lines:
editorContent = editorContent.replace /(\\\w+)((?:\{[^\}]*\})*)((?:\[[^\]]*\])*)((?:\{[^\}]*\})*)/g , (match, name, group1, group2, group3, index, input) ->
if /\\(\w*section|\w*caption|text\w*|mbox)/.test(name)
output = Array(name.length+1).join(" ") +
group1.replace(/[\{\}]/g, " ") +
Array(group2.length+1).join(" ") +
group3.replace(/[\{\}]/g, " ")
else
output = Array(match.length+1).join " "
return output
Which replacing the large part of the LaTeX markup with spaces. I than disabled the WHITESPACE_RULE
A more general approach would be to ignore grammar scopes and pattern with an API like linter-spell is providing.
When writing a document and adding code snippets or names, linter-languagetool
marks those as lint errors.
so, for example, if I'm writing a markdown file, I can get an error on this text:
## gerrit
you can assign code reviewers on gerrit by going to `gerrit-owners-autoassign`
the name gerrit is a small probelm since I can always write it in Title case.
The problem is with the code snippet. I can't set the linter-languagetool
to ignore text wrapped in something or add words to the ignore list
tell me if you have plans on implementing this (or if you want me to send you a pull request for this feature)
I get the following error message with linter-languagetool 0.11.0 and atom 1.57.0:
Languagetool: API doesn't accept query.
Error: langCode cannot be empty or whitespace only
The package marks a spelling mistake, but does not offer a possible correction. Is this intended or due to limitations of languatetool
itself?
Hi!
I downloaded the n-gram dataset, and put it in a directory like this: /path/to/dir/en/
which contains 3 folders: 1grams
, 2grams
, 3grams
, and put the path /path/to/dir/
into the field "Path to the n-gram directory".
I manage to make it work with the standalone version (languagetool.jar
) but not on Atom.
I restarted atom but it did not work either.
I have Atom 1.20.0 and linter-languagetool v0.5.2
Thanks
code should be ported from fhchl/languagetool
the public languagetool api is limited. the linter should support a local server
[Enter steps to reproduce:]
Atom: 1.15.0 x64
Electron: 1.3.13
OS: Debian GNU/Linux
Thrown From: linter-languagetool package 0.4.0
Uncaught SyntaxError: Unexpected token < in JSON at position 0
At file:///usr/share/atom/resources/app.asar/static/index.html:1
SyntaxError: Unexpected token < in JSON at position 0
at Object.parse (native)
at /packages/linter-languagetool/lib/linter-provider.coffee:65:29)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
-1:26.6.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-base16-tomorrow-dark-theme.theme-one-dark-ui)
-0:58.7.0 intentions:highlight (input.hidden-input)
-0:58.2.0 find-and-replace:show (input.hidden-input)
2x -0:32.5.0 core:backspace (input.hidden-input)
atom-beautify 0.29.18
atom-css-comb 3.1.0
atom-htmltidy 5.1.0
atom-prettify 0.1.3
atom-python-run 0.7.3
atom-toolbar 0.1.6
auto-detect-indentation 1.3.0
auto-indent 0.5.0
autoclose-html 0.23.0
autocomplete-python 1.8.63
bracket-close-jump 0.1.2
busy-signal 1.3.0
case-switch 2.2.4
change-case 0.6.5
close-tags 0.6.0
color-picker 2.2.5
drag-drop-text 0.1.4
file-icons 2.1.2
flex-tool-bar 0.12.0
highlight-selected 0.13.1
intentions 1.1.2
language-markdown 0.20.0
lines 0.13.1
linkify 0.11.0
linter 2.1.2
linter-languagetool 0.4.0
linter-php 1.3.2
linter-python 3.1.1
linter-spell-html 0.6.2
linter-ui-default 1.2.2
markdown-assistant 0.2.0
markdown-helpers 0.3.0
markdown-pdf 1.5.0
markdown-preview-enhanced 0.10.12
markdown-preview-plus 2.4.9
markdown-themeable-pdf 1.2.0
markdown-toc 0.4.2
markdown-toolbar 0.1.2
markdown-writer 2.6.4
minimap 4.27.1
minimap-highlight-selected 4.6.1
minimap-pigments 0.2.2
open-in-browser 0.5.0
open-recent 5.0.0
pandoc-convert 1.1.0
php-cs-fixer 4.1.0
pigments 0.39.1
pretty-json 1.6.3
print-code 0.6.0
python-debugger 0.2.0
python-indent 1.0.2
python-tools 0.6.9
simple-drag-drop-text 0.3.4
smart-quotes-plus 2.1.0
smarter-delete-line 1.1.2
spell-check-project 0.7.0
tag 0.4.0
text-manipulation 0.6.0
tidy-markdown 3.0.1
title-case 0.4.0
tool-bar 1.1.0
tool-bar-config 0.1.0
tool-bar-main 0.0.10
tool-bar-markdown-writer 0.2.0
toolbar-iconshortcuts 3.10.0
trailing-spaces 0.4.0
url-utils 0.2.1
wordcount 2.10.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.