texttaglib/elan.py
def __resolve(elan_doc):
    ''' Ensure that everything is linked together (e.g. tiers, vocabs, etc.) '''
    # link linguistic_types -> vocabs
    for lingtype in elan_doc.linguistic_types:
        if lingtype.controlled_vocabulary_ref:
            lingtype.vocab = elan_doc.get_vocab(lingtype.controlled_vocabulary_ref)
    # resolves tiers' roots, parents, and type
    for tier in elan_doc.tiers():
        lingtype = elan_doc.get_linguistic_type(tier._type_ref_id)
        tier._set_type_ref(lingtype)
        lingtype.tiers.append(tier)  # type -> tiers
        if lingtype.vocab:
            lingtype.vocab.tiers.append(tier)  # vocab -> tiers
        if tier.parent_ref is not None:
            tier.parent = elan_doc[tier.parent_ref]
            elan_doc[tier.parent_ref].children.append(tier)
 Ensure that everything is linked together (e.g. tiers, vocabs, etc.) 
Ensure that everything is linked together
Ensure that everything is linked together
def __resolve(elan_doc):
    for lingtype in elan_doc.linguistic_types:
        if lingtype.controlled_vocabulary_ref:
            lingtype.vocab = elan_doc.get_vocab(lingtype.controlled_vocabulary_ref)
    for tier in elan_doc.tiers():
        lingtype = elan_doc.get_linguistic_type(tier._type_ref_id)
        tier._set_type_ref(lingtype)
        lingtype.tiers.append(tier)  
        if lingtype.vocab:
            lingtype.vocab.tiers.append(tier)  
        if tier.parent_ref is not None:
            tier.parent = elan_doc[tier.parent_ref]
            elan_doc[tier.parent_ref].children.append(tier)
def __resolve ( elan_doc ) : for lingtype in elan_doc . linguistic_types : if lingtype . controlled_vocabulary_ref : lingtype . vocab = elan_doc . get_vocab ( lingtype . controlled_vocabulary_ref ) for tier in elan_doc . tiers ( ) : lingtype = elan_doc . get_linguistic_type ( tier . _type_ref_id ) tier . _set_type_ref ( lingtype ) lingtype . tiers . append ( tier ) if lingtype . vocab : lingtype . vocab . tiers . append ( tier ) if tier . parent_ref is not None : tier . parent = elan_doc [ tier . parent_ref ] elan_doc [ tier . parent_ref ] . children . append ( tier )
Ensure that everything is linked together (e.g.
Ensure that everything is linked together ( e . g .
''' Ensure that everything is linked together (e.g. tiers, vocabs, etc.) ''' # link linguistic_types -> vocabs # resolves tiers' roots, parents, and type # type -> tiers # vocab -> tiers
elan_doc