rita icon indicating copy to clipboard operation
rita copied to clipboard

Problems with RiTa.stem() and RiTa.pastPart()

Open shadoof opened this issue 3 years ago • 4 comments

These - 1 and 2 - don't seem right:

  1. RiTa.stem("changed") => chang

and, see #133, trying to avoid RiTa.pastPart("changed") => changeded ...

  1. RiTa.pastPart(RiTa.stem("changed")) => chung

shadoof avatar Jun 14 '21 17:06 shadoof

For 1, "chang" is in fact the correct stem (note that stems are NOT the same as base forms for verbs)

For 2, we need to accept stems in the conjugation methods (as well as base forms) to make this work. @Real-John-Cheung can you check would require?

@shadoof A workaround would be to use RiTa.pastPart(RiTa.conjugator.unconjugate("changed")); which may argue for the API to include RiTa.unconjugate()

dhowe avatar Aug 02 '21 04:08 dhowe

RiTa.pastPart(RiTa.stem("changed")) => chung

for now RiTa.pastPart() will directly call conjugator.pastPart(), which directly applies rules to the input I think a simple solution will be direct RiTa.pastPart()and those similar APIs to conjugate() (but it might make it slower) like

static pastPart(word) {
    return this.conjugate(word,{
      number: RiTa.PLURAL,
      person: RiTa.SECOND,
      tense: RiTa.PAST
    });
}

Real-John-Cheung avatar Aug 02 '21 14:08 Real-John-Cheung

@Real-John-Cheung status?

dhowe avatar Aug 23 '21 03:08 dhowe

@dhowe I am not sure if we should implant the code I mentioned above

static pastPart(word) {
    return this.conjugate(word,{
      number: RiTa.PLURAL,
      person: RiTa.SECOND,
      tense: RiTa.PAST
    });
}

Maybe we need to discuss a bit about this... coz right now RiTa.pastPart() (and alsoRiTa.presentPart()) are like the shortcuts to apply the regex rules to the input, not sure if should keep this kind of fast shortcuts

Real-John-Cheung avatar Aug 23 '21 12:08 Real-John-Cheung