3
4

1 回答 1

1

作为 geograpy3 的提交者来重现您的问题,我向最新的 geograpy3 https://github.com/somnathrakshit/geograpy3/blob/master/tests/test_extractor.py添加了一个测试:

    def testStackoverflow55548116(self):
        '''
        see https://stackoverflow.com/questions/55548116/geograpy3-library-is-not-working-properly-and-give-traceback-error
        '''
        feedContent=['Las Vegas is a city in Nevada']
        placesInFeed=[]
        
        for content in feedContent:
            if content != "":
                e=Extractor(text=content)
                e.find_entities()
                places = e.places
                if self.debug:
                    print(places)
                placesInFeed.append(places)  

结果可能不是你所期望的:

['Las', 'Vegas', 'Nevada']

但是测试没有显示任何错误,所以请提供有错误的 feedContent - 您可能想要分叉项目并修改测试并为您的问题添加拉取请求。

于 2020-09-09T09:56:04.917 回答