@datagica/parse-location
v0.0.0
Published
location parser
Downloads
3
Readme
@datagica/parse-location
Parse the first found location in a document.
Installation
$ npm install --save @datagica/parse-location
Usage
import parseLocation from "@datagica/parse-location";
parseLocation("Pierre Dupont. 12345. Saint-léger-du-malzieu en France.").then(..).catch(..)
// will output:
{
"ngram": "Saint-léger-du-malzieu en France.",
"value": {
"id": "fr-saint-léger-du-malzieu",
"countryCode": "FR",
"country": "France",
"name": {
"en": "Saint-léger-du-malzieu, France"
},
"aliases": ["Saint-léger-du-malzieu France"],
"location": [44.8881, 3.3094]
},
"len": 3,
"errorLengthRatio": 0.1,
"position": {
"substring": {
"begin": 22,
"end": 55
},
"fullstring": {
"begin": 22,
"end": 55
}
}
}
// pretty cool right?