compromise icon indicating copy to clipboard operation
compromise copied to clipboard

Would it be possible to implement toSingular/toPlural for verbs?

Open w0nche0l opened this issue 5 years ago • 1 comments

Hello, I'm trying to figure out a way to dynamically correct grammar with sentences that will sometimes have singular pronouns (he/she) and sometimes plural pronouns (they).

Is this possible to implement on my own / is there a function I am just not finding in the documentation?

For example, if I have the template sentence (X is a cool person), but the user has the pronoun "they", I would like the sentence to change to "They are a cool person."

w0nche0l avatar Feb 12 '20 05:02 w0nche0l

Hey Dennis, yes and no. Custom replacements on the text are possible using .replace() - and you can specify any sort of grammar template for them.

When it comes to correcting grammar though, it is more complicated because compromise is pretty 'trusting' that the input sentence is correct. It will wiggle the tags around quite a bit to assume the sentence is correct, so you may want to watch out for this.

spencermountain avatar Feb 12 '20 13:02 spencermountain