Awesome Go

petrovich

CategoryText Processing
SubcategoryUtility/Miscellaneous
Stars0

Petrovich is the library which inflects Russian names to given grammatical case

About petrovich

Petrovich

Petrovich is the library which inflects Russian names to given grammatical case.

This is the Go port of https://github.com/petrovich.

GoDoc Build Status Coverage Status Go Report Card

Installation

go get github.com/striker2000/petrovich

Usage

All functions takes three arguments: name in nominative case, gender and grammatical case.

import "github.com/striker2000/petrovich"

n := petrovich.FirstName("Кузьма", petrovich.Male, petrovich.Genitive)
fmt.Print(n) // "Кузьмы"

n = petrovich.MiddleName("Сергеевич", petrovich.Male, petrovich.Instrumental)
fmt.Print(n) // "Сергеевичем"

n = petrovich.LastName("Петров-Водкин", petrovich.Male, petrovich.Prepositional)
fmt.Print(n) // "Петрове-Водкине"

Valid values for gender are petrovich.Androgynous, petrovich.Male and petrovich.Female.

Full list of grammatical cases is in the table below.

CaseCase (in Russian)Question (in Russian)
petrovich.NominativeИменительныйКто?
petrovich.GenitiveРодительныйКого?
petrovich.DativeДательныйКому?
petrovich.AccusativeВинительныйКого?
petrovich.InstrumentalТворительныйКем?
petrovich.PrepositionalПредложныйО ком?

Frequently Asked Questions

What is petrovich?

petrovich is a Text Processing library for the Go programming language. Petrovich is the library which inflects Russian names to given grammatical case

How do I install petrovich?

Install petrovich with the Go module system using `go get striker2000/petrovich`. Check the repository for the current installation instructions.

What category does petrovich belong to?

petrovich is listed under Text Processing, specifically Utility/Miscellaneous.

← Back to Utility/Miscellaneous