New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

Linking one entry to definition of other entry?

General discussion

Linking one entry to definition of other entry?

Postby qwiqooq » Thu Feb 21, 2013 6:36 pm

I have successfully created a new dictionary in StarDict format and I'm thinking of linking definitions between dictionary entries. For example, in the definition of the word "go", there is a section explaining its phrasal verb "go about". So I want to have an new entry "go about" in the dictionary, but this entry won't have any definition, instead when the user click on it, the definition of the word "go" will show.

So can anybody tell me if this is possible please? Thanks so much.
qwiqooq
 
Posts: 8
Joined: Sun Feb 17, 2013 10:13 pm

Re: Linking one entry to definition of other entry?

Postby hanyl05 » Fri Feb 22, 2013 2:23 pm

use the html tag <a href=...></a>, for instanvce
go about
<a href='go'>go</a>
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

Re: Linking one entry to definition of other entry?

Postby qwiqooq » Fri Feb 22, 2013 3:42 pm

I see that when double clicking on any word in the definition area in Goldendict, the program will automatically look up this word so there's no need for a hyperlink. I still want to display the definition of one word when clicking on other word in the entry list of the program :(
qwiqooq
 
Posts: 8
Joined: Sun Feb 17, 2013 10:13 pm

Re: Linking one entry to definition of other entry?

Postby chulai » Fri Feb 22, 2013 9:18 pm

qwiqooq wrote:I see that when double clicking on any word in the definition area in Goldendict, the program will automatically look up this word so there's no need for a hyperlink. I still want to display the definition of one word when clicking on other word in the entry list of the program :(


Hi, I'm not familiar with the Stardict format but my guess is that you need to create a synonym file as explained here.
Another option is to use the DSL format which is a text format so you can use whatever text editor you want without need for compilation.
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: Linking one entry to definition of other entry?

Postby qwiqooq » Sat Feb 23, 2013 7:03 am

I have tried for the .syn file but it's still not what I need so I think I will have to find another way around. Thank you so much for your help :)

BTW here is my little script to parse the .idx file by PHP if anyone should needs it.

Code: Select all
$handle = @fopen("input_file.idx", "rb");

$index = array();
$i = 0;
while (!feof($handle))
{
   $word = stream_get_line($handle, 65535, "\x00");
   $bytes = stream_get_line($handle, 8);
   if (strlen($bytes) == 8)
   {
      $position = current(unpack("N", substr($bytes, 0, 4)));
      $size = current(unpack("N", substr($bytes, 4, 4)));
      $index[$word] = array("entry" => $i, "position" => $position, "size" => $size);
      $i++;
   } else
   {
      break;
   }
}
fclose($handle);

echo "<pre>";
print_r($index);
echo "</pre>";
qwiqooq
 
Posts: 8
Joined: Sun Feb 17, 2013 10:13 pm

Re: Linking one entry to definition of other entry?

Postby litingtingsmile » Thu Mar 28, 2013 6:49 am

I think it is possible.
litingtingsmile
 
Posts: 1
Joined: Thu Mar 28, 2013 6:39 am


Return to General

Who is online

Users browsing this forum: No registered users and 40 guests