taiit / stardict-3

Automatically exported from code.google.com/p/stardict-3
GNU General Public License v3.0
0 stars 0 forks source link

tabfile for StarDict 3.0.2 no longer compiles dictionaries with duplicate words #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have a dictionary file with duplicate key words. In StarDict 3.0.1, I could 
use the tabfile command to compile the stardict files. However in StarDict 
3.0.2, the tabfile command no longer allows duplicate key words and it 
generates an error message.

To fix this problem, I downloaded the StarDict source code and commented out 
the code which checks for duplicate key words.
I changed lines 95-98 of the file libtabfile.cpp from:
        if(stardict_strcmp(pworditem1->word, pworditem2->word) == 0) {
            print_info("Error, duplicate word %s.\n", pworditem1->word);
            return false;
        }
to:
        /* if(stardict_strcmp(pworditem1->word, pworditem2->word) == 0) {
            print_info("Error, duplicate word %s.\n", pworditem1->word);
            return false;
        } */
Then I recompiled the stardict-tools and can run the tabfile command without 
any problems. The generated files seem to work without any problems in Stardict 
3.0.1 (in Debian Wheezy) and in StarDict 3.0.3 (in Windows XP Prof).  

The source code has the comment: 
      Dictionary index is not allowed to contain duplicates. */

But StarDict doesn't seem to have any problems with duplicate key words. Can 
you please change tabfile to allow duplicate key words. 

Best Regards,
Amos Batto
www.illa-a.org

Original issue reported on code.google.com by amosba...@gmail.com on 24 Sep 2012 at 12:03

GoogleCodeExporter commented 8 years ago
Thank you very much! Fixed!

Original comment by huzheng...@gmail.com on 4 Jul 2013 at 9:16