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

Sample file for supported DSL features

All about dictionaries

Sample file for supported DSL features

Postby MaximeB » Fri Aug 26, 2011 8:33 am

Hi,

GoldenDict does not support all DSL features yet. I have written a small DSL file that shows which features are supported and how to use them.
You can put is with your other dictionaries, and see its contents by searching for "sample entry".
BTW, I have tried to upload it as an attachment, but I get a message "The extension dsl is not allowed". I tried to change the extension to .txt with the same result.

Code: Select all
#NAME "Sample dictionary"
#INDEX_LANGUAGE "English"
#CONTENTS_LANGUAGE "English"

sample entry
example
sample {unsorted part} card
{the }sample headword
   I love this \~. • I love this ~. (The tilde replaces the first headword.)
   {{This is a comment which
   should be invisible.}}
   \{{This is a comment which
   should be invisible.\}}
   \[b\]bold text\[/b\] • [b]bold text[/b]
   \[i]italics\[/i] • [i]italics[/i]
   \[u]underlined text\[/u] • [u]underlined text[/u]
   CO\[sub]2\[/sub] • CO[sub]2[/sub] • subscript
   e=mc\[sup]2\[/sup] • e=mc[sup]2[/sup] • superscript
   [m9]\[m9] - sets the left paragraph margin to 9 spaces The corresponding closing tag of the paragraph is. \[/m][/m]
   \[ex]example\[/ex] • [ex]example[/ex]
   \[s]balkenschuh.jpg\[/s] • [s]balkenschuh.jpg[/s] • multimedia zone (used to add pictures or sound files into a dictionary entries ).
   \[p]v.\[/p] • [p]v.[/p] • labels are shown in a different colour
   \[ref]ace\[/ref] [ref]ace[/ref] • \<<planet\>> <<planet>> • hyperlink to another card.
   \[url]http://goldendict.org/\[/url] • [url]http://goldendict.org/[/url] link to a Web page
   \[c blue]Blue text\[/c] • [c blue]Blue text[/c]
   Supported colour names:
   [c aliceblue]aliceblue[/c]
   [c antiquewhite]antiquewhite[/c]
   [c aqua]aqua[/c]
   [c aquamarine]aquamarine[/c]
   [c azure]azure[/c]
   [c beige]beige[/c]
   [c bisque]bisque[/c]
   [c blanchedalmond]blanchedalmond[/c]
   [c blue]blue[/c]
   [c blueviolet]blueviolet[/c]
   [c brown]brown[/c]
   [c burlywood]burlywood[/c]
   [c cadetblue]cadetblue[/c]
   [c chartreuse]chartreuse[/c]
   [c chocolate]chocolate[/c]
   [c coral]coral[/c]
   [c cornflowerblue]cornflowerblue[/c]
   [c cornsilk]cornsilk[/c]
   [c crimson]crimson[/c]
   [c cyan]cyan[/c]
   [c darkblue]darkblue[/c]
   [c darkcyan]darkcyan[/c]
   [c darkgoldenrod]darkgoldenrod[/c]
   [c darkgray]darkgray[/c]
   [c darkgreen]darkgreen[/c]
   [c darkkhaki]darkkhaki[/c]
   [c darkmagenta]darkmagenta[/c]
   [c darkolivegreen]darkolivegreen[/c]
   [c darkorange]darkorange[/c]
   [c darkorchid]darkorchid[/c]
   [c darkred]darkred[/c]
   [c darksalmon]darksalmon[/c]
   [c darkseagreen]darkseagreen[/c]
   [c darkslateblue]darkslateblue[/c]
   [c darkslategray]darkslategray[/c]
   [c darkturquoise]darkturquoise[/c]
   [c darkviolet]darkviolet[/c]
   [c deeppink]deeppink[/c]
   [c deepskyblue]deepskyblue[/c]
   [c dimgray]dimgray[/c]
   [c dodgerblue]dodgerblue[/c]
   [c firebrick]firebrick[/c]
   [c floralwhite]floralwhite[/c]
   [c forestgreen]forestgreen[/c]
   [c fuchsia]fuchsia[/c]
   [c gainsboro]gainsboro[/c]
   [c ghostwhite]ghostwhite[/c]
   [c gold]gold[/c]
   [c goldenrod]goldenrod[/c]
   [c gray]gray[/c]
   [c green]green[/c]
   [c greenyellow]greenyellow[/c]
   [c honeydew]honeydew[/c]
   [c hotpink]hotpink[/c]
   [c indianred]indianred[/c]
   [c indigo]indigo[/c]
   [c ivory]ivory[/c]
   [c khaki]khaki[/c]
   [c lavender]lavender[/c]
   [c lavenderblush]lavenderblush[/c]
   [c lawngreen]lawngreen[/c]
   [c lemonchiffon]lemonchiffon[/c]
   [c lightblue]lightblue[/c]
   [c lightcoral]lightcoral[/c]
   [c lightcyan]lightcyan[/c]
   [c lightgoldenrodyellow]lightgoldenrodyellow[/c]
   [c lightgreen]lightgreen[/c]
   [c lightgrey]lightgrey[/c]
   [c lightpink]lightpink[/c]
   [c lightsalmon]lightsalmon[/c]
   [c lightseagreen]lightseagreen[/c]
   [c lightskyblue]lightskyblue[/c]
   [c lightslategray]lightslategray[/c]
   [c lightsteelblue]lightsteelblue[/c]
   [c lightyellow]lightyellow[/c]
   [c lime]lime[/c]
   [c limegreen]limegreen[/c]
   [c linen]linen[/c]
   [c magenta]magenta[/c]
   [c maroon]maroon[/c]
   [c mediumaquamarine]mediumaquamarine[/c]
   [c mediumblue]mediumblue[/c]
   [c mediumorchid]mediumorchid[/c]
   [c mediumpurple]mediumpurple[/c]
   [c mediumseagreen]mediumseagreen[/c]
   [c mediumslateblue]mediumslateblue[/c]
   [c mediumspringgreen]mediumspringgreen[/c]
   [c mediumturquoise]mediumturquoise[/c]
   [c mediumvioletred]mediumvioletred[/c]
   [c midnightblue]midnightblue[/c]
   [c mintcream]mintcream[/c]
   [c mistyrose]mistyrose[/c]
   [c moccasin]moccasin[/c]
   [c navajowhite]navajowhite[/c]
   [c navy]navy[/c]
   [c oldlace]oldlace[/c]
   [c olive]olive[/c]
   [c olivedrab]olivedrab[/c]
   [c orange]orange[/c]
   [c orangered]orangered[/c]
   [c orchid]orchid[/c]
   [c palegoldenrod]palegoldenrod[/c]
   [c palegreen]palegreen[/c]
   [c paleturquoise]paleturquoise[/c]
   [c palevioletred]palevioletred[/c]
   [c papayawhip]papayawhip[/c]
   [c peachpuff]peachpuff[/c]
   [c peru]peru[/c]
   [c pink]pink[/c]
   [c plum]plum[/c]
   [c powderblue]powderblue[/c]
   [c purple]purple[/c]
   [c red]red[/c]
   [c rosybrown]rosybrown[/c]
   [c royalblue]royalblue[/c]
   [c saddlebrown]saddlebrown[/c]
   [c salmon]salmon[/c]
   [c sandybrown]sandybrown[/c]
   [c seagreen]seagreen[/c]
   [c seashell]seashell[/c]
   [c sienna]sienna[/c]
   [c silver]silver[/c]
   [c skyblue]skyblue[/c]
   [c slateblue]slateblue[/c]
   [c slategray]slategray[/c]
   [c snow]snow[/c]
   [c springgreen]springgreen[/c]
   [c steelblue]steelblue[/c]
   [c tan]tan[/c]
   [c teal]teal[/c]
   [c thistle]thistle[/c]
   [c tomato]tomato[/c]
   [c turquoise]turquoise[/c]
   [c violet]violet[/c]
   [c wheat]wheat[/c]
   [c white]white[/c]
   [c whitesmoke]whitesmoke[/c]
   [c yellow]yellow[/c]


MaximeB
 
Posts: 14
Joined: Thu Sep 24, 2009 2:16 pm

Re: Sample file for supported DSL features

Postby Tvangeste » Fri Aug 26, 2011 10:40 am

MaximeB wrote:GoldenDict does not support all DSL features yet.

What features exactly?

The biggest not yet supported feature I'm currently aware of is the sub-entries (the ones with @-sign). Everything else should be almost 100% compatible.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Sample file for supported DSL features

Postby Tvangeste » Fri Aug 26, 2011 10:56 am

MaximeB wrote: \{{This is a comment which
should be invisible.\}}

Actually, this exactly *must* be visible, since the brackets are quoted, which means to insert them in the output as-is, not treat them as comment delimiters.

MaximeB wrote:
Code: Select all
   \[i]italics\[/i] • [i]italics[/i]
   \[u]underlined text\[/u] • [u]underlined text[/u]


Such lines are not 100% correct DSL. And the Lingvo DSL compiler will complain about them. You've quoted the first bracket '[', but didn't quote the second one. Instead of \[u] one should always write \[u\] (in cases when you'd like to treat it as literal content, not as tags).

MaximeB wrote: [c cornflowerblue]cornflowerblue[/c]
[c lightgrey]lightgrey[/c]

Official Lingvo DSL Compiler doesn't support these colors, use cornflower and lightgray instead.

But thanks for the file, it can be very useful for those who just starting to create their dictionaries in DSL format. Now we have a topic to discuss DSL features. :)
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Sample file for supported DSL features

Postby MaximeB » Fri Aug 26, 2011 11:08 am

Tvangeste wrote:
MaximeB wrote:GoldenDict does not support all DSL features yet.

What features exactly?


I have just tried things and kept only what worked. I do not remember the rest.
This file is just meant as a sort of help file that you can see inside GoldenDict.
MaximeB
 
Posts: 14
Joined: Thu Sep 24, 2009 2:16 pm

Re: Sample file for supported DSL features

Postby MaximeB » Fri Aug 26, 2011 11:13 am

Tvangeste wrote:
MaximeB wrote: \{{This is a comment which
should be invisible.\}}

Actually, this exactly *must* be visible, since the brackets are quoted, which means to insert them in the output as-is, not treat them as comment delimiters.

The entry is meant to be seen as a GoldenDict dictionary entry.
In GoldenDict, on the right side, you see what you have to write in the dictionary entry. On the left side, after the bullet, you see the final result.
(The brackets are escaped on the right side so that GoldenDict displays the literal bracket and text.)
MaximeB
 
Posts: 14
Joined: Thu Sep 24, 2009 2:16 pm

Re: Sample file for supported DSL features

Postby Tvangeste » Fri Aug 26, 2011 11:39 am

MaximeB wrote:I do not remember the rest.

Understood. Once you encounter any DSL incompatibility in the future, please don't hesitate to file a bug here:
https://github.com/goldendict/goldendict/issues

MaximeB wrote:This file is just meant as a sort of help file that you can see inside GoldenDict.

Indeed, very helpful, thanks! I'm starting to think that maybe we should create a small repository with some small sample DSL dictionary, fully functional and showing the typical usage of DSL tags, etc. Your file is an excellent start for that :)

MaximeB wrote:In GoldenDict, on the right side, you see what you have to write in the dictionary entry. On the left side, after the bullet, you see the final result. (The brackets are escaped on the right side so that GoldenDict displays the literal bracket and text.)

Ah, indeed.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Sample file for supported DSL features

Postby Tvangeste » Fri Aug 26, 2011 12:19 pm

And here it is, a bit cleaned-up and improved here and there sample DSL file, as well as additional abbr file (abbreviations) and the icon.

https://github.com/VVSiz/SampleDSL

Let me know if something is missing and I"ll be updating the sample accordingly.
Tvangeste
 
Posts: 893
Joined: Thu Jun 02, 2011 11:42 am

Re: Sample file for supported DSL features

Postby ikm » Sat Aug 27, 2011 4:50 am

MaximeB wrote:GoldenDict does not support all DSL features yet.

Which features exactly? Put up or shut up. There are two features it doesn't support: subentries and includes. Everything else is a bug. Report it properly.
ikm
Автор GoldenDict
 
Posts: 1595
Joined: Wed Feb 04, 2009 10:40 am

Re: Sample file for supported DSL features

Postby MaximeB » Sat Aug 27, 2011 5:11 am

ikm wrote:
MaximeB wrote:GoldenDict does not support all DSL features yet.

Which features exactly? Put up or shut up. There are two features it doesn't support: subentries and includes. Everything else is a bug. Report it properly.


Why do you have to be so aggressive?
MaximeB
 
Posts: 14
Joined: Thu Sep 24, 2009 2:16 pm

Re: Sample file for supported DSL features

Postby ikm » Sat Aug 27, 2011 5:36 am

I don't like FUD.
ikm
Автор GoldenDict
 
Posts: 1595
Joined: Wed Feb 04, 2009 10:40 am

Next

Return to Dictionaries

Who is online

Users browsing this forum: No registered users and 1 guest

cron