rita
rita copied to clipboard
Problems with RiTa.stem() and RiTa.pastPart()
These - 1 and 2 - don't seem right:
-
RiTa.stem("changed") => chang
and, see #133, trying to avoid RiTa.pastPart("changed") => changeded
...
-
RiTa.pastPart(RiTa.stem("changed")) => chung
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()
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 status?
@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