Git Product home page Git Product logo

go-pluralize's Introduction

go-pluralize

Build Status Go Report Card GoDoc

Pluralize and singularize any word

Acknowledgements

The go-pluralize module is the Golang adaptation of the great work from Blake Embrey and other contributors who created and maintain the NPM JavaScript pluralize package. The originating Javascript implementation can be found on https://github.com/blakeembrey/pluralize

Without their great work this module would have taken a lot more effort, thank you all!

Version mapping

The latest go-pluralize version is compatible with pluralize version 8.0.0 commit #36f03cd

go-pluralize version NPM Pluralize Package version
0.2.0 - Jan 25, 2022 v0.2.0 8.0.0 - Oct 6, 2021 #36f03cd
0.1.7 - Jun 23, 2020 v0.1.7 8.0.0 - Mar 14, 2020 #e507706
0.1.2 - Apr 1, 2020 v0.1.2 8.0.0 - Mar 14, 2020 #e507706
0.1.1 - Sep 15, 2019 v0.1.1 8.0.0 - Aug 27, 2019 #abb3991
0.1.0 - Jun 12, 2019 v0.1.0 8.0.0 - May 24, 2019 #0265e4d

Installation

To install the go module:

go get -u github.com/gertd/go-pluralize

To lock down a specific the version:

go get -u github.com/gertd/[email protected]

Download the sources and binaries from the latest release

Usage

Code

import pluralize "github.com/gertd/go-pluralize"

word := "Empire"

pluralize := pluralize.NewClient()

fmt.Printf("IsPlural(%s)   => %t\n", input, pluralize.IsPlural(word))
fmt.Printf("IsSingular(%s) => %t\n", input, pluralize.IsSingular(word))
fmt.Printf("Plural(%s)     => %s\n", input, pluralize.Plural(word))
fmt.Printf("Singular(%s)   => %s\n", input, pluralize.Singular(word))

Result

IsPlural(Empire)   => false
IsSingular(Empire) => true
Plural(Empire)     => Empires
Singular(Empire)   => Empire

Pluralize Command Line

Installation

go get -x github.com/gertd/go-pluralize/cmd/pluralize

Usage

Help

pluralize -help
Usage of ./bin/pluralize:
  -cmd string
        command [All|IsPlural|IsSingular|Plural|Singular] (default "All")
  -version
        display version info
  -word string
        input value

Word with All Commands

pluralize -word Empire 

IsPlural(Empire)   => false
IsSingular(Empire) => true
Plural(Empire)     => Empires
Singular(Empire)   => Empire

Is Word Plural?

pluralize -word Cactus -cmd IsPlural

IsPlural(Cactus)   => false

Is Word Singular?

pluralize -word Cacti -cmd IsSingular

IsSingular(Cacti)  => false

Word Make Plural

pluralize -word Cactus -cmd Plural

Plural(Cactus)     => Cacti

Word Make Singular

pluralize -word Cacti -cmd Singular

Singular(Cacti)    => Cactus

go-pluralize's People

Contributors

efirs avatar gertd avatar tony-o avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-pluralize's Issues

Checksum mismatch

Having a weird issue trying to upgrade to the new go-pluralize.

Our Renovate PR that is trying to update it fails in CI with the following error:

verifying github.com/gertd/[email protected]: checksum mismatch
	downloaded: h1:3aljIkBHcMFPYdveAiihVWZ+7ZH2ALkRgJw0YPqqCrk=
	go.sum:     h1:8q9mYRD4K9X6fsldYCQKM3HZtNV/gfieh6xerucwoM4=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

It has been doing it consistently for the last two weeks, so it does not seem like a one-off problem.

PR: googleapis/api-linter#529
CI: 1, 2

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.