node-postal
Advanced tools
Comparing version 0.3.0 to 1.0.0
{ | ||
"name": "node-postal", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"author": "Al Barrentine (@thatdatabaseguy)", | ||
@@ -5,0 +5,0 @@ "description": "International address parsing/normalization at C speed", |
node-postal | ||
----------- | ||
[![Build Status](https://travis-ci.org/openvenues/node-postal.svg?branch=master)](https://travis-ci.org/openvenues/node-postal) | ||
[![Build Status](https://travis-ci.org/openvenues/node-postal.svg?branch=master)](https://travis-ci.org/openvenues/node-postal) [![npm](https://img.shields.io/npm/v/node-postal.svg?maxAge=2592000)](https://www.npmjs.com/package/node-postal) | ||
@@ -28,3 +28,3 @@ These are the NodeJS bindings to [libpostal](https://github.com/openvenues/libpostal), a fast, multilingual NLP library for parsing/normalizing physical addresses. libpostal is written in C because virtually every other language can bind to C. | ||
``` | ||
sudo apt-get install curl libsnappy-dev autoconf automake libtool pkg-config | ||
sudo apt-get install curl autoconf automake libtool pkg-config | ||
``` | ||
@@ -34,3 +34,3 @@ | ||
``` | ||
sudo yum install snappy snappy-devel autoconf automake libtool pkgconfig | ||
sudo yum install curl autoconf automake libtool pkgconfig | ||
``` | ||
@@ -40,3 +40,3 @@ | ||
``` | ||
brew install snappy autoconf automake libtool pkg-config | ||
brew install curl autoconf automake libtool pkg-config | ||
``` | ||
@@ -57,3 +57,10 @@ | ||
``` | ||
**Install node-gyp** | ||
Then install node-gyp system-wide: | ||
``` | ||
sudo npm install -g node-gyp | ||
``` | ||
**Installing node-gyp on Linux (Ubuntu)** | ||
@@ -67,8 +74,3 @@ | ||
Then install node-gyp system-wide: | ||
``` | ||
sudo npm install -g node-gyp | ||
``` | ||
**Installing the Node bindings** | ||
@@ -83,3 +85,3 @@ | ||
node-postal is tested on most major versions of Node (0.10+) in continuous integration. The C++ bindings are written using [Nan](https://github.com/nodejs/nan), which abstracts the API changes across various versions of V8. | ||
node-postal is tested on most major versions of Node (0.10+) in continuous integration. The C++ bindings are written using [Nan](https://github.com/nodejs/nan), which abstracts the API changes across various versions of V8, so the latest versions of Node will likely work. | ||
@@ -97,2 +99,18 @@ If you're having trouble compiling, post a Github issue with your OS and Node versions along with the output of npm install / node-gyp rebuild. | ||
Troubleshooting | ||
--------------- | ||
**Installing [libpostal](https://github.com/openvenues/libpostal):** | ||
node-postal is a thin wrapper around libpostal, which is written in C. Installing node-postal with npm will not install libpostal as a dependency. The install steps described above will install it in standard locations for your OS. For OS X and Linux, that's `/usr/local/include` and `/usr/local/lib`. node-postal will look in these locations for the C libraries. If you have problems installing node-postal, check there for recently installed libpostal libraries. | ||
**Downloading Large Files** | ||
The ```make``` process downloads ~3GB of data (these are production-quality machine learning models, the kind Google engineers get to use). Make sure the --datadir argument to ```configure```, which requires an absolute path, has enough room to accommodate the models. If you get errors after downloading, e.g.: | ||
``` | ||
make[3]: *** [all-local] Error 1 | ||
make[2]: *** [all-recursive] Error 1 | ||
make[1]: *** [all-recursive] Error 1 | ||
make: *** [all] Error 2 | ||
``` | ||
there may be problems with subsequent install steps. Occasionally something will go wrong and it will give up downloading. Once downloading is complete, the make script will unpack the langauge_classifier.tar.gz.X files. If you see these files, your download may have stopped. Try running the make script again. | ||
Special Thanks | ||
@@ -99,0 +117,0 @@ -------------- |
@@ -20,3 +20,3 @@ var postal = require('../'); | ||
expansions = new sets.Set(postal.expand.expand_address('Friedrichstraße 128, Berlin, Germany')); | ||
assert(expansions.has('friedrich strasse 128 berlin germany')); | ||
assert(expansions.has('friedrich straße 128 berlin germany')); | ||
}); | ||
@@ -58,39 +58,3 @@ | ||
}); | ||
it('should parse a venue and state', function() { | ||
parsed = postal.parser.parse_address('whole foods ny'); | ||
assert(has_components(parsed, { | ||
house: 'whole foods', | ||
state: 'ny' | ||
})); | ||
}); | ||
it('should parse house/apt style house_number', function() { | ||
parsed = postal.parser.parse_address('1917/2 Pike Drive'); | ||
assert(has_components(parsed, { | ||
house_number: '1917 / 2', | ||
road: 'pike drive' | ||
})); | ||
}); | ||
it('should parse different comma styles correctly', function() { | ||
parsed = postal.parser.parse_address('3437 warwickshire rd,pa'); | ||
assert(has_components(parsed, { | ||
house_number: '3437', | ||
road: 'warwickshire rd', | ||
state: 'pa' | ||
})); | ||
parsed = postal.parser.parse_address('3437 warwickshire rd, pa'); | ||
assert(has_components(parsed, { | ||
house_number: '3437', | ||
road: 'warwickshire rd', | ||
state: 'pa' | ||
})); | ||
parsed = postal.parser.parse_address('3437 warwickshire rd pa'); | ||
assert(has_components(parsed, { | ||
house_number: '3437', | ||
road: 'warwickshire rd', | ||
state: 'pa' | ||
})); | ||
}); | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
113
48503
58