Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmore/full_name_splitter
Full Name Splitter is a library to split a full name simply into first and last name.
https://github.com/mmore/full_name_splitter
elixir erlang lexer parser splitter
Last synced: 2 months ago
JSON representation
Full Name Splitter is a library to split a full name simply into first and last name.
- Host: GitHub
- URL: https://github.com/mmore/full_name_splitter
- Owner: MMore
- License: mit
- Created: 2022-04-30T11:03:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-09T01:18:34.000Z (3 months ago)
- Last Synced: 2024-10-09T09:53:21.477Z (3 months ago)
- Topics: elixir, erlang, lexer, parser, splitter
- Language: Elixir
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FullNameSplitter
[![CI](https://github.com/MMore/full_name_splitter/actions/workflows/ci.yml/badge.svg)](https://github.com/MMore/full_name_splitter/actions/workflows/ci.yml) [![Hex](https://img.shields.io/hexpm/v/full_name_splitter)](https://hex.pm/packages/full_name_splitter)
Full Name Splitter is a library to split a full name simply into first and last name.
It was inspired by the [JavaScript port](https://github.com/trello/full-name-splitter). But it uses
a tokenizer built with Erlang [`leex`](https://erlang.org/doc/man/leex.html) and a parser built
with Erlang [`yecc`](https://erlang.org/doc/man/yecc.html).## Installation
Add `full_name_splitter` to your list of dependencies in mix.exs:
```elixir
def deps do
[
{:full_name_splitter, "~> 1.0.0"}
]
end
```## Usage
```elixir
FullNameSplitter.split("Leonardo da Vinci")
{"Leonardo", "da Vinci"}FullNameSplitter.split("Johan de heer Van Kampen")
{"Johan", "de heer Van Kampen"}FullNameSplitter.split("Anthony R Von Fange III")
{"Anthony R", "Von Fange III"}
```