mediacloud / cliff-api-client

A Python client for the CLIFF geoparsing tool
MIT License
5 stars 5 forks source link

Minor improvements #1

Closed maedoc closed 7 years ago

maedoc commented 7 years ago

We're using Cliff for geoparsing in a Python 3 application and encountered a few difficulties addressed in this PR

If you'd prefer to see these as separate PRs, can do so.

rahulbot commented 7 years ago

Thanks - the logging fix looks good. I've got a separate fix for the markdown formatting that I have yet to put in place... you are a good reminder for me to do that.

Regarding the placename replacement I'm a little more dubious. We have a bunch of that type of handling on the CLIFF side of things (in Java). On this side I think it would make more sense to be able to initialize the client with set of custom substitutions. Perhaps something like this:

my_substitutions = [
    ('Washington, DC', 'Washington DC'),
     ('Washington, D.C.', 'Washington DC'),
]
my_cliff = Cliff('http://myserver.com', 8080, my_substitutions)

What do you think about that as an API for supporting the need you've highlighted?

rahulbot commented 7 years ago

I went ahead and implemented my proposal and released a new version.