Can we skip or remove grammar check with JlanguageTool?

51 Views Asked by At

Lets take an example

sentence :

i am good.how are you?

Correction :

I am good. How are you?

Expected :

i am good.how are you? (Do not want any suggestion if there is no spelling mistake. )

Please let me know is there any step or trick so that we can skip this?

1

There are 1 best solutions below

0
Yashika Chandra On

Eventually I got the answer. By using selectRules() we can enable or disable any rules.

JLanguageTool jLanguageTool = new JLanguageTool(new AmericanEnglish());    
Set<CategoryId> categorySet = new LinkedHashSet<>();
categorySet.add(new CategoryId("CASING"));
categorySet.add(new CategoryId("TYPOGRAPHY"));
Tools.selectRules(jLanguageTool, categorySet, Collections.emptySet(), Collections.emptySet(), Collections.emptySet(), false, false);