I'll go through the steps to convert the PDF file to something that can be used within Stardict and Goldendict.
First, you want to create a simple text file with the dictionary. I just copied and pasted all the text I wanted to include into a new text file:
You'll notice that the delimiter between the two languages is a dash. I needed to change that to something that the convert program could understand. I chose a [TAB] as the delimiter. I also made sure to put a space before and after my dash, because Ojibwe uses dashes with some affixes.
I then saved that file as a text file. Once the file was saved, I then called up stardict-editor. This is a simple, single-window application that will do the conversion to a compatible format for use in the Stardict and Goldendict applications.
Click on the "Browse" button to load your saved newly edited text file, then click "Compile". If all goes well, you'll get the following dialog:
I had hundreds of duplicate entries, because the particular dictionary I'm using includes other dialects, and some of the entries were the same for the various dialects. If there are duplicates, an error is shown with a line number. Simply go back and fix/delete the entry, then try again until you get the above dialog.
Once compiled, three files will be created, a dict.dx, .idx, and .ifo file:
Next we want to open the .ifo file in a text editor and change the name of the dictionary to what we want it to be:
This name is what will be visible in the dictionary application.
Save the file and then start Stardict or Goldendict. Make sure that all three of these newly created files are easily accessible to the dictionary program. On my system there is a global user location, and I've also created my own dictionary directory and place all my own user-created dictionaries there.
Now we want to let the application know where the dictionaries are located. Start Goldendict (what I use), go to "Edit... Dictionaries". The following dialog box will appear:
Click on "Rescan". Now click on the "Dictionaries tab in the same dialog box, and you should see your new dictionary recognized.
That's it . You're done! You can now use your new dictionary.
The above screenshot is a simple dictionary lookup, but what makes Stardict and Goldendict so useful is that it can be used with any text application. While you're reading along in an epub, PDF, text program, you can just click on any word and you'll get the definition for it, provided it's in the dictionary:
Keep in mind that this process needs to be done for each language direction. The screenshots I've included here only show the process for an Ojibwe > English dictionary. The same thing must be done if you want a dictionary for the other direction (English > Ojibwe in my case).
I don't know of any direct way to do this for a Mac, but I know that there is something that will convert an already created Stardict/Goldendict dictionary to Mac Dictionary format. It's called the Mac Dictionary Kit and includes DictUnifier. It can be found here.
Thanks for your writing, but i'm searching how to customize my dictionary: i want to add the images and as i see in your example, a word has one meaning. If i want to add more level of meaning, is it possible?
ReplyDeleteThankyou
In the file .tab, use the mark-up Pango (search in Wikipedia).
DeleteThanks, this is very useful. Stardict can apparently make use of more complex dictionary files with added features such as including an audio file to play, but it looks like you have to create the necessary files manually in order to do this. Is there by any chance a way to use stardict-editor to create dictionaries with audio and other such features?
ReplyDeletewhen I try to compile in stardict editor I get this
ReplyDeleteBuilding...
Error, no new line at the end.
Failed!
Someone told me here http://askubuntu.com/questions/810407/stardict-goldend-abiword that I need an enter to add in html file , I dont know what is meant...
I tried everything but I always get en error, can someone solve my problem.
Thanks in advance.
Did you try adding a carriage return at the the end... to create a new line?
Delete> I had hundreds of duplicate entries, because the particular dictionary I'm using includes other dialects, and some of the entries were the same for the various dialects. If there are duplicates, an error is shown with a line number. Simply go back and fix/delete the entry, then try again until you get the above dialog.
ReplyDeleteIf you use the version 3.0.1 you wont have this problem
Hi, I can't find the stardict editor anywhere, i'm using windows 10, where can I get it ?
ReplyDeleteFor windows, I also looked it up everywhere and I have not been able to run any of the versions I found (https://code.google.com/archive/p/stardictproject/downloads and https://github.com/lpdevs/free-dictionaries)
DeleteActually, it worked! I used https://github.com/lpdevs/free-dictionaries, followed the instructions but put editor.exe in the same root as gtk2 to run it. I had to download the iconv.dll file from here: https://gnupg.org/download/iconv.html. I also put it in the same root (gtk2/bin)and now it works fine :))
DeleteI was able to generate my own dictionary
useful feedback.
Deletecan we add image after word definition ?
ReplyDeleteThank you so much as you have been willing to share information with us. top 10 boarding school in delhi We will forever admire all you have done here because you have made my work as easy as ABC.
ReplyDeleteFor the "Error, no new line at the end." I found that a control character was inserted at the end of a line. I deleted it, then compilation worked. The control character is 26 (Control-Z, SUB, EOF, ^Z) (see wikipedia). Try to find it in your document copying from here: . (here appear as an arrow; In Emeditor appeared as a Z, Notepad++ as SUB, and in Notepad doesn't appear anymore).
ReplyDeleteHi! I cannot file a gui stardicteditor for linux, can you share the link of the stardict-editor one that you are using in this article?
ReplyDeleteIf you're using an Ubuntu/Debian-based distro, you'll need to type "sudo apt install stardict-tools" (or apt-get) on a terminal and press Enter (for Fedora/Red Hat-based distros you need to replace apt with dnf). When that's installed, you need to type "stardict-editor" on the same terminal again. Here you go!
DeleteThank you for your guide. Based on your hints I just created an English-Polish dictionary, based on possibly the best, University of Poznan database: http://www.macminer.opoka.org.pl/dictionary/WSP4.zip
ReplyDeletethanks/dzieki, loading into Alpus
DeleteThank you so much, that helped for my Tigrinya tab-delimited dictionary that I can now use in goldendict!
ReplyDeleteIt is worth to note that the editor is found in /usr/lib/stardict-tools/stardict-editor if installed via "apt install stardict-tools". Had to search quite some time to find that out.
Cool and I have a super offer you: Who Does House Renovation house renovation services
ReplyDelete