patternsnumber
Patternsnumber is a numerical attribute used in combinatorics on words to quantify the diversity of pattern structures within a finite word. For a word w over a finite alphabet, patternsnumber(w) is defined as the number of distinct pattern templates that occur among all substrings of w. A pattern template is the equivalence class of a substring under pattern isomorphism: two substrings are equivalent if one can be obtained from the other by renaming the letters via a bijection that preserves the relative positions of equal letters. For example, in the word aba, the substrings are a, b, ab, ba, and aba, with patterns 1, 1, 12, 12, and 121 respectively. The distinct patterns are {1, 12, 121}, so patternsnumber(aba) = 3.
Computation of patternsnumber typically proceeds by enumerating substrings and replacing each substring with its canonical pattern
Properties of patternsnumber include invariance under renaming of the alphabet, and the general bound 1 ≤ patternsnumber(w)