Back to LanguageTool Homepage - Privacy - Imprint

Chunks, Antipattern, Exception

I know the basics all of these, actually I am not getting the working of Chunks, Antipattern and exception how these things works?
Please elaborate with some useful examples and explanation of examples.
Many Thanks

I don’t know about chunking; as far as I know this is all in Java code and I am not able to handle that.

Antipattern is quite simple: every rule has its pattern. There are often situations where the rule has a false positive. If that exception can be handled using one word in the pattern, there is the exception clause.
But when the false positive an exception using multiple words, it is easier to add an ‘antipattern’ to the rule. You could consider it an ‘exception pattern’.

For examples, you can have a look at the grammar.xml.

1 Like

For example if I write exception regexp=“yes”>become|lunch|dinner|breakfast|brunch</exception, what does it mean? Is that meaning we are not considering these words while making a rule? are we neglecting these words?
Please explain that problem.

If you do
<token regexp="yes">a.*</token>
all words with an a will be matched
If you do
<token regexp="yes">a.*<exception regexp="yes">.*b.*</exception</token>
all tokens starting with a will be matched, except those containing a b.

1 Like

If you use
<pattern><token regexp="yes">a.*</token><token regexp="yes">p.*</token></pattern>
apple pie and almond pie will be matched, as well as ‘anti paper’ will be matched.
Do you want to have an exception for ‘anti paper’, you could have the simple antipattern:

1 Like

You’ve explained very well I have understand your point.
So please explain exception as well how can I work with exception if have multiple words such as exception regexp=“yes”>become|lunch|dinner|breakfast|brunch</exception, when and why we use exception?

Exception was the first method implemented in LT to make exceptions. All exception can also be done by antipatterns. But when the exception is on just one token, maybe better make the exception there.

1 Like

Could you please tell me about in which situation we use POSTAG and Chunk?