chrisjbryant / errant

ERRor ANnotation Toolkit: Automatically extract and classify grammatical errors in parallel original and corrected sentences.
MIT License
436 stars 107 forks source link

Merge Casing Issue #26

Closed arahusky closed 3 years ago

arahusky commented 3 years ago

Hello Chris, I am working on Errant for Czech and found the following line problematic: https://github.com/chrisjbryant/errant/blob/6c0d521217f31177a359af7c11d96898a61e7c48/errant/en/merger.py#L64

The issue is that it is True even if start != 0 (if (len(c) == 1 and o[0].text[0].isupper()) gets evaluated to True.

In such case, return on lines 66-67 will omit "the preceding part of combo".

I suppose that the fix is to enforce start == 0 by adding a pair of brackets:

if start == 0 and ((len(o) == 1 and c[0].text[0].isupper()) or \
                    (len(c) == 1 and o[0].text[0].isupper())):
chrisjbryant commented 3 years ago

Heya,

Thanks for the report! Looks like a bracketing issue indeed so I'll make a note to fix it in the next version.

chrisjbryant commented 3 years ago

Fixed in v2.3.0