(fields, side)
return feature_vocabs
Collect feature Vocab objects from Field object.
Collect feature Vocab objects from Field object.
Collect feature Vocab objects from Field object .
def collect_feature_vocabs(fields, side):
    """
    Collect feature Vocab objects from Field object.
    """
    assert side in ['src', 'tgt']
    feature_vocabs = []
    for j in count():
        key = side + "_feat_" + str(j)
        if key not in fields:
            break
        feature_vocabs.append(fields[key].vocab)
    return feature_vocabs
def collect_feature_vocabs ( fields , side ) : assert side in [ 'src' , 'tgt' ] feature_vocabs = [ ] for j in count ( ) : key = side + "_feat_" + str ( j ) if key not in fields : break feature_vocabs . append ( fields [ key ] . vocab ) return feature_vocabs