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

Babylon dictionaries in .BDC format

All about dictionaries

Re: Babylon dictionaries in .BDC format

Postby ikm » Sun Jun 26, 2011 7:30 am

kubtek wrote:I see two reasons for using resource database format instead of ordinary files

Agreed.

kubtek wrote: <p>See the picture <img src="abcde.png"/>.</p>
Then we should search for a file named "abcde.png

Exactly this is unclear. Because what I've seen in practice is a lot of dictionaries badly converted from Babylon which used binary tags before and after the filename, e.g. <img src="\x1Eabcde.png\x1F"/> (where \x1F stands for a single byte with the value of 0x1F). And that worked!
ikm
Автор GoldenDict
 
Posts: 1595
Joined: Wed Feb 04, 2009 10:40 am

Re: Babylon dictionaries in .BDC format

Postby kubtek » Sun Jun 26, 2011 7:41 am

\x1E, \x1F characters around file names is the Babylon invention. That was never part of StarDict design.
Probably StarDict trims control characters around file names to display the image. Support for \x1E, \x1F characters is a workaround for badly converted dictionaries, not a feature.
kubtek
 
Posts: 8
Joined: Tue Jun 14, 2011 5:48 pm

Re: Babylon dictionaries in .BDC format

Postby ikm » Sun Jun 26, 2011 7:55 am

kubtek wrote:That was never part of StarDict design.

Are you sure about that? Maybe they are required? And the fact that most of the StarDict dictionaries with pictures are just badly converted Babylon files wants me to just ask people to use the original Babylon files.
ikm
Автор GoldenDict
 
Posts: 1595
Joined: Wed Feb 04, 2009 10:40 am

Re: Babylon dictionaries in .BDC format

Postby kubtek » Sun Jun 26, 2011 8:25 am

Code: Select all
Are you sure about that? Maybe they are required?

I am pretty much sure about that. Of course, I do not know what former StarDict developers had in mind, but the following excerpt from StarDict Html plug-in makes my believe that \x1E, \x1F characters in file names are not required.
Code: Select all
            item.type = ParseResultItemType_res;
            item.res = new ParseResultResItem;
            item.res->type = "image";
            int n = src.length();
            if (src[0]==0x1e && src[n-1]==0x1f) {
               item.res->key.assign(src.c_str()+1, n-2);
            } else {
               item.res->key = src;
            }

"src" here holds contents of the src attribute of img tag.

So for HTML fragment <img src="\x1Eabcde.png\x1F"/>, src will be \x1Eabcde.png\x1F, and item.res->key will be assigned to abcde.png.

Code: Select all
And the fact that most of the StarDict dictionaries with pictures are just badly converted Babylon files wants me to just ask people to use the original Babylon files.


They really should be reconverted with new tools to take advantage of the knowledge about Babylon format that is available now. More about that later...
kubtek
 
Posts: 8
Joined: Tue Jun 14, 2011 5:48 pm

Re: Babylon dictionaries in .BDC format

Postby kubtek » Sun Jun 26, 2011 11:13 am

I'd like to indicate changes to PyGlossary converter improving support for .bgl format. I hope they will be ported to GoldenDict. PyGlossary git repository is here: https://github.com/ilius/pyglossary.

Here are the most notable changes:

1. better encoding detection algorithm

1.1 GD now use the following charset table:

Code: Select all
const std::string bgl_charset[] = {
  "ISO-8859-1", /*Default*/
  "ISO-8859-1", /*Latin*/
  "ISO-8859-2", /*Eastern European*/
  "WINDOWS-1251", /*Cyriilic*/
...

While in reality it should be slightly different.

1.2 process charset switching sequences in articles. They look like <charset ...> </charset> tags.

2. new block types used for articles (block.type in the Babylon::readBlock function is what I call a block type)

3. new codes for type 3 (like title, author, email, etc in the Babylon::read function)

4. better handling of article definition. Reliable extraction of fields like transcription, partOfSpeech, displayedHeadword and other. GD extracts these fields, but does that incorrectly. GD simply search for specific markers (binary characters) in text that may give false matches.
kubtek
 
Posts: 8
Joined: Tue Jun 14, 2011 5:48 pm

Re: Babylon dictionaries in .BDC format

Postby thor » Sat Oct 01, 2011 1:20 pm

Please add BDC support to GoldenDict. There are some user-made glossaries only available in BDC format. GoldenDict can't read them unlike BGLs.

I also tried PyGlossary to convert BDCs to a readable format but it doesn't support this format too.

Anyone knows a method to convert BDCs?
thor
 
Posts: 1
Joined: Sat Oct 01, 2011 1:11 pm

Re: Babylon dictionaries in .BDC format

Postby ctcx » Sat Dec 03, 2011 1:04 am

levent wrote:BDC file has same data with BGL.

I installed Babylon program to my computer, I downloaded EXE file, I exported BGL file from this EXE dictionary file with using WINRAR. I installed EXE file to my Babylon program and Babylon program converted this BGL file to a large BDC file.

And I used BGL files, and Babylon program converted them to a large BDC file. I can't understand why it converts them to larger BDC files.

And I deleted Babylon program from my computer. I use these BGL files with my GoldenDict program.

First, hello, newbie here...
Levent, how did you extracted the BGL file from the EXE using Winrar? Evidently it's not done by changing its extension to RAR...

This is what I have done. When I try to download a Babylon dictionary, as it was mentioned before, no matter what one I choose, it always downloads an EXE file called Babylon9_setup_dict.exe. My cousin has Babylon 9 installed on Win 7 x64 and we tried to install a Babylon dicionary (for example, Babylon English-Spanish). If Babylon is running it closes it and opens the Babylon program installer. We have to close the installer, re-run Babylon itself and it suddenly starts to download and install the Babylon dictionary we chose. So I guess their dictionary system changed again...

Then I tried to locate the installed file(s). Found 3:

Babylon_English_Spanish.bgl (5.36 Mb)
Babylon_English_Spanish_sub.bgl (5.02 Kb)
inside C:\Users\(userName)\AppData\Local\Babylon

And the large Babylon_English_Spanish.bdc (26.7 Mb)
inside C:\ProgramData\Babylon\Gloss

They're not inside Babylon's directory, by the way... Then I tried to remove the installed dictionary from Babylon's Menu - Configuration - Dictionaries - Admin dictionaries. It only removed the large BDC file, leaving the BGL ones.

After all this info, my question is, do you think the BGL file which is 5.36 Mb is the one usable by Goldendict?
Thanks.
ctcx
 
Posts: 9
Joined: Fri Dec 02, 2011 11:50 pm

Re: Babylon dictionaries in .BDC format

Postby ctcx » Sat Dec 03, 2011 4:13 am

OK, tried with the portable version of Goldendict, copied the mentioned BGL file from C:\Users\(userName)\AppData\Local\Babylon to (Goldendict directory)/content, and it seemingly worked, meaning I self-answered my question. I'm using Win 7, I don't know where the BGL files are located on Win Vista or XP though...

Then, what would we need the BDC files for? Maybe the downpart is we still need to install the dictionaries in order to get the BGL's...
Last edited by ctcx on Sat Dec 03, 2011 7:34 pm, edited 1 time in total.
ctcx
 
Posts: 9
Joined: Fri Dec 02, 2011 11:50 pm

Re: Babylon dictionaries in .BDC format

Postby chulai » Sat Dec 03, 2011 5:18 pm

On Win Vista the location is the same as Win 7.
On Win XP the location is C:\Documents and Settings\{userName}\\AppData\Local\Babylon

You don't need the BDC in Goldendict. You only need the BGLs. BDCs are the indexed version of BGLs that Babylon use to search the terms faster. GoldenDict uses its own index file format and store the index on an "index" folder inside the configuration folder. Hope that helps.

ctcx wrote:OK, tried with the portable version of Goldendict, copied the mentioned BGL file from C:\Users\(userName)\AppData\Local\Babylon to (Goldendict directory)/content, and it seemingly worked, meaning I self-answered my question. I'm using Win 7, I don't know where the BGL files are located on Win Vista or XP though...

Then, what would we neec the BDC files for? Maybe the downpart is we still need to install the dictionaries in order to get the BGL's...
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: Babylon dictionaries in .BDC format

Postby ctcx » Sat Dec 03, 2011 7:36 pm

Thanks for the answer. But then do you know what are those light (dictionaryName)_sub.bgl files for?
Thanks.
ctcx
 
Posts: 9
Joined: Fri Dec 02, 2011 11:50 pm

PreviousNext

Return to Dictionaries

Who is online

Users browsing this forum: No registered users and 16 guests