@datagica/parse-family
v0.0.5
Published
Family status parser (married, single, no child, 2 children etc..)
Downloads
4
Readme
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