(lang: str)
return char_weights
Get lang-specific character weights for use in certain data augmentation transforms,
    based on texts in :class:`textacy.datasets.UDHR`.

    Args:
        lang: Standard two-letter language code.

    Returns:
        Collection of (character, weight) pairs, based on the distribution of characters
        found in the source text.
Get lang-specific character weights for use in certain data augmentation transforms,
    based on texts in :class:`textacy.datasets.UDHR`.
Get lang - specific character weights for use in certain data augmentation transforms based on texts in : class : textacy . datasets . UDHR .
def get_char_weights(lang: str) -> List[Tuple[str, int]]:
    """
    Get lang-specific character weights for use in certain data augmentation transforms,
    based on texts in :class:`textacy.datasets.UDHR`.

    Args:
        lang: Standard two-letter language code.

    Returns:
        Collection of (character, weight) pairs, based on the distribution of characters
        found in the source text.
    """
    try:
        char_weights = list(
            collections.Counter(
                char for text in udhr.texts(lang=lang) for char in text if char.isalnum()
            ).items()
        )
    except ValueError:
        char_weights = list(
            zip(string.ascii_lowercase + string.digits, itertools.repeat(1))
        )
    return char_weights
def get_char_weights ( lang : str ) -> List [ Tuple [ str , int ] ] : try : char_weights = list ( collections . Counter ( char for text in udhr . texts ( lang = lang ) for char in text if char . isalnum ( ) ) . items ( ) ) except ValueError : char_weights = list ( zip ( string . ascii_lowercase + string . digits , itertools . repeat ( 1 ) ) ) return char_weights