NAME

Lingua::RU::Inflect — Inflect russian names.

VERSION

Version 0.01

SYNOPSIS

Inflect russian names which represented in UTF-8.

Perhaps a little code snippet.

use Lingua::RU::Inflect;

my @name = qw/Петрова Любовь Степановна/;

my $gender = detect_gender_by_given_name(@name);
# $gender == FEMININE

my @genitive = inflect_given_name(GENITIVE, @name);
# $genitive == qw/Петровой Любови Степановны/;

TO DO

Inflect any nouns, any words, anything...

EXPORT

Function detect_gender_by_given_name and detect_gender_by_given_name are exported by default.

Also you can export only case names:

use Lingua::RU::Inflect qw/:cases/;

Or only subs and genders

use Lingua::RU::Inflect qw/:subs :genders/;

Or everything: subs, genders and case names:

use Lingua::RU::Inflect qw/:all/; # or
use Lingua::RU::Inflect qw/:cases :genders :subs/;

FUNCTIONS

detect_gender_by_given_name

Try to detect gender by name. Up to three arguments expected: lastname, firstname, patronym.

Return MASCULINE, FEMININE for successful detection or undef when function can't detect gender.

Detection rules

When name match some rule, rest of rules are ignored.

  1. Patronym (russian отчество — otchestvo), if presented, gives unambiguous detection rules: feminine patronyms ends with “na”, masculine ones ends with “ich” and “ych”.

  2. Most of russian feminine firstnames ends to vowels “a” and “ya”. Most of russian masculine firstnames ends to consonants.

    There's exists exceptions for both rules: feminine names such as russian name Lubov' (Любовь) and foreign names Ruf' (Руфь), Rachil' (Рахиль) etc. Masculine names also often have affectionate diminutive forms: Alyosha (Алёша) for Alexey (Алексей), Kolya (Коля) for Nickolay (Николай) etc. Some affectionate diminutive names are ambiguous: Sasha (Саша) is diminutive name for feminine name Alexandra (Александра) and for masculine name Alexander (Александр), Zhenya (Женя) is diminutive name for feminine name Eugenia (Евгения) and for masculine name Eugene (Евгений) etc.

    These exceptions are processed.

    When got ambiguous result, function try to use next rule.

  3. Most of russian lastnames derived from possessive nouns (and names). Feminine forms of these lastnames ends to “a”. Some lastnames derived from adjectives. Feminine forms of these lastnames ends to “ya”.

_inflect_given_name

Inflect name of given gender to given case. Up to 5 arguments expected: gender, case, lastname, firstname, patronym. Lastname, firstname, patronym must be in Nominative.

Return list contains inflected lastname, firstname, patronym.

inflect_given_name

Detect gender by given name and inflect this name.

Expect for up to 4 arguments: case, lastname, firstname, patronym

Return list which contains inflected lastname, firstname, patronym

SEE ALSO

http://www.imena.org/declension.html (in Russian)

AUTHOR

Alexander Sapozhnikov, <shoorick at cpan.org>

BUGS

Please report any bugs or feature requests to bug-lingua-ru-inflect at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Lingua-RU-Inflect. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Lingua::RU::Inflect

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2009-2010 Alexander Sapozhnikov.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 9:

Non-ASCII character seen before =encoding in '—'. Assuming UTF-8