Git Product home page Git Product logo

fullname_parser's Introduction

Fullname parser

Description

ParseFullname() is designed to parse large batches of full names in multiple inconsistent formats, as from a database.

parseFullName():

  1. accepts a string containing a person's full name, in any format,
  2. analyzes and attempts to detect the format of that name,
  3. (if possible) parses the name into its component parts, and
  4. returns an object containing all individual parts of the name:
    • title (string): title(s) (e.g. "Ms." or "Dr.")
    • first (string): first name or initial
    • middle (string): middle name(s) or initial(s)
    • last (string): last name or initial
    • nick (string): nickname(s)
    • suffix (string): suffix(es) (e.g. "Jr.", "II", or "Esq.")

Use

Instalation

	go get github.com/amonsat/fullname_parser

Basic Use

package main
import fp "github.com/amonsat/fullname_parser"

func main() {
    parsedFullname := fp.ParseFullname("Mr. David Davis")
    println(parsedFullname.Title)
    println(parsedFullname.First)
    println(parsedFullname.Last)
}

Parsedname struct

type ParsedName struct {
	Title  string
	First  string
	Middle string
	Last   string
	Nick   string
	Suffix string
}

Credits and precursors

My thanks to David Schnell-Davis for sharing his work.

David Schnell-Davis's parse-full-name https://github.com/dschnelldavis/parse-full-name

fullname_parser's People

Contributors

amonsat avatar

Watchers

James Cloos avatar

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.