from string import ascii_uppercaseAlphabet
With Greek letters typed in LaTeX, I sometimes need to interpret them like their English equivalents, e.g. \alpha is like A, etc.
alphabet_or_latex_command_to_alphabet_group
alphabet_or_latex_command_to_alphabet_group (character)
alphabet_or_latex_command_to_alphabet
alphabet_or_latex_command_to_alphabet (character)
Returns the alphabet that the character “corresponds to”.
alphabet_to_alphabet_group
alphabet_to_alphabet_group (character)
*Returns the alphabet group
In my vaults, I often alphabetize things and also group the alphabet as follows: - A-E - F-J - K-O - P-T - U-V
Parameters - character - str
Returns - str or None - Returns None if character is not an alphabet.*
dicty = {}
for c in ascii_uppercase:
dicty[c] = alphabet_to_alphabet_group(c)
print(dicty){'A': 'A-E', 'B': 'A-E', 'C': 'A-E', 'D': 'A-E', 'E': 'A-E', 'F': 'F-J', 'G': 'F-J', 'H': 'F-J', 'I': 'F-J', 'J': 'F-J', 'K': 'K-O', 'L': 'K-O', 'M': 'K-O', 'N': 'K-O', 'O': 'K-O', 'P': 'P-T', 'Q': 'P-T', 'R': 'P-T', 'S': 'P-T', 'T': 'P-T', 'U': 'U-Z', 'V': 'U-Z', 'W': 'U-Z', 'X': 'U-Z', 'Y': 'U-Z', 'Z': 'U-Z'}