compare Specificity To
Determine the relative specificity of the receiver and the argument. The relative specificity of two patterns is determined according to the following criteria:
If two patterns are equal, then they are equally specific.
All exact matches are mutually incomparable.
Any exact match is more specific than any inexact match.
For inexact matches, given two patterns
PandQ, the following rules are applied in order:If
PcontainsQ, thenPis more specific.If
|successions(P)|=|successions(Q)|, wheresuccessionscomputes the successions of its argument, and every succession ofPis more specific than the corresponding succession ofQ, thenPis more specific.If
|successions(P)| = 1and|successions(Q)| > 1, thenPandQare incomparable.If every succession of
Poccurs withinQ, preserving order and advancing monotonically, and|P| ≤ |Q|, thenQis more specific.Otherwise,
PandQare incomparable.
Return
The relation of the two patterns with respect to specificity.
Parameters
The pattern to check specificity against.