def name_notation_type(tokens):
    name = {(0): 'area', (1): 'category', (2): 'criteria'}[tokens[0].count('.')
        ]
tokens[name] = tokens[0]
dotted_notation.setParseAction(name_notation_type)
tests = 'A A.1 A.2.2'.split()
for t in tests:
    print(t)
val = dotted_notation.parseString(t)
print(val.dump())
print(val[0], 'is a', val.getName())
print() 
tests = 'A A.1 A.2.2'
val = pp.OneOrMore(dotted_notation).parseString(tests)
print(val.dump())
pyparsing Regex as Word