Braille translator

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
shubhamgoel145
Posts: 4
Joined: Wed Apr 17, 2013 9:18 pm

Braille translator

Post by shubhamgoel145 » Wed Apr 17, 2013 9:24 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Braille translator

Post by Simon » Wed Apr 17, 2013 9:41 pm

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 used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Braille translator

Post by dunbarx » Wed Apr 17, 2013 9:45 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Braille translator

Post by jmburnod » Wed Apr 17, 2013 9:58 pm

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
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Braille translator

Post by dunbarx » Wed Apr 17, 2013 10:36 pm

Jean Marc.

Great idea.

Craig

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Braille translator

Post by jmburnod » Wed Apr 17, 2013 10:43 pm

Thanks Craig,
I believe the Braille printers works with postscript file
What about it in LC (entries in the Dictionary are Linux only)
https://alternatic.ch

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Braille translator

Post by jacque » Thu Apr 18, 2013 6:05 am

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

shubhamgoel145
Posts: 4
Joined: Wed Apr 17, 2013 9:18 pm

Re: Braille translator

Post by shubhamgoel145 » Thu Apr 18, 2013 2:12 pm

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

shubhamgoel145
Posts: 4
Joined: Wed Apr 17, 2013 9:18 pm

Re: Braille translator

Post by shubhamgoel145 » Thu Apr 18, 2013 2:16 pm

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.

shubhamgoel145
Posts: 4
Joined: Wed Apr 17, 2013 9:18 pm

Re: Braille translator

Post by shubhamgoel145 » Thu Apr 18, 2013 2:26 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Braille translator

Post by jmburnod » Thu Apr 18, 2013 3:31 pm

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
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Braille translator

Post by dunbarx » Thu Apr 18, 2013 6:49 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Braille translator

Post by jacque » Thu Apr 18, 2013 9:21 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Braille translator

Post by jmburnod » Thu Apr 18, 2013 9:57 pm

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.
https://alternatic.ch

Post Reply