#!/usr/bin/env python # coding: utf-8 # # Explore edges. # In[1]: from tf.app import use # In[2]: A = use("ETCBC/bhsa:clone", hoist=globals()) # First determine the from-types and the to-types of nodes connected by a mother edge: # In[3]: 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)}") # Now list how many edges there are between all these types: # In[4]: 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}")