1.1.0 • Published 7 years ago

sweloc v1.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

Sweloc

A small node package that extracts Swedish locations from a string. Currently it will extract county roads (Länsvägar), National roads (Riksvägar), roads (Gatuadresser) and localities (citynames or small villagenames. E.g. Skeppsmalen, Stora Mossen, Vällingby or Stockholm). I plan to add lakes, trafficstops etc in the future..

Installation

npm install sweloc

Usage

const sweloc = require('sweloc');

let options = {
    countyRoads:false
};

let swelocObject = sweloc(`På riksväg 41 i höjd med Fritsla så har en lastbil frontalkrockat med en personbil och på Drottningholmsvägen i Bromma har en bil fått motorstopp.`, options);

console.log(swelocObject);

Above will output this in your console:

{ roads: [ 'Drottningholmsvägen' ],
  nationalRoads: [ 'riksväg 41' ],
  localities: [ 'Bromma', 'Fritsla' ] }

Available options

  • roads: (boolean) Defaults to true
  • countyRoads: (boolean) Defaults to true
  • nationalRoads: (boolean) Defaults to true
  • euRoads: (boolean) Defaults to true
  • localities: (boolean) Defaults to true

License

MIT
1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago