Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Translation table (3 steps) solution in Clear category for English to Braille Translator by DiZ
def braille_page(txt, table=' C _ N, -.i j ?! s twa e c d kuozmxnyb h f g lvr p q'):
''' Convert a text in Braille given a translation table.'''
#Normalize text symbols
sanitized = ''.join('C'*c.isupper() + 'N'*c.isdigit() \
+ chr(ord(c) + 32*c.isupper() + 48*c.isdigit() + 10*(c=='0')) for c in txt)
#Transcrypt in Braille inline
binary = ''.join(bin(table.index(c) + 64 << 3)[3:] for c in sanitized) \
+ '0'*9*(len(sanitized) > 10 and -len(sanitized) % 10)
#Format output in 10-character chunks
formatted = ['0'.join(binary[m:m+3] for m in range(n*3, len(binary), 90)) \
for n in range(3 * min(10, len(sanitized)) - 1)]
return [list(map(int, l)) for l in zip(*formatted)]
Jan. 12, 2015