[en] Different results in the GUI and JSON file

This question is posted for one of my STE checker customers.

The GUI shows 3 warnings. The last warning is caused by MORFOLOGIK_RULE_EN_US and does not appear in the JSON results.

The customer has seen the comment on https://dev.languagetool.org/http-server:
“Note that for a server started from a GUI, a user may configure it in the configuration dialog box to disable some unwanted rules. This may be beneficial if the calling program does not allow configuration of the call to the LanguageTool server, and the user wants to enable or disable some checks. However, if the program does disable or enable any rules, then the configuration set by the user will be silently ignored.”

The customer wrote, “We double checked the system and everything seems to be set up properly.”

What are the possible causes of the different results? Do you have any ideas about how the customer can get the same results in the JSON file as in the GUI?

Not sure if important: the STE rules are in a password-protected external file (Tips and Tricks | dev.languagetool.org).

The JSON response is assumed to be used by a client that underlines errors in the text, thus it filters matches that appear at the same position. There’s currently no parameter to change that behavior.

@dnaber, thank you.

Suggestion: document the information that it filters matches that appear at the same position.

Hi @dnaber,

To make the LT spelling warning appear in the JSON result instead of the warning from a rule in the external file, I guess that it is possible to increase the priority of MORFOLOGIK_RULE_EN_US in English.java. (Then, build a new GUI and use that.)

In principle, is that method likely to work? If yes, what is the priority value of the rules that are in an external file?

The approach might work. The default priority is 0, no matter where the rule is from I think.

@dnaber, thanks. I cannot make the priority work.

I changed the priorities for MORFOLOGIK_RULE_EN_US and MORFOLOGIK_RULE_EN_GB. Then, I built a GUI.

The spelling checker does not have priority over INDIAN_ENGLISH. (The screen shot is for the GUI as built, no changes for external files.):

Now I see what you meant. But priorities don’t work that way, they don’t change the order of results, they define which match is used in clients that can not show two matches for the same location. The GUI always shows all results (and I don’t think we already have a way to define their order).

Ah, I see. Thanks for the clarification about the position of the results.

The changed priorities work fine: