Created
May 17, 2024 21:26
-
-
Save noahlt/c47a5b33e6251983bc8c8a0bbf89b248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// makeCharMap takes two strings and creates a mapping between characters at the | |
// same position, like Unix tr or Python string.translate. We don't worry about | |
// undefineds, since the caller of Map.get has to check for undefined anyways | |
// (for the case where they pass in an input char that's not in the map). | |
export const makeCharMap = (inChars: string, outChars: string) => | |
new Map(zip(inChars.split(""), outChars.split(""))); | |
export const dvorakKeyInputMap = makeCharMap(`p.,'ieoaujq;`, "ABCDEFGabcde"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment