Applies some simple heuristics to split names into (city, name).

def DemangleName(self, name):
    "Applies some simple heuristics to split names into (city, name)."

    # Handle special cases where our heuristcs doesn't work.
    # Example:"Triemli" --> ("Triemli", "Zurich").
    if name in SPECIAL_NAMES:
      return SPECIAL_NAMES[name]

    # Expand abbreviations.
    for abbrev, expanded in [('str.', 'strasse'),
                             ('Schiffst.', 'Schiffstation')]:
      suffix_pos = name.rfind(abbrev)
      if suffix_pos > 0:
        name = name[:suffix_pos] + expanded
    #end for

    names = name.split(", ", 1)
    if len(names) == 2:
      if names[1] in POI_TERMS:
        nam = u'%s %s' % (names[0], names[1])
      else:
        nam = names[1]
      city = names[0]
    else:
      # "Zurich Enge": First word of station name designates the city
      nam = names[0]
      city = nam.split(' ')[0]
    return (nam, SPECIAL_CITIES.get(city, city))