Popularity
5.3
Declining
Activity
1.8
Growing
39
14
2

Monthly Downloads: 45
Programming language: Elixir
License: MIT License
Latest version: v1.0.0

Petrovich alternatives and similar packages

Based on the "Natural Language Processing (NLP)" category.
Alternatively, view Petrovich alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Petrovich or a related project?

Add another 'Natural Language Processing (NLP)' Package

README

petrovic_elixir

petrovich

Build Status 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 all licence references and agreements mentioned in the Petrovich README section above are relevant to that project's source code only.