SandpointsGitHook/vendor/github.com/gobuffalo/flect
2023-07-29 01:10:04 +02:00
..
.gitignore new vendor... 2021-03-20 23:21:23 +01:00
.gometalinter.json new vendor... 2021-03-20 23:21:23 +01:00
acronyms.go new vendor... 2021-03-20 23:21:23 +01:00
camelize.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
capitalize.go new vendor... 2021-03-20 23:21:23 +01:00
custom_data.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
dasherize.go new vendor... 2021-03-20 23:21:23 +01:00
flect.go new vendor... 2021-03-20 23:21:23 +01:00
humanize.go new vendor... 2021-03-20 23:21:23 +01:00
ident.go new vendor... 2021-03-20 23:21:23 +01:00
LICENSE new vendor... 2021-03-20 23:21:23 +01:00
lower_upper.go new vendor... 2021-03-20 23:21:23 +01:00
Makefile new vendor... 2021-03-20 23:21:23 +01:00
ordinalize.go new vendor... 2021-03-20 23:21:23 +01:00
pascalize.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
plural_rules.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
pluralize.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
README.md new vendor... 2021-03-20 23:21:23 +01:00
rule.go new vendor... 2021-03-20 23:21:23 +01:00
SHOULDERS.md new vendor... 2021-03-20 23:21:23 +01:00
singular_rules.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
singularize.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
titleize.go new vendor... 2021-03-20 23:21:23 +01:00
underscore.go compile with patched hugo for footnotes... 2023-07-29 01:10:04 +02:00
version.go new vendor... 2021-03-20 23:21:23 +01:00

# Flect

<p align="center">
<a href="https://godoc.org/github.com/gobuffalo/flect"><img src="https://godoc.org/github.com/gobuffalo/flect?status.svg" alt="GoDoc" /></a>
<a href="https://dev.azure.com/markbates/buffalo/_build/latest?definitionId=51&branchName=master"><img src="https://dev.azure.com/markbates/buffalo/_apis/build/status/gobuffalo.flect?branchName=master" alt="CI" /></a>
<a href="https://goreportcard.com/report/github.com/gobuffalo/flect"><img src="https://goreportcard.com/badge/github.com/gobuffalo/flect" alt="Go Report Card" /></a>
</p>

This is a new inflection engine to replace [https://github.com/markbates/inflect](https://github.com/markbates/inflect) designed to be more modular, more readable, and easier to fix issues on than the original.

## Installation

```bash
$ go get -u -v github.com/gobuffalo/flect
```

## `github.com/gobuffalo/flect`
<a href="https://godoc.org/github.com/gobuffalo/flect"><img src="https://godoc.org/github.com/gobuffalo/flect?status.svg" alt="GoDoc" /></a>

The `github.com/gobuffalo/flect` package contains "basic" inflection tools, like pluralization, singularization, etc...

### The `Ident` Type

In addition to helpful methods that take in a `string` and return a `string`, there is an `Ident` type that can be used to create new, custom, inflection rules.

The `Ident` type contains two fields.

* `Original` - This is the original `string` that was used to create the `Ident`
* `Parts` - This is a `[]string` that represents all of the "parts" of the string, that have been split apart, making the segments easier to work with

Examples of creating new inflection rules using `Ident` can be found in the `github.com/gobuffalo/flect/name` package.

## `github.com/gobuffalo/flect/name`
<a href="https://godoc.org/github.com/gobuffalo/flect/name"><img src="https://godoc.org/github.com/gobuffalo/flect/name?status.svg" alt="GoDoc" /></a>

The `github.com/gobuffalo/flect/name` package contains more "business" inflection rules like creating proper names, table names, etc...