0.0.5 • Published 8 years ago

@datagica/parse-family v0.0.5

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
8 years ago

Parse Family

Your marital status and your children, processed by a machine.

Installation

$ npm install --save @datagica/parse-family

Usage

import parseFamily from "@datagica/parse-family";

parseFamily(INPUT).then(result => {
  if (result == null) {
    console.log("not found")
  } else {
    console.log("found: ", result)
  }
}).catch(err => {
  console.log("invalid input data: "+err)
})

Examples

import parseFamily from "@datagica/parse-family";

parseFamily("married, two children.").then(..).catch(..)
{
  marital: 'married',
  children: 2,
  id: 'married-parent-of-2',
  label: 'married parent'
}

// I'm french. So it can also parse french, bien entendu.
parseFamily("marié, deux enfants.").then(..).catch(..)
{
  marital: 'married',
  children: 2,
  id: 'married-parent-of-2',
  label: 'married parent'
}

TODO

  • the family parser should support more text formats
  • should support more languages, too