writer / replaCy

spaCy match and replace, maintaining conjugation
https://pypi.org/project/replacy/
MIT License
34 stars 8 forks source link

support arbitrary span props from match dict #11

Closed sam-writer closed 4 years ago

sam-writer commented 4 years ago

So for example, in GEC we want to be able to add "category" and have it automatically become a span prop.

Since I knew about this one, I added it explicitly.

But I also made it so if the match_ditct has an entry with a new field, type is inferred for default value and then it is automatically made a span prop

sam-writer commented 4 years ago

oh my god the part I thought would be easy is impossible :sob:

sam-writer commented 4 years ago

Good point about flatmap! I built that iteratively, but didn’t optimize it