@classmethod
def parse(cls, type_name, line, field_order=None):
    """ Parse an ASS line from text format. Has an optional field order
        parameter in case you have some wonky format.
        """
    if field_order is None:
        field_order = cls.DEFAULT_FIELD_ORDER
    parts = line.split(',', len(field_order) - 1)
    if len(parts) != len(field_order):
        raise ValueError('arity of line does not match arity of field order')
    fields = {}
    for field_name, field in zip(field_order, parts):
        if field_name in cls._field_mappings:
            field = cls._field_mappings[field_name].parse(field)
        fields[field_name] = field
    return cls(**fields, type_name=type_name)
