All Projects → petrovich → petrovich_elixir

petrovich / petrovich_elixir

Licence: MIT license
Elixir library to inflect Russian first, last, and middle names.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to petrovich elixir

RussianNounsJS
Склонение существительных по падежам. Обычно требуются только форма в именительном падеже, одушевлённость и род.
Stars: ✭ 29 (-21.62%)
Mutual labels:  inflection
rsmorphy
Morphological analyzer / inflection engine for Russian and Ukrainian languages rewritten in Rust
Stars: ✭ 27 (-27.03%)
Mutual labels:  inflection
EnglishText.jl
Utilities for English-language quirks in Julia
Stars: ✭ 12 (-67.57%)
Mutual labels:  inflection
syntaxmaker
The NLG tool for Finnish
Stars: ✭ 19 (-48.65%)
Mutual labels:  inflection
flect
An inflection engine for golang
Stars: ✭ 69 (+86.49%)
Mutual labels:  inflection
mlmorph
Malayalam Morphological Analyzer using Finite State Transducer
Stars: ✭ 40 (+8.11%)
Mutual labels:  inflection
dry-inflector
Inflector for Ruby
Stars: ✭ 89 (+140.54%)
Mutual labels:  inflection
sklonenie
Light-weight and fast library to decline Russian names
Stars: ✭ 23 (-37.84%)
Mutual labels:  inflection
KoParadigm
KoParadigm: Korean Inflectional Paradigm Generator
Stars: ✭ 48 (+29.73%)
Mutual labels:  inflection

petrovic_elixir

petrovich

test Coverage Status Hex Version License

Elixir library to inflect Russian first, last, and middle names.

Installation

def deps do
  [
    {:petrovich_elixir, "~> 1.0"}
  ]
end

Usage

Do I need to know Russian to use it?

Yes, you will need some basic Russian knowledge to work with this library. You need to understand how grammatical cases work in Russian language.

Inflection

Petrovich.firstname!("Александр", :accusative)
# => Александра

Petrovich.middlename!("Сергеевич", :accusative)
# => Сергеевича

Petrovich.lastname!("Пушкин", :accusative, :male)
# => Пушкина

Gender detection

alias Petrovich.Detector

Detector.detect_gender("Александр", :firstname)
# => {:ok, "male"}

Configuration

You will need to add these lines into your config.exs:

config :petrovich_elixir,
  rules_path: "rules/rules.json",
  gender_path: "rules/gender.json",
  json_codec: Jason

You can swap our default (Jason) codec to any of your choice.

Rules

This package uses petrovich-rules as the source for all transformations. If you ever experience wrong result or other issues with the data itself, please open an issue here.

License

MIT. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].