Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 9:46 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Simple bilingual dictionary
PostPosted: May 4th, 2012, 5:06 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
I been scanning the forum for ideas to help me, and although I've picked up some ideas such as scroll to text, database etc I'm not sure what method would be best suited for my needs.

I will have a list of words in English and the translation of the words in another language - most will be single words with a few short phrases - there won't be any defintions of the words. These words can be embedded in the publication - no need to import from an external file. They will not be amended or added to.

The user should be able to choose to search for the word in English or the second language and then be presented with the word in both languages. I guess I could first offer which language to search > then click on a letter from a listed alphabet to show words beginning with that letter. I don't think I will use a search box for the user to type the whole word to search as they may misspell the word and end up with no results - although showing matching words as they add each letter might be an option, but probably too comlpex for me to do. I wouldn't want other words in the list to appear in the window when a result has been found (such as the word before or after in the list) just the English word and its translation.

I would welcome ideas from others if something similar has been attempted by someone else before, bearing in mind that my scripting skills are limited.

I'm posting this in the advanced section anticipating that any solutions will not be that simple!!

Thanks in anticipation

dpj


Top
 Profile  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 7th, 2012, 4:27 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
DPJ,
That sounds like an interesting little project. The first thing that occurs to me is "how many words are we talking about?"
While you say the word-list will not require maintenance/updating, I think choosing an approach and solution would benefit from some scoping. There are many, many ( πολλές, πολλές ) ways to do this -- some more optimum and elegant than others. It also makes a difference if you need the second language to be displayed in special character sets.

Also, depending on your purpose and the sophistication of your users/audience, you may need to consider including additional attributes for the words. For example, distingushing word used as a noun vs. a verb. e.g., 'shake', nail, ...
-- A -- B --
nail;clouer
nail;fixer
nail;clou
nail;ongle

Quote:
The user should be able to choose to search for the word in English or the second language and then be presented with the word in both languages.
This part is actually the easy part.

But first you must decide how you are going to type-in, or enter, the list. I would suggest entering these as word-pairs separated by a unique character or pair of characters, as hinted above.


If you DO NOT have duplicate occurances of a word, and you can manage a little Opusscripting, with forum help, then you can do a lot with that simple start.
Step one: set up a script to read the word-list when the Pub starts up, and put the 'A' words into ListBox_A, and the 'B' words into ListBox_B. The User at this point does not see these objects, which can be off-of-the-Page outside of view... and the Page can be a Master Page, so that list is available to all other Pages you choose. I will post an outline of this in the next following post.

Quote:
I guess I could first offer which language to search > then click on a letter from a listed alphabet to show words beginning with that letter. I don't think I will use a search box for the user to type the whole word to search as they may misspell the word and end up with no results - although showing matching words as they add each letter might be an option, but probably too comlpex for me to do.
Not too 'complex' to show words matching a partial string entry, but it might defeat your other constraint of not previewing other words from the list.

Step two: create a Button object and make it a "Push Button" (on/off toggle) -- to SELECT INPUT LANGUAGE. *We may need to tie this object to a variable, but let's try without that for now. Edit the properties of the Button State. e.g. 'Normal' make the Text Label 'English', and 'Down' make the Text Label 'French'

Step three: create a Text Input object, and assign a Page Variable to it. I'll call the var 'searchtext_1' for now.

Steps 4 and 5: I'll let you see if you can start this by yourself using Standard Actions.
-- basically you want to find text in object. (so the text is the value of searchtext_1, and the object is ListBox_A)
-- you'll have to play with what that returns, but I think it will only return one line from the LB
-- you'll want to display the contents or word in a simple Text Obj... easiest if that object is set-up to display a variable e.g., named 'showword'
-- when you can guide the User to get a valid word (your choice of prompts or directions)
then have him click a Button to display the PAIR of words. Hint: use the Index value of ListBox_A to get to its counterpart in ListBox_B

Once you get that far, it is a simple matter of setting up Standard Actions IF or SELECT to branch based on that Select-Language Button. As you can imagine, LB_B to LB_A is just a variation of going from LB_A to LB_B.

You can easily accumulate the word-pairs the User has viewed, and display them in a text object to scroll through and review (even on another Page, or pop-up Chapter Page).

If this helps, just check-in again when you want help. Meanwhile I'm sure you'll gather some other solutions to consider.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 7th, 2012, 4:40 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Continued... to add some Script suggestions.
Quote:
If you DO NOT have duplicate occurances of a word, and you can manage a little Opusscripting, with forum help, then you can do a lot with that simple start.
Step one: set up a script to read the word-list when the Pub starts up, and put the 'A' words into ListBox_A, and the 'B' words into ListBox_B. The User at this point does not see these objects, which can be off-of-the-Page outside of view... and the Page can be a Master Page, so that list is available to all other Pages you choose.

Here is a script to perform that initial loading. It would be 'more efficient' to just have this run once only on some initial page -- but I chose instead to stay with simplistic approach. The page with the script and objects has been made a Master Page, thus available data for subsequent pages.
:arrow: Sample PUB attached.

Code:
//script to read-in a list of word-pairs from one text object, and load these separately into two listbox objects.
//word-pairs are expected in the form of:    wordA1;wordB1  and then on a new line:  wordA2;wordB2  and so on. So, the delimiter is ";".

var myDelim = ";" ;
var countlines1 = MasterList01.GetLineCount() ;
var myfirstchar = 0 ;
var mylastchar = 0 ;
var listA = "" ;
var listB = "" ;
var listAB = "" ;
var newline1 = "" ;

for (var i=0; i < countlines1 ; i++)
{
   if(i<countlines1 -1)
   {
   newline1 = "\n";
   }

myfirstchar = MasterList01.LineIndex(i) ;
mylastchar = myfirstchar + MasterList01.LineLength(i) -1;   //need the -1 since we are using a zero-based index
MasterList01.SetSelection(myfirstchar, mylastchar)

listAB = MasterList01.GetSelectionText().split(";") ;

listA += listAB[0] +newline1;
listB += listAB[1] +newline1;
}
//end for loop

ListBox_A.SetSelection(0,-1)
ListBox_A.ReplaceSelection(listA)

ListBox_B.SetSelection(0,-1)
ListBox_B.ReplaceSelection(listB)
//END of script to load the Listboxes


So once you have this set-up, you can either make your objects hidden to the Pub's User... or you can simply drag them off-page out of the viewing area (which is my preference).

As in the previous post, you can work with these lists in many ways: find word or partial-word in one list and display the corresponding word from the other list.


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 8th, 2012, 8:57 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Thanks Lar_123 for the time you've spent in guiding me through this and including a demo publication.. The cross-reference look-up looks as if it will do the trick.
I will need to spend some time on this to see how I can make use of what you've suggested. I may need further assistance later from the forum as my scripting skills are minimal.

My main activity for my publication are drag and drop activities to label an image with the second language text. I have 26 separate screens (in separate chapters) with each activity having 20-30 words to label. The idea that I had for the dictionary is initially a small icon which the user can click on to open to a larger window if they need the help. I suppose I could create a separate dictionary for each of the 26 activities with only the words from the indivdual drag and drop activity or I could create a larger dictionary that contained all the words needed for any of the 26 activities. I can now see that the look-up list is the way to go for the actual words. I will need to ponder over how the user will search for the word - I don't want them scrolling through the whole list.

Thanks again Lar_123 for your help. When I have time to work on this no doubt I'll be beack on the forum seeking more help!!

dpj


Top
 Profile  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 9th, 2012, 3:18 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
D,

It sounds like an interesting project. I do not quite understand something being dragged/dropped... what that looks like, but I don't need to comprehend it to help here. I guess it just resonated a bit and spurred some curiosity. Early-on I played with ways to overlay hotspots on an image to make it iteractive (for various uses such as a map, or an illustration having expanded info...). I also tried to design an interface to match pairs from two columns (drag an icon and when dropped it draws the line between the pair). Generating the line worked fine, but I had difficulty detecting the landing-zone and thus able to do "scoring".

Quote:
I suppose I could create a separate dictionary for each of the 26 activities with only the words from the indivdual drag and drop activity
That approach may be easy, if we can get some other help applied to this. I am interpreting this as individual words on refrigerator magnets. The "easy part" I am referring to is to create the master list (one of the 26) in a Text object or a Listbox object. Let's say its 14 words. Then you can have Opus Pub populate 14 Text objects, each having one word.

Then it is just a matter of what do you want to happen when a frig magnet is dropped.

Cheers

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 9th, 2012, 9:47 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Thanks for showing so much interest Lar_123

I've attached a mockup of what I'm attempting to do. Words are dragged over the image to label. Invisible hot spot areas exist on the image to accept or reject the words and a score of correct dropped labels is kept. This part is working fine together with speech to prunounce the words in the labels.

I think the dictionary would be a nice addition if the user was unfamiliar with some of the words. I'm actually working with 'English' and Welsh'. The dictionary would remain minimised until the user needs it. As mentioned earlier there would be an option to choose the search language and then the word entered into the dictionary would provide the word in the first and second language.

Thanks

dpj


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 9th, 2012, 10:09 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
If the purpose is to enable the learner to have access to both translations of the word, could you not simply have each of the word boxes toggle between languages.

If this is the case, using something like a a multi-frame, you could have both text boxes with each version in a single master and use a right click (or mini icon) on the box to toggle. Other simple benefits would include being able to globally switch between languages and adding a pronunciation for each language.

Mostly like you could avoid all scripting as well.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Simple bilingual dictionary
PostPosted: May 10th, 2012, 8:13 am 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Hi mackavi,

Thanks for the suggestion. The activity is aimed at developing vocabulary in the second language and therefore the dictionary idea is only there as a reference point, and most probably, if I succeed in completing it, I will add a feature to hide or disable this function if the teacher wishes the students to complete the tasks without the additional assistance.

Thanks

dpj


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 50 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group