Currently replaCy assumes token matches and text suggestions are single tokens: - `PATTERN_REF` copies only the first matched token: https://github.com/Qordobacode/replaCy/blob/bd7df64e2e5b875aaa9fecff31b1d898650219b4/replacy/__init__.py#L166 suggested fix: change the above line, enforce `INFLECTION` only if one token is matched - `TEXT` consists of a single word only: https://github.com/Qordobacode/replaCy/blob/bd7df64e2e5b875aaa9fecff31b1d898650219b4/replacy/__init__.py#L163 suggested fix: json validation to enforce single tokens as `TEXT` ex. instead of `{"TEXT": "blah blah"} ` use ` {"TEXT": "blah"}, {"TEXT": "blah"}` - `FROM_TEMPLATE_ID`: assumes single token match, from which we transfer the inflection https://github.com/Qordobacode/replaCy/blob/bd7df64e2e5b875aaa9fecff31b1d898650219b4/replacy/__init__.py#L178 suggested fix: enforce `TEMPLATE_ID` match being single token Idea: Single token match enforcement: fail json validation if patterns include `FROM_TEMPLATE_ID` or `PATTERN_REF` pointing to a token with `OP`?
Currently replaCy assumes token matches and text suggestions are single tokens:
PATTERN_REFcopies only the first matched token:https://github.com/Qordobacode/replaCy/blob/bd7df64e2e5b875aaa9fecff31b1d898650219b4/replacy/__init__.py#L166
suggested fix: change the above line, enforce
INFLECTIONonly if one token is matchedTEXTconsists of a single word only:https://github.com/Qordobacode/replaCy/blob/bd7df64e2e5b875aaa9fecff31b1d898650219b4/replacy/__init__.py#L163
suggested fix: json validation to enforce single tokens as
TEXTex. instead of
{"TEXT": "blah blah"}use{"TEXT": "blah"}, {"TEXT": "blah"}FROM_TEMPLATE_ID: assumes single token match, from which we transfer the inflectionhttps://github.com/Qordobacode/replaCy/blob/bd7df64e2e5b875aaa9fecff31b1d898650219b4/replacy/__init__.py#L178
suggested fix: enforce
TEMPLATE_IDmatch being single tokenIdea:
Single token match enforcement: fail json validation if patterns include
FROM_TEMPLATE_IDorPATTERN_REFpointing to a token withOP?