Skip to content

greendatasoft/ru-grammar-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ru-Grammar-Tools (a set of tools for working with russian grammar)

This is a java library intended for case declension Russian full-names (Surname, Firstname, Patronymic), official job-titles, legal organization names, regular terms and numerals, and also for spelling cardinal and ordinal numbers.

It is based on petrovich-rules and OpenRussian dictionary. The library contains 1000+ test-cases.

Examples:

GrammarTools.getInflectionEngine().inflectPatronymic("Петрович", Case.GENITIVE, Gender.MALE);
GrammarTools.getInflectionEngine().inflectSurname("Петрова", Case.PREPOSITIONAL, Gender.FEMALE);
GrammarTools.getInflectionEngine().inflectFullname("Петрова Петра Петровна", Case.DATIVE);
GrammarTools.getInflectionEngine().inflectNameOfOrganization("Общество с ограниченной ответственностью Бёрнинг Мэн", Case.ACCUSATIVE);
GrammarTools.getInflectionEngine().inflectNameOfProfession("Вентилевой гидравлического пресса", Case.ACCUSATIVE);
GrammarTools.getInflectionEngine().inflectNumeral("сорок два", "доллар", Case.INSTRUMENTAL);
GrammarTools.getSpellingEngine().spell(42.42);
GrammarTools.getSpellingEngine().spellOrdinal(42, Gender.NEUTER);

Related links:

How to use:

Requirements:
  • Git
  • Java 11+
  • Maven 3+
License
  • Apache License Version 2.0