created with https://github.com/tingletech/ead_tag_use.py using EAD test files in https://github.com/tingletech/ead-test-col
# get stats counter for the current element name, or set the default
element_stats = stats.setdefault(key, # <-- element name is dict key
[0, # <-- count for this element [0] corpus
[Counter(), # <-- parent elements [1][0] corpus
Counter(), # <-- child elements [1][1] dtd
Counter(), # <-- child attributes [1][2] dtd
Counter()]] # <-- PCDATA [1][3] corpus
) # array address-^--^
# some counters look for everything possible based on dtd
# some counters only observe the input corpus
Counter()
is a python built in collection type.
inspired by the tag analysis work of Katherine M. Wisser from Simmons.