1

I tried running the example code as given in the readme file for geograpy3. However, I am getting answers like this. What can be done about it?

enter image description here

Somnath Rakshit
  • 555
  • 1
  • 6
  • 17

1 Answers1

1

Your question raises a similar issue as https://github.com/somnathrakshit/geograpy3/issues/3

There is now a get_geoPlace_context function that will limit the search to the GPE label of NLTK thus ignoring PERSON and ORGANIZATION entries as the orginal function get_place_context would do:

see also test_extractor.py

 def testGetGeoPlace(self):
    '''
    test geo place handling
    '''
    url='http://www.bbc.com/news/world-europe-26919928'
    places=geograpy.get_geoPlace_context(url=url)
    if self.debug:
        print(places)
    self.assertEqual(['Moscow', 'Donetsk', 'Brussels', 'Kharkiv', 'Russia'],places.cities)
Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186