Fixed Issue 17: Conflated triples - all rows are producing triple with "s" :" $Name_0".

Also exposed "id" field for recon objects.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@720 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-05-12 07:45:22 +00:00
parent 992cb964eb
commit 8412aa72dd
2 changed files with 9 additions and 16 deletions

View File

@ -141,7 +141,9 @@ public class Recon implements HasFields, Jsonizable {
} }
public Object getField(String name, Properties bindings) { public Object getField(String name, Properties bindings) {
if ("best".equals(name)) { if ("id".equals(name)) {
return id;
} else if ("best".equals(name)) {
return candidates != null && candidates.size() > 0 ? candidates.get(0) : null; return candidates != null && candidates.size() > 0 ? candidates.get(0) : null;
} else if ("candidates".equals(name)) { } else if ("candidates".equals(name)) {
return candidates; return candidates;

View File

@ -75,7 +75,6 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio
int cellIndex; int cellIndex;
List<CellChange> cellChanges; List<CellChange> cellChanges;
Map<String, Recon> sharedRecons = new HashMap<String, Recon>(); Map<String, Recon> sharedRecons = new HashMap<String, Recon>();
Map<Long, Recon> dupReconMap = new HashMap<Long, Recon>();
long historyEntryID; long historyEntryID;
public RowVisitor init(int cellIndex, List<CellChange> cellChanges, long historyEntryID) { public RowVisitor init(int cellIndex, List<CellChange> cellChanges, long historyEntryID) {
@ -102,11 +101,6 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio
sharedRecons.put(s, recon); sharedRecons.put(s, recon);
} }
} else {
long reconID = cell.recon == null ? 0 : cell.recon.id;
if (dupReconMap.containsKey(reconID)) {
recon = dupReconMap.get(reconID);
recon.judgmentBatchSize++;
} else { } else {
recon = cell.recon == null ? new Recon(historyEntryID) : cell.recon.dup(historyEntryID); recon = cell.recon == null ? new Recon(historyEntryID) : cell.recon.dup(historyEntryID);
recon.match = null; recon.match = null;
@ -114,9 +108,6 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio
recon.judgment = Judgment.New; recon.judgment = Judgment.New;
recon.judgmentBatchSize = 1; recon.judgmentBatchSize = 1;
recon.judgmentAction = "mass"; recon.judgmentAction = "mass";
dupReconMap.put(reconID, recon);
}
} }
Cell newCell = new Cell(cell.value, recon); Cell newCell = new Cell(cell.value, recon);