def _expand(self, cs):
if cs in self._SIMPLE:
return self._SIMPLE[cs]
if cs in self._ACCENTS:
arg = self._scan_argument()
if len(arg) == 0:
seq, rest = ' ' + self._ACCENTS[cs], ''
elif arg.startswith('\\i') or arg.startswith('\\j'):
# Unicode combining marks should be applied to the
# regular i, not the dotless i.
seq, rest = arg[1] + self._ACCENTS[cs], arg[2:]
else:
seq, rest = arg[0] + self._ACCENTS[cs], arg[1:]
return unicodedata.normalize('NFC', seq) + rest
return None
评论列表
文章目录