def strip_accents_and_punct(text):
  """Strips accents from a piece of text."""
  text = unicodedata.normalize("NFD", text)
  output = []
  for char in text:
    if char in PUNCTUATION:
      continue
    cat = unicodedata.category(char)
    if cat == "Mn":
      continue
    output.append(char)
  return "".join(output)
Strips accents from a piece of text.
language/labs/drkit/evaluate.py