jinzhu / inflection Goto Github PK
View Code? Open in Web Editor NEWPluralizes and singularizes English nouns
License: MIT License
Pluralizes and singularizes English nouns
License: MIT License
It would be great if something like inflection.AddPlural("person","persons")
would work. At the moment it has no effect, meaning the standard rule applies returning people
as plural for person
.
Hey, I noticed the project doesn't have a license defined anywhere. Would you mind choosing one? ๐
package main
import (
"fmt"
"github.com/jinzhu/inflection"
)
func main() {
// outputs "Campu"
fmt.Println("Campus", inflection.Singular("Campus"))
}
package main
import (
"fmt"
"github.com/jinzhu/inflection"
)
func main() {
// prints quota, should be quotas
fmt.Println(inflection.Plural("quota"))
}
The name quota is pluralised as quota instead of quotas
import inflection as inf
inf.singularize('leaves')
package main
import (
"fmt"
"github.com/jinzhu/inflection"
)
func main() {
// outputs "Metum"
fmt.Println("Meta", inflection.Singular("Meta"))
}
https://play.golang.org/p/MQUTqDKmndH
Human is pluralized to Humen. It should get pluralized to humans.
Greetings.
CGO_ENABLED=0 go build -tags=jsoniter -o binary .
/go/src/github.com/jinzhu/inflection/inflections.go:123:24: syntax error: unexpected newline in composite literal; possibly missing comma or }
docker image version: golang:1.18, golang:1.19
Thanks.
Thinking about support for multiple languages I think it's better pluralInflections[1] be public
[1]
Line 55 in b074e8f
package main
import (
"fmt"
"github.com/jinzhu/inflection"
)
func main() {
// outputs "Calory"
fmt.Println("Calories", inflection.Singular("Calories"))
}
https://go.dev/play/p/1zHMwo_Hb2t
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.