def endElement(self, name): if name == u"orth": self.__isOrth = False text = processToken(self.__orthText) self.__downstream.characters(text) if name == u"base": self.__isBase = False self.__downstream.endElement(name)
def endElement(self, name): if name == u"Unicode": self.__isUni = False loc = Locale.createFromName("utf-8") bi = BreakIterator.createWordInstance(loc) bi.setText(self.__uniText) tokens = [] prev = 0 while True: try: ind = bi.next() tokens.append(self.__uniText[prev:ind]) prev = ind except StopIteration: break text = u"" for t in tokens: text += processToken(t) self.__downstream.characters(text) self.__downstream.endElement(name)