views:

13

answers:

1

I want to recognize and extract a location that's built into a sentence. For example I might have a sentence:

"I love the pizza in Boston, Ma." but this same sentence could also be written as "Pizza in Boston, I love it." OR "I love the pizza in Boston."

So I have to be able to find it anywhere in the sentence and also if the state is not included. To makes things even more complicated people do things like ft. or s. for fort or south so I need a way to recognize these as well.

A: 

How about parse each word in the sentence and check against a "location" dictionary? After a hit, secondary tests could include the word before/after to complement the location with a corresponding city (word before) or state (word after).

This will get tricky for things like "The best Buffalo Wings in Kansas City"; When you find multiple locations in a single statement, you could use a seperate "dual-use" dictionary to eliminate words like "Buffalo". You could also search for prepositions like "in", "near", "at", etc. to identify the real location.

Jess
We do that now but it's hard for 3,4,5 and 6 word cities(and slow).The prepositions is an interesting idea, I'll have to check how often those are included.
Ryan Detzel