We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FPerson = fact( 'Person', ['first', 'last'] ) GName = gram('Name') GSurn = gram('Surn') RLastName = and_(GSurn, is_single()).interpretation( FPerson.last.inflected() ) RFirstName = and_(GName, is_single()).interpretation( FPerson.first.inflected() ) RPerson = rule(or_( RFirstName, RLastName #RLastName, RFirstName )).interpretation( FPerson ) show_matches(RPerson, ["Иванов", "Иван"])
имеем:
Person(first='иванов', last=None) Person(first='иван', last=None)
если взглянуть на морфер, то видно, что "Иванов" не имеет единственного числа для gram('Name'), тем не менее правило RFirstName срабатывает.
list(tokenizer("Иванов Иван"))
[MorphToken('Иванов', [0, 6), 'RU', [Form('иванов', Grams(NOUN,Sgtm,Surn,anim,masc,nomn,sing)), Form('иванов', Grams(ADJF,Poss,masc,nomn,sing)), Form('иванов', Grams(ADJF,Poss,accs,inan,masc,sing)), Form('иван', Grams(NOUN,Name,anim,gent,masc,plur)), Form('иван', Grams(NOUN,Name,accs,anim,masc,plur))]), MorphToken('Иван', [7, 11), 'RU', [Form('иван', Grams(NOUN,Name,anim,masc,nomn,sing))])]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
имеем:
если взглянуть на морфер, то видно, что "Иванов" не имеет единственного числа для gram('Name'), тем не менее правило RFirstName срабатывает.
list(tokenizer("Иванов Иван"))
[MorphToken('Иванов',
[0, 6),
'RU',
[Form('иванов', Grams(NOUN,Sgtm,Surn,anim,masc,nomn,sing)),
Form('иванов', Grams(ADJF,Poss,masc,nomn,sing)),
Form('иванов', Grams(ADJF,Poss,accs,inan,masc,sing)),
Form('иван', Grams(NOUN,Name,anim,gent,masc,plur)),
Form('иван', Grams(NOUN,Name,accs,anim,masc,plur))]),
MorphToken('Иван',
[7, 11),
'RU',
[Form('иван', Grams(NOUN,Name,anim,masc,nomn,sing))])]
The text was updated successfully, but these errors were encountered: