Page 1 of 1
Braille translator
Posted: Wed Apr 17, 2013 9:24 pm
by shubhamgoel145
i want to make a braille translator app, where a user types in english and braille is shown.
In braille each letter has a corresponding symbol, which i have images for stored on my hard drive.
I made a simple application where it would hide and show images according to what was typed into a text box, however this only worked for
single letter translation. How can i make an app that will translate a sentence or a word?
Please help
Re: Braille translator
Posted: Wed Apr 17, 2013 9:41 pm
by Simon
Interesting project.
Not sure how you are calling up your images and I would have to guess at what your problem really is.
Is it in placing the images?
Is it that the text was pasted into a field?
or is it something else?
Simon
Re: Braille translator
Posted: Wed Apr 17, 2013 9:45 pm
by dunbarx
Hi.
This sounds like a very interesting project.
But if you were able to display one image when the user types in a letter, why can't you string images together? In other words, you would lay out a virtual grid, and load images into that grid based on the text. This only requires that the images are the same size.
So if I typed in "Hello world", ten images would appear, side by side, spaced as you need. They could appear directly as the text appears. There would be some simple management for line breaks, I guess, and I am not sure how braille handles that, but it does not seem too difficult.
Write back if I am missing something important here...
Craig Newman
Re: Braille translator
Posted: Wed Apr 17, 2013 9:58 pm
by jmburnod
Hi
Good project
Using imagesource in a fld is an other way.
I see two flds. One in english that you can use for textToSpeech and one in Braille.
Do you have a Braille printer ?
Please write back if you need help.
Best regards
Jean-Marc
Re: Braille translator
Posted: Wed Apr 17, 2013 10:36 pm
by dunbarx
Jean Marc.
Great idea.
Craig
Re: Braille translator
Posted: Wed Apr 17, 2013 10:43 pm
by jmburnod
Thanks Craig,
I believe the Braille printers works with postscript file
What about it in LC (entries in the Dictionary are Linux only)
Re: Braille translator
Posted: Thu Apr 18, 2013 6:05 am
by jacque
That's how I'd do it, using a font. There's one here:
http://www.duxburysystems.com/product2. ... level=free
That might take all the fun out of coding it though.
Re: Braille translator
Posted: Thu Apr 18, 2013 2:12 pm
by shubhamgoel145
Simon wrote:Interesting project.
Not sure how you are calling up your images and I would have to guess at what your problem really is.
Is it in placing the images?
Is it that the text was pasted into a field?
or is it something else?
Simon
I was using 26 images overlaid, and hiding and showing them according to what
was typed into the field. I figured that with multiple Images it would take forever
to do this for every single character.
thank you for your help
Re: Braille translator
Posted: Thu Apr 18, 2013 2:16 pm
by shubhamgoel145
dunbarx wrote:Hi.
This sounds like a very interesting project.
But if you were able to display one image when the user types in a letter, why can't you string images together? In other words, you would lay out a virtual grid, and load images into that grid based on the text. This only requires that the images are the same size.
So if I typed in "Hello world", ten images would appear, side by side, spaced as you need. They could appear directly as the text appears. There would be some simple management for line breaks, I guess, and I am not sure how braille handles that, but it does not seem too difficult.
Write back if I am missing something important here...
Craig Newman
thank you for your suggestion, your idea seems to be perfect.
I made one image appear by;
loading in 26 images all on top of each other then showing and hiding
them according to what was typed into the field.
for example
if field 1 is "a" then show image "braille a.png"
if I had to create 26 images for each character that would take forever, and it
would limit to how many characters the user could translate.
how would I go about doing it your way, as yours seems more logical.
Re: Braille translator
Posted: Thu Apr 18, 2013 2:26 pm
by shubhamgoel145
jmburnod wrote:Hi
Good project
Using imagesource in a fld is an other way.
I see two flds. One in english that you can use for textToSpeech and one in Braille.
Do you have a Braille printer ?
Please write back if you need help.
Best regards
Jean-Marc
yes, I have access to a braille printer five times a week
could you please explain what you mean by image source in field??
thank you
Re: Braille translator
Posted: Thu Apr 18, 2013 3:31 pm
by jmburnod
Hi shubhamgoel145,
could you please explain what you mean by image source in field??
you can insert an image like a character in a fld
Code: Select all
set the imagesource of char 3 of fld "myField" to the short id of image "Img_a"
As Jacque said and that is probably the best way you can use a Braille font
Best regards
Jean-Marc
Re: Braille translator
Posted: Thu Apr 18, 2013 6:49 pm
by dunbarx
Hi.
The imageSource method notwithstanding, which is very easy to implement, there may be layout or other reasons to use an array of images.
But you do NOT want to store a million images. Store 26 only, name them, and hide them. When you need one, clone it into the appropriate grid location. So if the user types a "B", you would, likely in a keyDown handler, do something like:
Clone invisible ImageB --may not be needed if the master image is hidden. Not tested.
set the loc of the last image to theNextImageLoc --this is the next location in your array
show last image
You can do this easily. You will have to manage the use of the backSpace key, I would think, No? Can you handle that?
Craig Newman
Re: Braille translator
Posted: Thu Apr 18, 2013 9:21 pm
by jacque
I think my last choice would be an actual grid of objects, but if I had to do it, I'd use button icons rather than cloning every image multiple times. LiveCode 6 has some new optimizations for icon use and it's very efficient and fast. But using any type of object to represent text is a pretty big headache, with fields all the dirty work is taken care of automatically.
Re: Braille translator
Posted: Thu Apr 18, 2013 9:57 pm
by jmburnod
As Jacques said
with fields all the dirty work is taken care of automatically.
Yes but I'm afraid we have to make the dirty work for export and print. Using Braille font should be better for this part.