Even better, you can start with the Braille text file available on this page:
https://www.lds.org/topics/disability/m ... e?lang=spa
1) Fix the accents.
Replace "(" with "Á"
Replace "!'" with "É"
Replace "/" with "Í"
Replace "+" with "Ó"
Replace ")" with "Ú"
Replace "\" with "Ü"
Replace "]" with "Ñ"
2) Convert everything to lowercase.
3) Convert letters with periods in front of them to capital letters.
Replace ".a" with "A"
Replace ".b" with "B"
Replace ".c" with "C"
etc. Don't forget the accented letters!
Replace "." with "" (clean up double periods)
4) Fix the punctuation.
Replace "'" with "."
Replace "1" with ";"
Replace "2" with ","
Replace "3" with ":"
Replace " 5'" with "¿"
Replace "5'" with "?"
Replace " 6'" with "¡"
Replace "6'" with "!"
Replace "8'" with """
Replace "9 " with ""
Replace "--" with "—"
Replace "<" with "("
Replace ">" with ")"
5) Fix the numbers.
I'm not sure the most efficient way to do this, because numbers have multiple digits, but here's a start:
Replace "#a" with "1"
Replace "#b" with "2"
Replace "#c" with "3"
Replace "#d" with "4"
Replace "#e" with "5"
Replace "#f" with "6"
Replace "#g" with "7"
Replace "#h" with "8"
Replace "#i" with "9"
Replace "#j" with "0"
Replace "1a" with "11"
Replace "1b" with "12"
Replace "1c" with "13"
etc.