0.0.2 • Published 6 years ago

@datagica/parse-birthdates v0.0.2

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

parse-birthdates

const parse = require('@datagica/parse-birthdates')
await parse('age: 77 years old')

will output:

[
      {
        "ngram": "age: 77",
        "value": {
          "id": "birthdate-1941-02-01",
          "label": {
            "en": "1941-02-01"
          },
          "date": "1941-02-01",
          "age": 77,
          "keywords": {
            "en": [
              "birthday",
              "birth date",
              "age"
            ],
            "fr": [
              "âge",
              "date de naissance"
            ]
          }
        },
        "score": 1,
        "position": {
          "sentence": 0,
          "word": 2,
          "begin": 7,
          "end": 14
        }
      }
    ]