A method for defining and identifying valid patterns for used in a pattern recognition system. The method is particularly well suited for defining and recognizing patterns comprised of subpatterns which have multi-dimensional relationships. The definition portion is embodied in a constrained attribute grammar. The constrained attribute grammar includes nonterminal, keyword and non-keyword symbols, attribute definitions corresponding to each symbol, a set of production rules, and a relevance measure for each of the key symbols. Each of the symbols represents a subpattern. The production rules includes syntactic, semantic, constraints and action portions. It is the production rules which define the dimensional relationships between the various subpatterns. An instantiation of a constrained attribute grammar is called a language. The verification portion is comprised of a parsing scheme that determines validity of a pattern. The verification portion receives a set of input subpatterns provided by a character recognition system and a provided language. When a valid pattern is recognized, a representation of the pattern in a form suitable for use by a data manipulation means is provides as output.