scrapinghub / python-crfsuite

A python binding for crfsuite
MIT License
769 stars 223 forks source link

CRFsuiteDumpParser fails to parse dump if attributes contain newlines #148

Open CisterMoke opened 2 years ago

CisterMoke commented 2 years ago

The CRFsuiteDumpParser parses a dump line per line with the assumption that each line is complete. Whenever an attribute contains a newline however, some lines will be broken up over multiple lines. Take for example the following broken up state feature line

(0) -1:word.lower:

   --> O: 0.000003

This will break parse_STATE_FEATURES because the first line will not match the regex.