def open_text(filename):
    file = open(filename)
    content = file.read()
    print(alphaToBraille.translate(content))
    with open(filename.replace('.txt','')  + '_converted_to_braille.txt', 'w') as converted_file:
        converted_file.write(alphaToBraille.translate(content))
        converted_file.close()
def convertFile():
    f = open('InputOutput.txt', 'r')
    content = f.read()
    f.close()
    content = a.translate(content)
    f = open('Output.txt', 'w', encoding='UTF8')
    f.write(content)
    f.close()
Esempio n. 3
0
def open_text(filename):
    file = open(filename)
    content = file.read()
    print(alphaToBraille.translate(content))
Esempio n. 4
0
def user_text():
    print("Input Text: ", end="")
    print(alphaToBraille.translate(input()))
def text_braille(inp):
    return alphaToBraille.translate(inp)
Esempio n. 6
0
               [[0, 0], [1, 1], [0, 1]], [[0, 0], [1, 0], [0, 1]],
               [[0, 0], [1, 1], [1, 0]], [[0, 0], [1, 1], [1, 1]],
               [[0, 0], [1, 0], [1, 1]], [[0, 0], [0, 1], [1, 0]],
               [[1, 0], [0, 1], [0, 1]], [[0, 0], [0, 1], [0, 1]],
               [[1, 0], [1, 0], [0, 1]], [[1, 1], [1, 1], [1, 1]],
               [[0, 1], [0, 1], [1, 0]], [[1, 1], [0, 1], [0, 1]],
               [[0, 1], [0, 0], [0, 0]], [[1, 0], [0, 0], [0, 0]],
               [[1, 0], [1, 0], [0, 0]], [[1, 1], [0, 0], [0, 0]],
               [[1, 1], [0, 1], [0, 0]], [[1, 0], [0, 1], [0, 0]],
               [[1, 1], [1, 0], [0, 0]], [[1, 1], [1, 1], [0, 0]],
               [[1, 0], [1, 1], [0, 0]], [[0, 1], [1, 0], [0, 0]],
               [[0, 1], [1, 1], [0, 0]], [[1, 0], [0, 0], [1, 0]],
               [[1, 0], [1, 0], [1, 0]], [[1, 1], [0, 0], [1, 0]],
               [[1, 1], [0, 1], [1, 0]], [[1, 0], [0, 1], [1, 0]],
               [[1, 1], [1, 0], [1, 0]], [[1, 1], [1, 1], [1, 0]],
               [[1, 0], [1, 1], [1, 0]], [[0, 1], [1, 0], [1, 0]],
               [[0, 1], [1, 1], [1, 0]], [[1, 0], [0, 0], [1, 1]],
               [[1, 0], [1, 0], [1, 1]], [[0, 1], [1, 1], [0, 1]],
               [[1, 1], [0, 0], [1, 1]], [[1, 1], [0, 1], [1, 1]],
               [[1, 0], [0, 1], [1, 1]], [[0, 1], [1, 0], [0, 1]],
               [[1, 0], [1, 1], [0, 1]], [[1, 1], [1, 1], [0, 1]],
               [[0, 1], [0, 1], [0, 0]], [[0, 1], [0, 1], [0, 1]]]

a = alphaToBraille.translate("Hello how are you")

braille2dot = {}
for i in range(len(brailles)):
    braille2dot[brailles[i]] = matrixcodes[i]

print(braille2dot['⠺'])
Esempio n. 7
0
pic=cv2.imread("/home/madhan/EE04_Tess/pic54.png")
croppic1= per.pertransform1(pic)
croppic2= per.pertransform2(pic)
text1= pyt.image_to_string(croppic1)
#print(text1)

text2= pyt.image_to_string(croppic2)
#print(text2)
al= list(range(48,58))
bl= list(range(65,91))
cl= list(range(97,123))
dl=al+bl+cl
il=0
jl=0
for ip in text1:
	if ord(ip) in dl:
		il=il+1
for jp in text2:
	if ord(jp) in dl:
		jl=jl+1
if jl>il:
	text=text2
else:
	text=text1
print(jl)
print(il)
#print(text)
string=alp.translate(text)
biv.binarycontent(string)
Esempio n. 8
0
def open_text(filename):
    content = filename
    file = open('out', 'w')
    file.write(alphaToBraille.translate(content))
Esempio n. 9
0
l1 = 10
l2 = 30
l3 = 60

chars = 10
rows = 3
cols = 2

scanDelay = 0.1

braille2matrix = {}
for i in range(len(brailles)):
    braille2matrix[brailles[i]] = matrixcodes[i]

textEng = "1 2 3 Hello How are you"
textbraille = alphaToBraille.translate(textEng)

textBraille = "          "
#print(len(textEng))
#print(len(textbraille))
textBraille = textbraille[:min(len(textbraille), chars)]
textEng = brailleToAlpha.translate(textBraille)
print(textBraille)
print(textEng)

widthWin = 700
heightWin = 140
win = GraphWin("eBraille Display", widthWin, heightWin)
win.setBackground("white")
textMessage = Text(Point(widthWin / 2, l1), textEng)
textMessage.setTextColor("black")