Ugrás a tartalomhoz

Szerkesztő:BinBot/huwiki/util.py

A Wikipédiából, a szabad enciklopédiából

Expanation / Magyarázat

"""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)