问题描述
是否有任何开源/商业库可以检测文本中的邮件地址,就像Apple的Mail应用程序如何在Mac/iPhone上强调地址一样.
Are there any open source/commercial libraries out there that can detect mailing addresses in text, just like how Apple's Mail app underlines addresses on the Mac/iPhone.
我一直在进行一些在线研究,其想法似乎要么是使用Google,Regex,要么是像Stanford的NLP这样的完整的NLP软件包,这些软件包通常非常庞大.我怀疑iPhone上是否有500MB的NLP软件包,或者在您每次阅读电子邮件时都连接到Google.这使我相信应该有一种更简单的方法.糟糕的UIDataDetectors不是开源的.
I've been doing a little online research and the ideas seem to be either to use Google, Regex or a full on NLP package such as Stanford's NLP, which usually are pretty massive. I doubt iPhone has a 500MB NLP package in there, or connects to Google every time you read an email. Which makes me to believe there should be an easier way. Too bad UIDataDetectors is not open source.
我知道之前曾有人问过这个问题,但是没有确凿的答案,所以这是我的尝试.
I know this question has been asked before, but there were no conclusive answers, so here's my try.
推荐答案
对于Python,您可以尝试Pyap: https://pypi.python.org/pypi/pyap
As for Python you can try Pyap:https://pypi.python.org/pypi/pyap
它目前支持美国和加拿大的地址
It currently supports US and Canadian addresses
这篇关于检测/解析文本中的邮寄地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!