Bug 212306 - multi synonym save bug
Summary: multi synonym save bug
Status: RESOLVED FIXED
Alias: None
Product: parley
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Parley Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-29 18:20 UTC by broyjoerg
Modified: 2010-04-11 13:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fixes destructive writing of synonyms in parley (3.32 KB, patch)
2010-03-29 11:04 UTC, Benjamin Schleinzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description broyjoerg 2009-10-29 18:20:31 UTC
Version:           0.9.2 (using KDE 4.3.2)
OS:                Linux
Installed from:    Ubuntu Packages

Putting more than one synonym to a word doesn work properly. The kvtml file confuses synonym (and other word aspects) relations. Reading the kvtml file after saving a word list with multiple synonym (or other word aspects) relations, delivered this result. It seems, that the programm isnt aible to make more than two pairs, as this is the modus of saving synonym (a.o.) relations between several words. Please analyse a save file (kvtml) with regard of the part "synonyms".
Comment 1 broyjoerg 2009-10-29 18:30:19 UTC
I used Parley for learning latin (ca. 1500 words, file-size: 1,5 MB). All in all I found out 8 bugs. The descripted one seems to be the most seriously. I also have a wishlist with a few items, but Im not fond of translating them all into english, because Im german. If theres interest, I can send an email.
Comment 2 Benjamin Schleinzer 2010-02-27 06:46:48 UTC
I added a patch for checking synonyms in a transitive way. This bug here only occurs if we introduce a circular connection between synonyms. Using transitivity we can avoid it. Not a patch but at least something that works until this is fixed.

See bug #228708
Comment 3 Benjamin Schleinzer 2010-03-29 11:04:30 UTC
Created attachment 42339 [details]
Fixes destructive writing of synonyms in parley

Parley lost synonyms slowly if more than one synonym was saved for an entry. This patch fixes the bug by correctly saving synonym pairs.
Comment 4 Daniel Laidig 2010-04-09 23:14:02 UTC
I just tested your patch and noticed that it isn't working correctly. When saving three entries which are all connected, the following is written:

    <pair>
      <entry id="2">
        <translation id="0"/>
      </entry>
    </pair>
    <pair>
      <entry id="1">
        <translation id="0"/>
      </entry>
      <entry id="3">
        <translation id="0"/>
      </entry>
    </pair>
    <pair>
      <entry id="2">
        <translation id="0"/>
      </entry>
      <entry id="3">
        <translation id="0"/>
      </entry>
    </pair>

One of the pairs only contains one entry, which is then marked as a synonym of the entry with the id 0. IIRC, more or less the same happened when I tried to verify this bug in the first place, so I'm not sure what went wrong here. I must also admit that I haven't really looked at the kvtml saving code so I don't really understand how this code works.

It would be great if you could have a look at the patch again.
Comment 5 Benjamin Schleinzer 2010-04-10 05:33:09 UTC
Can you attach the kvtml file? I had the same problem once because I forgot to link parley against the new libkdeedu as the patch is for that library. So maybe make sure that you link against the correct libkdeedu. I will have a look at the patch once I get you kvtml file as I can reproduce it here with my patched version with which saves are done correctly.
Comment 6 Daniel Laidig 2010-04-10 09:38:21 UTC
Oh, sorry, I take back everything I've said... I shouldn't have trusted Creator to correctly rebuild and link the library. ;)

Your patch works fine and since you now have an SVN account, you can go ahead and commit it to trunk and backport it to branches/KDE/4.4. If you have any questions, feel free to ping me.
Comment 7 Benjamin Schleinzer 2010-04-11 13:20:43 UTC
SVN commit 1113642 by schleinzer:

Removed unnecessary checks while writing kvtml files and made sure that pairs
always have two entries

BUG: 212306


 M  +19 -20    keduvockvtml2writer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1113642