Constraint Grammar is a method used in natural language processing for adding/removing/selecting grammatical tags (such as part of speech and inflectional tags, as well as lemma and wordform) in a given context, e.g. for disambiguation, syntax annotation or dependency parsing. CG files often have thousands of simple, hand-written rules. VISL CG-3 is a popular free/open-source compiler/processor for CG.