The Collaborative International Dictionary
Pattern matching \Pat"tern match"ing\, n. [See pattern.] a technique in automated data analysis, usually performed on a computer, by which a group of characteristic properties of an unknown object is compared with the comparable groups of characteristics of a set of known objects, to discover the idenity or proper classification of the unknown object.
Note: There are two major types of pattern matching, statistical pattern matching and syntactic pattern matching. In statistical pattern matching, the criteria used to recognize identity or class membership vary, but in general some combination of the differences in the groups of characteristics of known and unknown objects are considered to be a measure of the difference ("distance") between them, and the closest known object or objects are viewed as presenting the most likely identity or class for the unknown object. In syntactic pattern matching, a set of known patterns, e.g. as in the possible order of parts of speech in a language, is defined, and the unknown pattern is compared to find that known pattern or patterns which matches the unknown exactly. In general, statistical pattern matching is used where properties of objects with continuous values are being compared, and syntactic pattern matching where a complex arrangement of at least two different objects may be built by application of a set of rules (a "grammar") for combining the objects in a specified order. Examples of the latter are natural and formal languages.
n. (context computer science English) the act of checking some sequence of tokens for the presence of the constituents of a pattern
In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact. The patterns generally have the form of either sequences or tree structures. Uses of pattern matching include outputting the locations (if any) of a pattern within a token sequence, to output some component of the matched pattern, and to substitute the matching pattern with some other token sequence (i.e., search and replace).
Tree patterns are used in some programming languages as a general tool to process data based on its structure, e.g., Haskell, ML, Scala and the symbolic mathematics language Mathematica have special syntax for expressing tree patterns and a language construct for conditional execution and value retrieval based on it. For simplicity and efficiency reasons, these tree patterns lack some features that are available in regular expressions.
Often it is possible to give alternative patterns that are tried one by one, which yields a powerful conditional programming construct. Pattern matching sometimes include support for guards.
Term rewriting and graph rewriting languages rely on pattern matching for the fundamental way a program evaluates into a result.
Usage examples of "pattern matching".
The B-CRAM automatically does pattern matching of every data entry, in parallel, against a vector of matching 'weights' provided to its input.
Folded under it was len's trousers, fully decorated on the front of the legs and Mtom in a pattern matching the tunic.
He would have searched missing-persons databases, using age progression/ regression photos with pattern matching algorithms.
Behind the sharp-etched lettering the image of the incoming craft was growing steadily larger, its complex computer-generated recognition pattern matching the programmed format perfectly.
They were, Jing thought, like a model of his mind, a pattern matching himself alone as the sky matched the entire world.
Each environment suit, however, bore a brilliant color pattern matching the team name, pale green for the Jengibres and orange for the Eiras, with black helmets for the men and white for the women.
They were nearly as good as humans at visual pattern matching and comparison--or, to put it another way, at recognizing faces and people.
On each sat a small, quilted pillow with a pattern matching that of a sofa that faced the chairs from the other side of the hearth.