mirror of
https://github.com/house-of-vanity/desubot.git
synced 2025-08-21 15:27:14 +00:00
Improve omedeto. Detect feminine by verbs. Fix
This commit is contained in:
@@ -237,24 +237,30 @@ pub(crate) async fn omedeto(api: Api, message: Message, mystem: &mut MyStem) ->
|
|||||||
} else {
|
} else {
|
||||||
match stem[0].lex[0].grammem.part_of_speech {
|
match stem[0].lex[0].grammem.part_of_speech {
|
||||||
mystem::PartOfSpeech::Verb => {
|
mystem::PartOfSpeech::Verb => {
|
||||||
if stem[0].lex[0]
|
match stem[0].lex[0]
|
||||||
.grammem
|
|
||||||
.facts
|
|
||||||
.contains(&mystem::Fact::Gender(Feminine)) &&
|
|
||||||
stem[0].lex[0]
|
|
||||||
.grammem
|
.grammem
|
||||||
.facts
|
.facts
|
||||||
.contains(&mystem::Fact::Tense(Past))
|
.contains(&mystem::Fact::Tense(Past))
|
||||||
{
|
{
|
||||||
fm = fm + 1;
|
true => {
|
||||||
} else {
|
if stem[0].lex[0]
|
||||||
mu = mu + 1;
|
.grammem
|
||||||
|
.facts
|
||||||
|
.contains(&mystem::Fact::Gender(Feminine))
|
||||||
|
{
|
||||||
|
fm = fm + 1;
|
||||||
|
} else {
|
||||||
|
mu = mu + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).collect::<()>();
|
})
|
||||||
|
.collect::<()>();
|
||||||
debug!("fm - {}, mu - {}", fm, mu);
|
debug!("fm - {}, mu - {}", fm, mu);
|
||||||
if fm >= mu {
|
if fm >= mu {
|
||||||
true
|
true
|
||||||
|
Reference in New Issue
Block a user