sweloc
v1.1.0
Published
Extracts Swedish roads/cities etc from a string
Downloads
5
Readme
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