Compromise: Expand contractions before applying tense transformations? (v7)

Created on 17 Jan 2017  Â·  5Comments  Â·  Source: spencermountain/compromise

(Sorry if I'm reporting this as you're working on it - perhaps I should wait until v7 is released)

These two examples illustrate the problem:

nlp("I'm going to the shops").sentences().toPastTense().out("text") // --> "I'm went to the shops"
nlp("I am going to the shops").sentences().toPastTense().out("text") // --> "I was going to the shops"

Perhaps expand tense-based contractions (e.g. with words "am", "will") before processing (or something like that)?

Edit: Another thing: nlp('london is calling').sentences().toNegative().out("text") throws: Uncaught TypeError: this.term.insertAfter is not a function - guess this is still being worked on?

bug next-release priority

All 5 comments

yes!
yeah, this feature began as a bit of a joke, but functions as a good show-off example i figure.
there's a lot of logic to copy+paste from v6 for both these methods, and you're right - conjugation (nicely) plays into it ;) Let me get these two sentence methods into working-order, then ask you to kick up some dirt with it. Gimme a couple days.

Looking forward to it! •ᴗ•

agh! i'm going is still not working
rats. this'll be fixed in the next release. has top priority :sweat_smile:
cheers

this one's fine now though:

nlp('london is calling').sentences().toNegative().out()

hey, this works now too: :fireworks:

nlp('I am going to the shops').sentences().toPastTense().out()
// 'I went to the shops'

wee! v10.4.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fhoffa picture fhoffa  Â·  4Comments

nelson-liu picture nelson-liu  Â·  3Comments

bikibird picture bikibird  Â·  3Comments

Xetanai picture Xetanai  Â·  4Comments

zeke picture zeke  Â·  3Comments