Back to LanguageTool Homepage - Privacy - Imprint

Disable Rules when running "Integration On Websites" and demo server


(Jonathan Andersson) #1

Hi,
I have added Language Tool to my website http://wiki.languagetool.org/integration-on-websites. And all works fine, but I would like to be able to disable some rules. Like when I press ignore this type of error in the GUI.

I'am using the demo server provided.

Is this possible. The rule I would like to disable has the ID EN_QUOTES

Many thanks.
Jonathan


(Jonathan Andersson) #2

I have read the code in editor_plugin2.js and I think that there is no way to include a disableRule in the request.
Would be nice if it was possible to add some kind of languagetool property simliar to this one. languagetool_i18n_current_lang.

Added editor_plugin2.js file locally and added this

/*Disable a rule by adding the id, should be a comma seprated list e.g'rule1,rule2'*/
languagetool_disabled_rules: "EN_QUOTES"

And adding the value of the rule in the request.

     var postData = "disabledRules=WHITESPACE_RULE" + disabledRules + "&" +
             "allowIncompleteResults=true&" +
             "text=" + encodeURI(data).replace(/&/g, '%26').replace(/\+/g, '%2B') + langParam;

(Daniel Naber) #3

This look almost correct, only that now a comma is missing between WHITESPACE_RULE and EN_QUOTES . If you add that, this should work.