(fields, side="src")
return feats
Collect features from Field object.
Collect features from Field object.
Collect features from Field object .
def collect_features(fields, side="src"):
    """
    Collect features from Field object.
    """
    assert side in ["src", "tgt"]
    feats = []
    for j in count():
        key = side + "_feat_" + str(j)
        if key not in fields:
            break
        feats.append(key)
    return feats
def collect_features ( fields , side = "src" ) : assert side in [ "src" , "tgt" ] feats = [ ] for j in count ( ) : key = side + "_feat_" + str ( j ) if key not in fields : break feats . append ( key ) return feats