geotext icon indicating copy to clipboard operation
geotext copied to clipboard

3 words cities

Open gabrielmtrj opened this issue 7 years ago • 1 comments

When i try to recognize some cities with more then two words the city is not recognized.

Examples: Rio de Janeiro, Mar del Plata, Rio das Ostras.

gabrielmtrj avatar Jun 13 '18 17:06 gabrielmtrj

Modify the regex statement in geotext.py as you see fit and to your needs:

in your example you could use: [A-ZÀ-Ú]+[a-zà-ú]+\s*(de|del|das)+[ -]?(?:[a-u].)?(?:[A-ZÀ-Ú]+[a-zà-ú]+)*

example

You can even lookup cities with multiple regex statements, put the resulting matches into a list and concatenate the results into a single list. A universal solution would be great but considering the different problems in different languages, this seems a fair amount of work.

iwpnd avatar Jun 26 '18 07:06 iwpnd