English/Arabic Dictionary in Linux

For most of people, dictionaries are very useful piece of software to be on when browsing the net. On Windows there is EasyLingo and Babylon. But what about Linux, and to be more specific what about Arabic dictionaries in Linux.

Well, Linux has number of a good dictionary engines, such stardict, but the problem we don't have a good Arabic dictionaries for those engines. Luckily googling for that lead me to a tool to convert Babylon dictionaries to work with stardict. You can access the howto http://lizards.opensuse.org/2008/06/14/converting-babylon-dictionaries-to-stardict-format-in-opensuse/

Everything worked fine. But the conversion tool seems to have a bug that will add $SOME_NUMBER$ to the end of each word. I created this small python script to fix this out. I hope you will find it useful. Save the script as fix_tab.py. Give it an execution permission.

#!  /usr/bin/env python
# -*- coding: utf-8 -*-

import sys 
import re

inputFile  = sys.argv[1]	#input file 
outputFile = sys.argv[2]	#output file

#Read File
try:
    inFile = open(inputFile,"r")
    outFile = open(outputFile,"w")
except IOError:
    print "Cannot open the input file!"
    sys.exit(1)
removeDS  = re.compile("(\$[\d]*\$)")
for line in inFile:
	line = removeDS.sub("",line)
	outFile.write(line)
	#outFile.write("\n")
	#print line
outFile.close()
inFile.close()
print "Fin"

1. Download the BGL dictionary file.
2. Convert the file to stardict using dictconv INPUT_FILENAME.BGL -o OUTPUT_FILENAME.ifo
3. Use stardict-edit to uncompile the ifo to text tab file
4. use the script above to fix the text file fix_tab.py TEXTFILE.txt FIXED_TEXTFILE.txt.
5. again use the stardict-edit to compile the fixed file.
6. copy the generated files to /usr/share/stardict/dic/ and restart stardict

You can download a sample english-arabic dictionary from http://obaidy.net/pub/ss.tar.gz

Comments

:)

Great job my friend, well done...

There are not many

There are not many english/arabic dictionaries. Good Job!

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.