sunlightlabs / name-cleaver

Parser and standardizer for politician, individual and organization names.
GNU General Public License v3.0
128 stars 22 forks source link

IndividualNameCleaver fails to parse preceding degree #4

Open kentr opened 11 years ago

kentr commented 11 years ago

Edited:

Looks it fails on the preceding degree "M.D.," .

Output:

parsed = IndividualNameCleaver("M.D., ARCH PEQUET").parse() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/name_cleaver/cleaver.py", line 51, in parse return self.cannot_parse(safe) File "/usr/local/lib/python2.7/dist-packages/name_cleaver/cleaver.py", line 17, in cannot_parse raise UnparseableNameException(u"Couldn't parse name: {0}".format(self.name)) UnparseableNameException: Couldn't parse name: ARCH PEQUET

I'm not sure what version I'm using. Recently installed via pip on Ubuntu 12.04.

arowla commented 11 years ago

Thanks for the bug report. We'll consider supporting this format in future versions of NameCleaver. In the meantime, you could pursue one of two solutions:

  1. Fix the problem and submit us a pull request (including a passing test!)
  2. Pre-process the name before you pass it in to NameCleaver, to place the degree at the end, if you can reasonably expect that you'll encounter this format often.