mordecai
mordecai copied to clipboard
parsing problems
geo.geoparse("Long Beach, CA To: Fresno, CA FTL non-hazmat") returns
[{'word': 'Long Beach',
'spans': [{'start': 0, 'end': 10}],
'country_predicted': 'AUS',
'country_conf': 0.9048774,
'geo': {'admin1': 'New South Wales',
'lat': '-35.70833',
'lon': '150.24483',
'country_code3': 'AUS',
'geonameid': '8219798',
'place_name': 'Long Beach',
'feature_class': 'P',
'feature_code': 'PPL'}}]
So lib ignores Fresno, CA . But if I change the string to Long Beach, CA To: Fresno, CA it will parse Fresno, CA as it should be
[{'word': 'Long Beach',
'spans': [{'start': 0, 'end': 10}],
'country_predicted': 'AUS',
'country_conf': 0.9048774,
'geo': {'admin1': 'New South Wales',
'lat': '-35.70833',
'lon': '150.24483',
'country_code3': 'AUS',
'geonameid': '8219798',
'place_name': 'Long Beach',
'feature_class': 'P',
'feature_code': 'PPL'}},
{'word': 'Fresno',
'spans': [{'start': 19, 'end': 25}],
'country_predicted': 'USA',
'country_conf': 0.96374094,
'geo': {'admin1': 'California',
'lat': '36.75818',
'lon': '-119.64932',
'country_code3': 'USA',
'geonameid': '5350964',
'place_name': 'Fresno County',
'feature_class': 'A',
'feature_code': 'ADM2'}}]
Also it parses Long Beach, CA as Long Beach, Australia despite CA state is present in string and it should be USA, not Australia. Could anyone help me with this one pls?