How to Create a DSL dictionary for Goldendict

All about dictionaries

Re: How to Create a DSL dictionary for Goldendict

Postby Tvangeste » Fri Jan 11, 2013 8:56 am

francesinha wrote:Okay, how do I go about changing the code and compiling my own version of Goldendict? Is there any doc available about that? (I have obviously never done such a thing...)

This is naturally not the ideal solution, you'd have maintain your custom version forever, not to mention the need to setup the dev. environment and to build GoldenDict.

Let me think about the problem, and hopefully I could find some solution for you. Stay tuned.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: How to Create a DSL dictionary for Goldendict

Postby francesinha » Fri Jan 11, 2013 9:51 am

Thanks a lot, Tvangeste! I'll stay tuned! :)
francesinha
 
Posts: 26
Joined: Fri Nov 18, 2011 3:33 pm

Re: How to Create a DSL dictionary for Goldendict

Postby Tvangeste » Fri Jan 11, 2013 10:17 am

So, here it is, the updated version from the latest code, already committed to the official repository:

GoldenDict-1.0.1-481-g7496f5f: http://rghost.ru/42909981

Extract it and copy over the latest EARLY ACCESS version (this is important).

After that just start GoldenDict, open the configuration folden via Menu -> Help ->Configuration Folder, then close Goldendict.

In the configuration folder you'll find config file, open it in a text editor and at the very end of the file you should see:

Code: Select all
<maxHeadwordSize>256</maxHeadwordSize>


Change the value to anything (positive) you wish, that's it. :)

P.S. One note though, you won't notice the difference until the index of your dictionary is re-created. Just change anything in your dictionary, save it and resan the changes, that will be enough.

Let me know if that fixes the problem for you.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: How to Create a DSL dictionary for Goldendict

Postby francesinha » Fri Jan 11, 2013 9:41 pm

Tvangeste, you're my hero ! I'm not entirely done testing (I need to check that *everything* is showing), but it looks like it worked perfectly !

I had a few headwords that were displaying several times in the menu, and it turned out that it was because they contained parentheses. I replaced those with "\(" and "\)", and now it works fine.

By the way, the format is actually really well documented there, in no less than 8 languages ! :shock: :lol:

For example, on http://lingvo.helpmax.net/en/troubleshooting/dsl-compiler/dsl-card-structure/, I found this :
The headword must be typed starting from the first position of a new line. Allowed characters: letters of alphabets, numbers, spaces, hyphens, commas and braces {} – to mark the unsorted part of the headword.


I did a bit of testing and found the following :
  • Other stuff that doesn't seem to cause problems in headwords, and that you can search for : $ + = £
  • Stuff that doesn't seem to cause problems in headwords, but that you cannot search for : / # % & _ @ [ ] *, common ponctuation marks

Just in case someone wants to play with this, here's the code I used to perform my tests :
Code: Select all
super test 01 & blah
   content
super test 02 £ blah
   content
super test 03 _ blah
   content
super test 04 @ blah
   content
super test 05 [ blah
   content
super test 06 ] blah
   content
super test 07 { blah
   content
super test 08 } blah
   content
super test 09 ( blah
   content
Super test 10 ) blah
   content
super test 11 / blah
   content
super test 12 $ blah
   content
super test 13 # blah
   content
super test 14 % blah
   content
super test 15 + blah
   content
super test 16 = blah
   content
super test 16 * blah
   content


Anyway, thank you SO MUCH !!! Goldendict and its community are AWESOME ! :)
francesinha
 
Posts: 26
Joined: Fri Nov 18, 2011 3:33 pm

Re: How to Create a DSL dictionary for Goldendict

Postby Tvangeste » Fri Jan 11, 2013 10:26 pm

francesinha wrote:I had a few headwords that were displaying several times in the menu, and it turned out that it was because they contained parentheses. I replaced those with "\(" and "\)", and now it works fine.

Indeed, parentheses in headwords have special meaning and one needs to put a slash in front of them to have them inserted as-is. Similarly, @, #, ~ and if I remember [] as well, need to be escaped with slash, since all these symbols have special meanings in DSL.

francesinha wrote:By the way, the format is actually really well documented there, in no less than 8 languages ! :shock: :lol:

NIIIICE!!!! Finally, a proper official DSL description! Previously, it was available only from within Lingvo as Help.

francesinha wrote:Anyway, thank you SO MUCH !!!

You're always welcome! :)
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: How to Create a DSL dictionary for Goldendict

Postby quanglamle213 » Fri Feb 21, 2014 8:52 am

Hi. Do you know how to link media (sound) files from a zip file to dsl dictionary file. I have Cambridge English dictionary with the dsl file name En-En_Cambridge Advanced Learners Dictionary.dsl.dz and the media file name En-En_Cambridge Advanced Learners Dictionary.dsl.files.zip. I want to create an other dictionary use the zip file as media file. Please help me. Thank you.
quanglamle213
 
Posts: 6
Joined: Tue Feb 18, 2014 2:43 pm

Re: How to Create a DSL dictionary for Goldendict

Postby bugmenot1 » Sat Aug 09, 2014 9:00 pm

Does DSL format support alignment? If not, which one does? Also, is it possible to indent text as in Word:

Image

I am editing "Preface" section of a DSL dictionary and I would like to do the same thing from the screenshot. This is clearly a dumb question, but I'm asking anyway. :D Thank you in advance.
bugmenot1
 
Posts: 9
Joined: Tue Jan 31, 2012 3:00 pm

Re: How to Create a DSL dictionary for Goldendict

Postby shubham » Sun Sep 28, 2014 11:38 pm

fast_rizwaan, thank you for this post--just what i was looking for! Unfortunately, I couldn't quite get it to work. Goldendict got hung up initializing the dictionary for over half hour per attempt. It is a large file (14MB), but it still seemed to me like that was an endless loop. Can I ask you how I might troubleshoot my dict? Are there particular characters in the entries that will send initialization into a vicious loop? Also, because of the processing that needs to happen beforehand, the headword is separated from definitions by a line; and different levels of definition also by a line. E.g.:

aMshakalpanaa

[m] अंशकल्पना [/m]
[m1]amsa-kalpanâ [/m]

[m2][trn]f. arrangement of shares.[/trn][/m]

Do those extra lines matter? (apart from adding to the size of the file)

I'm on linux, btw, using GD 1.0.1. Thanks!
shubham
 
Posts: 4
Joined: Thu May 08, 2014 12:39 am

Re: How to Create a DSL dictionary for Goldendict

Postby dg333 » Mon Sep 29, 2014 11:42 am

Empty lines are treated as dictionary article boundaries. In your case, GoldenDict will parse the text as three articles, not one.
dg333
 
Posts: 115
Joined: Fri Jun 05, 2009 9:50 am

Re: How to Create a DSL dictionary for Goldendict

Postby shubham » Tue Sep 30, 2014 3:10 am

Thanks for that info. I've gone through the file and deleted all empty lines except for one between each entry. I also noticed that I had multiple entries with the same headwords, so I corrected that as well. But it's still taking forever to initialize, at 100% cpu. My uncompressed dsssl document is over 13 MB. Given that it has a decent amount of formatting, how long should it take for Goldendict to intialize it? And, is there a way to validate it, as stardict-editor does for stardict files? Thanks.
shubham
 
Posts: 4
Joined: Thu May 08, 2014 12:39 am

PreviousNext

Return to Dictionaries

Who is online

Users browsing this forum: No registered users and 1 guest