from tf.app import use
A = use("ETCBC/bhsa:clone", hoist=globals())
First determine the from-types and the to-types of nodes connected by a mother edge:
fromTypes = set()
toTypes = set()
for f in N.walk():
ts = E.mother.f(f)
if ts:
fromTypes.add(F.otype.v(f))
for t in ts:
toTypes.add(F.otype.v(t))
print(f"From types: {sorted(fromTypes)}")
print(f"To types: {sorted(toTypes)}")
From types: ['clause', 'clause_atom', 'phrase', 'phrase_atom', 'subphrase'] To types: ['clause', 'clause_atom', 'phrase', 'phrase_atom', 'subphrase', 'word']
Now list how many edges there are between all these types:
for fT in sorted(fromTypes):
for tT in sorted(toTypes):
n = E.mother.freqList(nodeTypesFrom=fT, nodeTypesTo=tT)
if n:
print(f"{fT:>20} =mother({n:>6}x)=> {tT}")
clause =mother( 13897x)=> clause clause =mother( 13897x)=> clause_atom clause =mother( 5305x)=> phrase clause =mother( 5305x)=> phrase_atom clause =mother( 5305x)=> subphrase clause =mother( 1567x)=> word clause_atom =mother( 13897x)=> clause clause_atom =mother(103496x)=> clause_atom clause_atom =mother( 5305x)=> phrase clause_atom =mother( 5305x)=> phrase_atom clause_atom =mother( 5305x)=> subphrase clause_atom =mother( 1567x)=> word phrase =mother( 51x)=> clause phrase =mother( 51x)=> clause_atom phrase =mother( 507x)=> phrase phrase =mother( 507x)=> phrase_atom phrase =mother( 507x)=> subphrase phrase =mother( 8x)=> word phrase_atom =mother( 51x)=> clause phrase_atom =mother( 51x)=> clause_atom phrase_atom =mother( 507x)=> phrase phrase_atom =mother( 13007x)=> phrase_atom phrase_atom =mother( 507x)=> subphrase phrase_atom =mother( 1842x)=> word subphrase =mother( 51x)=> clause subphrase =mother( 51x)=> clause_atom subphrase =mother( 507x)=> phrase subphrase =mother( 507x)=> phrase_atom subphrase =mother( 22453x)=> subphrase subphrase =mother( 34968x)=> word