def from_conll(this_class, text):
        """Construct a Token from a line in CoNLL-X format."""
        fields = text.split('\t')
        fields[0] = int(fields[0]) # index
        fields[6] = int(fields[6]) # head index
        if fields[5] != '_': # feats
            fields[5] = tuple(fields[5].split('|'))
        fields = [value if value != '_' else None for value in fields]
        fields.append(None) # for extra
        return this_class(**dict(zip(FIELD_NAMES_PLUS, fields)))
def from_conll ( this_class , text ) : fields = text . split ( '\t' ) fields [ 0 ] = int ( fields [ 0 ] ) fields [ 6 ] = int ( fields [ 6 ] ) if fields [ 5 ] != '_' : fields [ 5 ] = tuple ( fields [ 5 ] . split ( '|' ) ) fields = [ value if value != '_' else None for value in fields ] fields . append ( None ) return this_class ( ** dict ( zip ( FIELD_NAMES_PLUS , fields ) ) )
Construct a Token from a line in CoNLL-X format.