mitrevf / airhead-research

Automatically exported from code.google.com/p/airhead-research
0 stars 0 forks source link

SemanticSpaceIO.writeSparseText produces wrong output for SparseVector #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load attached sspace
2. save attached sspace with SSpaceFormat.SPARSE_TEXT
3. compare sspace files

What is the expected output? What do you see instead?
expected (same as in attached sspace):
Wort|6,1.0,8,1.0

instead:
Wort|0,0.0,1,0.0

What version of the product are you using? On what operating system?
latest 1.7-snapshot
Windows 7

Please provide any additional information below.
In SemanticSpaceIO.writeSparseText line 500 e.g it is:
                  sb.append(",").append(i).append(",").append(sdv.get(i));

but it should be:
sb.append(",").append(nz[i]).append(",").append(sdv.get(nz[i]));

because you want to write the nonZeroIndices stored in nz not i.

See attachments for suggested patch file.

Original issue reported on code.google.com by mydrowsy...@googlemail.com on 13 Jan 2012 at 1:04

Attachments:

GoogleCodeExporter commented 9 years ago
sry... ist already fixed in the svn repo. But not in the zip snapshot 
http://code.google.com/p/airhead-research/downloads/detail?name=sspace-1.7-snaps
hot.zip ?

Original comment by mydrowsy...@googlemail.com on 13 Jan 2012 at 3:35

GoogleCodeExporter commented 9 years ago
The zip file has been updated with the fix!

Original comment by David.Ju...@gmail.com on 17 Jan 2012 at 11:15

GoogleCodeExporter commented 9 years ago
Thanks. So this one can be closed.

Original comment by mydrowsy...@googlemail.com on 18 Jan 2012 at 1:44