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()
예제 #2
0
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()
예제 #3
0
def open_text(filename):
    file = open(filename)
    content = file.read()
    print(alphaToBraille.translate(content))
예제 #4
0
def user_text():
    print("Input Text: ", end="")
    print(alphaToBraille.translate(input()))
예제 #5
0
def text_braille(inp):
    return alphaToBraille.translate(inp)
예제 #6
0
파일: test.py 프로젝트: prasobhkp/ebraille
               [[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['⠺'])
예제 #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)
예제 #8
0
def open_text(filename):
    content = filename
    file = open('out', 'w')
    file.write(alphaToBraille.translate(content))
예제 #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")