<s> import re <EOL> from . tsvreader import TsvReader <EOL> class TxtReader ( TsvReader ) : <EOL> _space_splitter = re . compile ( '<STR_LIT>' ) <EOL> _pipe_splitter = re . compile ( '<STR_LIT>' ) <EOL> _pipe_starts = ( '<STR_LIT:|>' , '<STR_LIT>' ) <EOL> @ classmethod <EOL> def split_row ( cls , row ) : <EOL> if '<STR_LIT:\t>' in row : <EOL> row = row . replace ( '<STR_LIT:\t>' , '<STR_LIT:U+0020>' ) <EOL> if row [ : <NUM_LIT:2> ] in cls . _pipe_starts : <EOL> row = row [ <NUM_LIT:1> : - <NUM_LIT:1> ] if row . endswith ( '<STR_LIT>' ) else row [ <NUM_LIT:1> : ] <EOL> return [ cell . strip ( ) for cell in cls . _pipe_splitter . split ( row ) ] <EOL> return cls . _space_splitter . split ( row ) <EOL> def _process_cell ( self , cell ) : <EOL> return cell </s>
