TinyMCE 4 Plugin

The spans are most likely cutting up the issue so it is counting it multiple times. That can be seen via the dialog. Either way I’ll see about fixing the span issue.

As for the old underlines, nothing I can do about that. Those are not an issue with my code but issue with the code on the front page of language tools.

Normally, when my serializer was working prior to last patch, when you copy the text, it would remove the styling. But the version on the language tools website has no serializer so it just sends over the styles.

What I might do is make a fork of the Paste plugin and offer an option of paste as plain text. But that would be a feature outside of languagetool plugin itself.

By the way, since I am doing a bunch of testing, I also notice some issues here and there. Should I make a thread for these issues or report them in github.

For example:

My Rabit Leather belt = no mispelling found
My Rabit Leather Belt = no mispelling found
I found a Rabit Leather belt = no mispelling found
My Rabit leather belt = mispelling found

Or is it assuming Rabit is a person’s name or something due to the double capital letters?

I also noticed that LibreOffice seems to run both spellcheckers at the same time (I use Libre to compare to see if my is rendering properly, and at first I though I made a mistake somewhere and kept trying to fix it to no avail until I noticed it was the processor lol)

Please open a github issue. For your examples, the integrated spell checker accepts all lowercase words also when they appear uppercase, and there’s no second rule that complains about these words.

LibreOffice comes with its own spell checker. So for simple spelling issues, you see the LibreOffice results, for more advanced errors, you see the LT results.

I’m not sure I’m following you - the latest test I did was with plain text, i.e. I removed any formatting from the text before I pasted it.

Yes. Refer to the disambiguation rule UPPER_UNKNOWN_NNP_UPPERCASE_SEQ.

You can see the behaviour in the stand-alone version of LT. In the Tagger Result dialog, select ‘Show disambiguator log’. For ‘My Rabit Leather belt’, part of the disambiguation is:
UPPER_UNKNOWN_NNP_UPPERCASE_SEQ[1]: Rabit[Rabit/null,I-NP-singular] -> Rabit[Rabit/NNP,I-NP-singular]

I tried disabling that rule via “disabledRules” and it still doesn’t pick it up.

Oh I assumed the screenshot you gave though has a flat line purple line in there was from styling. I see whats going on, ok I’ll fix it.

Alright, I fixed it. All of these were regressions from the previous patch. I think it should be good now with or without styling.

It’s a disambiguation rule, these cannot be turned off. Only rules from grammar.xml can be turned off (and those from Java code). But I think turning it off wouldn’t help anyway, as there’s just no rule yet that complains about words written uppercase when they should be lowercase.

Well the issue isn’t about it being upper case or lower case in specific. Maybe I can give a better example of the problem:

I stayed at the Holday Inn Express. = no spelling mistake
I stayed at the holday Inn Express. = spelling mistake
I went on a Holday again. = spelling mistake

Holiday Inn Express is a name per say, but it uses common words and I can misspell holiday and wouldn’t even notice. I am more interested in it catching misspelled words then correcting lower and upper case.

Anyways I’ll open an issue in Github I guess. Don’t want to go off course too much from the main topic. It just came up when I was testing content and comparing it to LibreOffice and thought something was broken on my end. (The built in libreoffice check found it an issue while LT did not so before I realized they were both being used I thought I made the error)

Sorry to say, but there’s still a way to confuse the script and get errors without underline. Just go to the “an” error and add some “x” in front of it, remove them, add more etc. Maybe it depends on how long you wait after your edit, the requests in the background might overlap or so? I’d also suggest making the re-check time much faster, maybe 500ms instead of 3 seconds.

I was wrong. But let’s discuss the details at issue 752.

I really don’t want it to recheck it ever 500ms and for multiple reasons:
1 - It would be pointless for people using public servers
2 - It might introduce a lot of other problems as the user gets checked on every char they type

I know the issue and have an idea how to fix it. How it works is it only rechecks again after 3 seconds if there is a span. But since the span disappears.

Once the span is gone, it goes back to doing things the old fashioned way which is comparing the result vs the cache. When the cache matches, it doesn’t bother re-sending it. Which at that point you make another mistake and it doesn’t show up unless you change nodes.

What I will probably do is after you manually correct, I’ll have it check again in 15 seconds and 60 seconds. This should catch 99.9% of those scenarios which in itself would be pretty rare.

I think these slow re-check times might cause confusion. From the user’s point of view, there should be only one time that triggers a re-check.

No need to check on every char I think, but more like this: after every char, start a timer of 500ms. When the timer finishes and no new character has been typed/deleted, send a new request. Add an exception so that a user who types fast and never pauses also gets checks.

Are we talking about in general do these kind of checks on all content? Or in the case of fixing mistakes?

How about this then for fixing mistakes, as said I’ll have it refresh after each key since at about 1 second. Once 1 second passes it will recheck.

Remember public instance is limited to 10 seconds so they will only get 1 instant recheck.

I was thinking about all checks in general, not just about those in the error spans.

I was thinking for private servers, enable the option for it to check on space or comma. Thus it would check on word complete. But for public servers that is a no go.

What I can do maybe is for public servers make an alternative option where they would have a hybrid type thing using both the browser spellcheck for words then LT for grammar and etc. Or if I can disable browser spellcheck on the fly, overwrite the browser spellcheck when LT spell check comes in. (Unfortunately there is no way to interact with the browser spellcheck directly so I can’t do a full libreoffice like approach)

To demonstrate in a way how a hybrid approach would work:

Notice the first testming is spellchecked while the 2nd one isn’t? The spans highlighted by LT would disable spellchecking on their spans thus use their own while browser spellcheck will do the others.

I think I came up with a good compromise for the time being. I set it up like this:

It will check if you are in the middle of a sentence, and only then will it start the inactivity timer. The inactivity timer is set to 2000ms. So if you are writing a sentence normally, there is no reason for the inactivity timer to be running. And it will process only once you finish the sentence. (I also added a new processing mode option that I was talking about that lets it process after space or comma). But if you are located mid sentence, it assumes you are modifying something and will run the inactivity timer every 2 seconds since last keyup.

This should be a good balance.

As long as I didn’t break anything during this update, I’ll look into the hybrid mode I was talking about.