pnordahl / rust-postal Goto Github PK
View Code? Open in Web Editor NEWRust FFI bindings and safe interface to libpostal.
License: MIT License
Rust FFI bindings and safe interface to libpostal.
License: MIT License
Do you think it would be easy to do a c2nim wrapping (similar to bindgen) and expose libpostal to Nim?
Hi, I'm trying to use this in a async_graphql context, however I can't use expand_address at all because it expects all structs to implement Send:
future cannot be sent between threads safely
within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `*mut *mut i8`
I was able to share the postal context using an Arc<Mutex<>>, but it's not possibleto do the same for the options. Could you have a look at it?
When using the expand_address
binding I am unable to pass more than one language code to the ExpandAddressOptions
. I can pass a slice with only one language in it, but as soon as I pass a second value I get a segfault.
See example code here, which yields the following results:
Testing:
Address: "Foo Str"
Language(s): ["en"]
Results: ["foo street", "foo strata unit"]
Testing:
Address: "Foo Str"
Language(s): ["de"]
Results: ["foo strasse"]
Testing:
Address: "Foo Str"
Language(s): ["de", "en"]
[1] 20143 segmentation fault cargo run
Expected result (using PyPostal):
In [1]: from postal.expand import expand_address
In [2]: expand_address("Foo Str", languages=["en"])
Out[2]: ['foo street', 'foo strata unit']
In [3]: expand_address("Foo Str", languages=["de"])
Out[3]: ['foo strasse']
In [4]: expand_address("Foo Str", languages=["de", "en"])
Out[4]: ['foo strasse', 'foo street', 'foo strata unit']
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.