Szerkesztő:BinBot/huwiki/util.py
"""Utility functions for Hungarian Wikipedia."""
#
# (C) Bináris, 2023
#
# Distributed under the terms of the MIT license.
def undiacrat(text: str) -> str:
"""Remove diacratical marks from text.
Useful e.g. for DEFAULTSORT checks.
"""
table = text.maketrans(
'áéíóöőúüűÁÉÍÓÖŐÚÜŰ',
'aeiooouuuAEIOOOUUU')
return text.translate(table)