langtest.datahandler.format.BaseFormatter#

class BaseFormatter#

Bases: ABC

Abstract base class for defining formatter classes.

Subclasses should implement the static methods to_csv and to_conll.

__init__()#

Methods

__init__()

to_conll(sample)

Converts a custom type to a CoNLL string.

to_csv(sample)

Converts a custom type to a CSV string.

abstract static to_conll(sample: Sample)#

Converts a custom type to a CoNLL string.

Parameters:

sample (Sample) – The custom type to convert.

Returns:

The CoNLL string representation of the custom type.

Raises:

NotImplementedError – This method should be implemented by the subclass.

abstract static to_csv(sample: Sample)#

Converts a custom type to a CSV string.

Parameters:

sample (Sample) – The custom type to convert.

Returns:

The CSV string representation of the custom type.

Raises:

NotImplementedError – This method should be implemented by the subclass.