[en] Rule designing problem. Help needed!

“Again, I have a question in my mind, how do I generalise the phrases like ‘add to’ effectively as the words (‘add’ and ‘to’) may appear anywhere in between the sentence?”

You seem to be trying to write a rule for the phrasal verb (multi-word verb) ‘add to’. This is a difficult problem for these reasons:

  1. ‘Add to’ is one of many phrasal verbs that contain ‘add’. Macmillan Phrasal Verbs Plus contains these phrasal verbs:
    add in
    add on
    add on to
    add to
    add up
    add up to

In your first message, you gave some examples. As you wrote, ‘Add more salt in the juice’ is not correct. But, in the context of a report for a food company, an editor might write, ‘Add more information regarding the juice.’

So, your problem is also about semantics.

As a minimum, you should probably remove ‘in’, ‘on’, and ‘up’ from the list of prepositions.

  1. Some prepositions also have other parts of speech. Example: ‘Add about two liters of juice.’ In this example, ‘about’ is an adverb that means the same as ‘approximately’.

  2. The verb ‘add’ can be used correctly with a preposition. For example, in an industrial process: ‘Add more salt through the opening in the container.’

I agree with @marcoagpinto, “I believe that a rule is better to be detect only a few of the mistakes but well (accurate) than to detect a lot but have a lot of inaccuracy.” (http://forum.languagetool.org/t/pt-a-ha-rule-issues/1120/12).

To test your rules, you can use the Wikipedia corpus to help you to find false positives. Refer to ‘Local Wikipedia Checks’ (http://wiki.languagetool.org/developing-robust-rules#toc3).

@marcoagpinto, @Mike_Unwalla, @dnaber

Post moved to related [pt] thread.