compromise
compromise copied to clipboard
Would it be possible to implement toSingular/toPlural for verbs?
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."
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.