java Java邮政地址解析器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/877742/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 14:12:01  来源:igfitidea点击:

Java postal address parser

javaparsingstreet-address

提问by Yishai

Somewhat related to this question, but in the absence of any answer about QuickBooks specifically, does anyone know of an address parser for Java? Something that can take unstructured address information and parse out the address line 1, 2 and city state postal code and country?

此问题有些相关,但在没有任何关于 QuickBooks 的具体答案的情况下,有人知道 Java 的地址解析器吗?可以获取非结构化地址信息并解析地址行 1、2 以及城市州邮政编码和国家/地区的东西?

回答by John Gietzen

I do know that the Google Maps web service is greatat doing this. So, if you want to use that, you could save a lot of effort.

我知道 Google Maps 网络服务非常擅长这样做。所以,如果你想使用它,你可以节省很多精力。

The real issue here is that you need a worldwide database of city/country/province names to effectively parse UNSTRUCTURED addresses.

这里真正的问题是您需要一个城市/国家/省名称的全球数据库来有效解析非结构化地址。

Here is how I build a URL for use by the Google Maps API in C#:

以下是我在 C# 中构建供 Google Maps API 使用的 URL 的方法:

string url = "http://maps.google.com/maps/geo?key=" + HttpUtility.UrlEncode(this.apiKey) + "&sensor=false&output=xml&oe=utf8&q=" + HttpUtility.UrlEncode(location);

回答by Guy Lancaster

The SourceForge JGeocoder has an address parser that you may find useful. See http://jgeocoder.sourceforge.net/parser.html.

SourceForge JGeocoder 有一个地址解析器,您可能会发现它很有用。请参阅http://jgeocoder.sourceforge.net/parser.html

回答by Matt G

Might want to read this Stack Overflow question: "Parse usable Street Address, City, State, Zip from a string". No actual Java code to do the job (just some VB), but there is some discussion of the problem and more info on the alternative John Gietzen mentions, of using a web service to interpret it for you.

可能想阅读这个 Stack Overflow 问题:“从字符串解析可用的街道地址、城市、州、邮编”。没有实际的 Java 代码来完成这项工作(只是一些 VB),但是有一些关于这个问题的讨论,以及关于 John Gietzen 提到的替代方案的更多信息,即使用 Web 服务为您解释它。

回答by Dave

The Mural project has an address parser: https://mural.dev.java.net/. I haven't figured out how to exract it from the larger Mural engine, but it does work based on some very limited tests.

Mural 项目有一个地址解析器:https: //mural.dev.java.net/。我还没有想出如何从更大的 Mural 引擎中提取它,但它确实基于一些非常有限的测试工作。

回答by We Know

See www.address-parser.com, they offer a web service for parsing international addresses.

参见www.address-parser.com,他们提供解析国际地址的网络服务。