sweetiq / expostal Goto Github PK
View Code? Open in Web Editor NEWElixir binding for Libpostal - a library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
License: MIT License
Elixir binding for Libpostal - a library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
License: MIT License
Thanks for this awesome open source library!
I'm wondering if there's currently any support for handling standard postal abbreviations (e.g. road -> rd, street -> st)?
I'm getting the following error when trying to boot up my app. It says init/0
is undefined. I see that it's currently private and i'm not sure if that's related? I have tested the install for libpostal by running a nodejs script and that works great.
OSX 10.12.4
Elixir 1.6.5
Fresh install of libpostal via brew/make
expostal 0.2.0
⇒ iex -S mix phoenix.server
Erlang/OTP 20 [erts-9.3.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
--------------------- MIX ENV --------------------------
nil
:dev
make: `priv/expostal.so' is up to date.
==> expostal
Compiling 1 file (.ex)
== Compilation error in file lib/expostal.ex ==
** (CompileError) lib/expostal.ex:1: function init/0 undefined
(stdlib) lists.erl:1338: :lists.foreach/2
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
could not compile dependency :expostal, "mix compile" failed. You can recompile this dependency with "mix deps.compile expostal", update it with "mix deps.update expostal" or clean it with "mix deps.clean expostal"
make[1]: Entering directory '/home/olafura/dev/expostal'
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -I/usr/local/lib/erlang/erts-9.0/include -I/usr/local/include -I/usr/include -L/usr/local/lib -L/usr/lib -lpostal -std=gnu99 -Wno-unused-function -fPIC -shared -o priv/parser.so src/parser.c
src/parser.c: In function �parse_address�:
src/parser.c:30:13: warning: pointer targets in passing argument 1 of �strncpy� differ in signedness [-Wpointer-sign]
strncpy(component_term_bin, component, strlen(component));
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:364:0,
from /usr/include/stdio.h:27,
from /usr/local/include/libpostal/libpostal.h:8,
from src/parser.c:1:
/usr/include/x86_64-linux-gnu/bits/string3.h:123:1: note: expected �char * restrict� but argument is of type �unsigned char *�
__NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
^
src/parser.c: At top level:
src/parser.c:45:5: warning: missing initializer for field �flags� of �ErlNifFunc {aka struct enif_func_t}� [-Wmissing-field-initializers]
{"parse_address", 1, parse_address}};
^
In file included from src/parser.c:2:0:
/usr/local/lib/erlang/erts-9.0/include/erl_nif.h:104:14: note: �flags� declared here
unsigned flags;
^~~~~
In file included from src/parser.c:6:0:
src/helper.c:16:12: warning: �is_libpostal_language_classifier_setup� defined but not used [-Wunused-variable]
static int is_libpostal_language_classifier_setup = 0;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: Leaving directory '/home/olafura/dev/expostal'
make[1]: Entering directory '/home/olafura/dev/expostal'
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -I/usr/local/lib/erlang/erts-9.0/include -I/usr/local/include -I/usr/include -L/usr/local/lib -L/usr/lib -lpostal -std=gnu99 -Wno-unused-function -fPIC -shared -o priv/expand.so src/expand.c
src/expand.c: In function �expand_address�:
src/expand.c:23:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < num_expansions; i++)
^
src/expand.c:28:13: warning: pointer targets in passing argument 1 of �strncpy� differ in signedness [-Wpointer-sign]
strncpy(expansion_term_bin, expansion, strlen(expansion));
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:364:0,
from /usr/include/stdio.h:27,
from /usr/local/include/libpostal/libpostal.h:8,
from src/expand.c:1:
/usr/include/x86_64-linux-gnu/bits/string3.h:123:1: note: expected �char * restrict� but argument is of type �unsigned char *�
__NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
^
src/expand.c: At top level:
src/expand.c:40:3: warning: missing initializer for field �flags� of �ErlNifFunc {aka struct enif_func_t}� [-Wmissing-field-initializers]
{ "expand_address", 1, expand_address }
^
In file included from src/expand.c:2:0:
/usr/local/lib/erlang/erts-9.0/include/erl_nif.h:104:14: note: �flags� declared here
unsigned flags;
^~~~~
make[1]: Leaving directory '/home/olafura/dev/expostal'
Compiling 2 files (.ex)
Generated expostal app
17:30:05.198 [error] Process #PID<0.151.0> raised an exception
** (MatchError) no match of right hand side value: {:error, {:load_failed, 'Failed to load NIF library: \'/home/olafura/dev/expostal/_build/dev/lib/expostal/priv/parser.so: undefined symbol: libpostal_teardown_parser\''}}
lib/parser.ex:12: Expostal.Parser.init/0
(kernel) code_server.erl:1333: anonymous fn/1 in :code_server.handle_on_load/5
17:30:05.199 [error] Process #PID<0.152.0> raised an exception
** (MatchError) no match of right hand side value: {:error, {:load_failed, 'Failed to load NIF library: \'/home/olafura/dev/expostal/_build/dev/lib/expostal/priv/expand.so: undefined symbol: libpostal_expand_address\''}}
lib/expand.ex:12: Expostal.Expand.init/0
(kernel) code_server.erl:1333: anonymous fn/1 in :code_server.handle_on_load/5
17:30:05.200 [warn] The on_load function for module Elixir.Expostal.Parser returned:
{{:badmatch,
{:error,
{:load_failed,
'Failed to load NIF library: \'/home/olafura/dev/expostal/_build/dev/lib/expostal/priv/parser.so: undefined symbol: libpostal_teardown_parser\''}}},
[{Expostal.Parser, :init, 0, [file: 'lib/parser.ex', line: 12]},
{:code_server, :"-handle_on_load/5-fun-0-", 1,
[file: 'code_server.erl', line: 1333]}]}
17:30:05.201 [warn] The on_load function for module Elixir.Expostal.Expand returned:
{{:badmatch,
{:error,
{:load_failed,
'Failed to load NIF library: \'/home/olafura/dev/expostal/_build/dev/lib/expostal/priv/expand.so: undefined symbol: libpostal_expand_address\''}}},
[{Expostal.Expand, :init, 0, [file: 'lib/expand.ex', line: 12]},
{:code_server, :"-handle_on_load/5-fun-0-", 1,
[file: 'code_server.erl', line: 1333]}]}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.