0

So,for example when you search in google or google maps for Zurich it gets correct German name from Zurich (Zürich).

So if someone type Zurich who can I know that is Zürich? I can do that manually by getting all Switzerland cities and type them in English and then do some regex on that, but Internet is big, I was hoping there is some lib already for that.

pregmatch
  • 2,629
  • 6
  • 31
  • 68
  • http://opendata.stackexchange.com/questions/1921/where-can-i-find-all-cities-regions-and-cantons-of-switzerland – mplungjan Jun 20 '16 at 16:53
  • @mplungjan i already have that. All cities etc. – pregmatch Jun 20 '16 at 16:55
  • [help]: _Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it._ – mplungjan Jun 20 '16 at 16:57
  • 1
    @pregmatch this question will get down-voted and closed because this problem is not about programming. It's about a list of endonyms. You happen to be asking if someone has programatically represented the list, but that doesn't count here. – Mark Bolusmjak Jun 20 '16 at 16:58
  • 2
    Here's the database http://www.geonames.org and an example http://www.geonames.org/search.html?q=zurigo&country=CH – fregante Jun 20 '16 at 17:00

1 Answers1

0

I'm not sure I fully understand your question, but is this what you're looking for? You can run all the German names through the function provided there to remove all the accents, and then you can compare everything with only the English names.

Community
  • 1
  • 1
master565
  • 805
  • 1
  • 11
  • 27
  • well, that is near. I was hoping for some lib so I do not have to think about if I forgot some character. – pregmatch Jun 20 '16 at 16:56
  • Note sure. Maybe you can find a list if you google German character set, but I would just try this for now, and add missing characters as they appear. – master565 Jun 20 '16 at 16:58
  • Removing diacritics is not how translation works. There's no Munchen in English, for example. – Bergi Jun 20 '16 at 17:19
  • 1
    I understood his question as asking how to make sure that if someone misses German characters while typing out names (because they're using an English keyboard), he wants to make sure that he can still identify the words. If he is looking for a translation, then he needs to find an appropriate dictionary. – master565 Jun 20 '16 at 17:21