-
-
Save hitherejoe/4adf3f06904b9c6404f08443e3024a22 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
public List<String> mapFromWords(String... words) { | |
List<String> braille = new ArrayList<>(); | |
for (int i = 0; i < words.length; i++) { | |
braille.addAll(mapFromString(words[i])); | |
if (i < words.length - 1) braille.add(Braille.SPACE.getValue()); | |
} | |
return braille; | |
} | |
public List<String> mapFromString(String text) { | |
List<String> braille = new ArrayList<>(); | |
for (int i = 0; i < text.length(); i++) { | |
braille.add(Braille.fromKey( | |
Character.toLowerCase(text.charAt(i))).getValue()); | |
} | |
return braille; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment