Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/striker2000/petrovich
Golang port of Petrovich - an inflector for Russian anthroponyms.
https://github.com/striker2000/petrovich
Last synced: about 2 months ago
JSON representation
Golang port of Petrovich - an inflector for Russian anthroponyms.
- Host: GitHub
- URL: https://github.com/striker2000/petrovich
- Owner: striker2000
- License: mit
- Created: 2016-12-26T22:50:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-29T23:24:40.000Z (about 1 year ago)
- Last Synced: 2024-07-31T20:53:14.336Z (5 months ago)
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 46
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - petrovich - Petrovich is the library which inflects Russian names to given grammatical case. (Text Processing / Utility/Miscellaneous)
- awesome-go - petrovich - Golang port of Petrovich - an inflector for Russian anthroponyms. - ★ 16 (Natural Language Processing)
- awesome-go-extra - petrovich - an inflector for Russian anthroponyms.|39|5|0|2016-12-26T22:50:38Z|2021-02-22T18:27:56Z| (Bot Building / Utility/Miscellaneous)
- awesome-go-zh - petrovich
README
![Petrovich](petrovich.png)
Petrovich is the library which inflects Russian names to given grammatical case.
This is the Go port of https://github.com/petrovich.
[![GoDoc](https://godoc.org/github.com/striker2000/petrovich?status.svg)](https://godoc.org/github.com/striker2000/petrovich)
[![Build Status](https://travis-ci.org/striker2000/petrovich.svg?branch=master)](https://travis-ci.org/striker2000/petrovich)
[![Coverage Status](https://coveralls.io/repos/github/striker2000/petrovich/badge.svg?branch=master)](https://coveralls.io/github/striker2000/petrovich?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/striker2000/petrovich)](https://goreportcard.com/report/github.com/striker2000/petrovich)## Installation
```
go get github.com/striker2000/petrovich
```## Usage
All functions takes three arguments: name in nominative case, gender and grammatical case.
```go
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.
| Case | Case (in Russian) | Question (in Russian) |
|---------------------------|-------------------|------------------------|
| `petrovich.Nominative` | Именительный | Кто? |
| `petrovich.Genitive` | Родительный | Кого? |
| `petrovich.Dative` | Дательный | Кому? |
| `petrovich.Accusative` | Винительный | Кого? |
| `petrovich.Instrumental` | Творительный | Кем? |
| `petrovich.Prepositional` | Предложный | О ком? |