GithubHelp home page GithubHelp logo

isabella232 / humanparser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from remind101/humanparser

0.0 0.0 0.0 61 KB

Parse a human name string into salutation, first name, middle name, last name, suffix.

Home Page: https://www.npmjs.org/package/humanparser

License: MIT License

JavaScript 100.00%

humanparser's Introduction

humanparser JavaScript Bug Squash

humanparser is a third-party library we use at Remind to parse a human name string into salutation, first name, middle name, last name, and suffix.

Requirements

  • Node version >= v11.15.0

If you have nvm installed you can run nvm use instead

Installation

You can use your preferred package manager for the installation

Install using yarn:

yarn install

Install using npm:

npm install

Your Goal

Your goal is to find the root cause of the bug described below, then fix it if you have time!

The Bug

When parseName is called for a salutation and last name only, it is returning the last name as the first name:

const human = require("humanparser")
const attrs = human.parseName("Ms. Smith")
console.log(attrs);

actual:

{ 
    salutation: 'Ms.',
    firstName: 'Smith',
    lastName: '',
    fullName: 'Ms. Smith'
}

expected:

{ 
    salutation: 'Ms.',
    firstName: '',
    lastName: 'Smith',
    fullName: 'Ms. Smith'
}

Usage

There are two scripts on the package.json file

Changelog

The mocha test suite has been left untouched for legacy compatibility.

For new tests it's strongly suggested to use the jest test suite

humanparser's People

Contributors

ralyodio avatar willsnake avatar chovy avatar hharaguc avatar barwin avatar anthonyettinger avatar 5harf avatar sajinshrestha avatar bitdeli-chef avatar gitter-badger 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.