Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dre1080/name_case
Correctly case a person's name
https://github.com/dre1080/name_case
Last synced: about 2 months ago
JSON representation
Correctly case a person's name
- Host: GitHub
- URL: https://github.com/dre1080/name_case
- Owner: dre1080
- License: mit
- Created: 2021-10-08T11:11:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-01T02:14:59.000Z (almost 3 years ago)
- Last Synced: 2024-10-01T10:10:30.672Z (3 months ago)
- Language: Elixir
- Size: 15.6 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NameCase
![CI](https://github.com/dre1080/name_case/actions/workflows/ci.yml/badge.svg)
Correctly case a person's name. This is good for converting denormalized data to human friendly data.
## Installation
Add `name_case` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:name_case, "~> 0.3.0"}
]
end
```## Usage
```elixir
iex(1)> NameCase.nc("LOUIS XIV")
"Louis XIV"iex(2)> NameCase.nc("O'CALLAGHAN")
"O'Callaghan"iex(3)> NameCase.nc("MCDONALDS")
"McDonalds"iex(4)> NameCase.nc("LEIGH-WILLIAMS")
"Leigh-Williams"iex(5)> NameCase.nc("ST. JOHN")
"St. John"iex(6)> NameCase.nc("VIRGIL VAN DYKE")
"Virgil van Dyke"iex(7)> NameCase.nc("JJ ABRAMS")
"JJ Abrams"
```## Acknowledgements
This is an Elixir port of the [Perl](https://github.com/barbie/lingua-en-namecase), [Ruby](https://github.com/tenderlove/namecase) and [PHP](https://github.com/tamtamchik/namecase) version.