Git Product home page Git Product logo

plural-ru's Introduction

plural-ru

Go Reference GitHub release (latest SemVer) GitHub go.mod Go version Go Report Card Coverage Status license

Package Pluralization of russian words for golang with generics for int | int32 | int64 | uint | uint32 | uint64 types

Usage

package main

import (
    "log"

    "github.com/rb-go/plural-ru"
)

func main() {
    log.Println(1, plural.Noun(1, "день", "дня", "дней"))
    log.Println(2, plural.Noun(2, "день", "дня", "дней"))
    log.Println(3, plural.Noun(3, "день", "дня", "дней"))
    log.Println(4, plural.Noun(4, "день", "дня", "дней"))
    log.Println(5, plural.Noun(5, "день", "дня", "дней"))
    log.Println(8, plural.Noun(8, "день", "дня", "дней"))
    log.Println(11, plural.Noun(11, "день", "дня", "дней"))
    log.Println(1111, plural.Noun(1111, "день", "дня", "дней"))
    log.Println(121, plural.Noun(121, "день", "дня", "дней"))

    cnt := 100500
    log.Println(plural.Verb(cnt, "нашелся", "нашлись", "нашлось"), cnt, plural.Noun(cnt, "идея", "идеи", "идей"))
}

will print in console:

2022/10/28 17:27:09 1 день
2022/10/28 17:27:09 2 дня
2022/10/28 17:27:09 3 дня
2022/10/28 17:27:09 4 дня
2022/10/28 17:27:09 5 дней
2022/10/28 17:27:09 8 дней
2022/10/28 17:27:09 11 дней
2022/10/28 17:27:09 1111 дней
2022/10/28 17:27:09 121 день
2022/10/28 17:27:09 нашлось 100500 идей

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.