private void findNext() { while (it.hasNext()) { next = it.next(); if (!next.getProperties().isEmpty()) return; // we found it! } next = null; } }
public static String toString(Record r) { StringBuffer buf = new StringBuffer(); for (String p : r.getProperties()) { Collection<String> vs = r.getValues(p); if (vs == null || vs.isEmpty()) continue; buf.append(p + ": "); for (String v : vs) buf.append("'" + v + "', "); } //buf.append(";;; " + r); return buf.toString(); }
private String getid(Record r) { for (String propname : r.getProperties()) if (config.getPropertyByName(propname).isIdProperty()) return r.getValue(propname); return null; } }
private String getid(Record r) { for (String propname : r.getProperties()) { Property prop = config.getPropertyByName(propname); if (prop == null) throw new DukeConfigException("Record has property " + propname + " which is not in configuration"); if (prop.isIdProperty()) return r.getValue(propname); } return null; }
for (String propname : record.getProperties()) { Property prop = config.getPropertyByName(propname);
comparisons++; double prob = 0.5; for (String propname : r1.getProperties()) { Property prop = config.getPropertyByName(propname); if (prop == null)
@Test public void testRecordImplementation() throws IOException { Record record = TestUtils.makeRecord("ID", "1", "NAME", "AND", "EMAIL", "BBBBB"); db.index(record); db.commit(); record = db.findRecordById("1"); assertEquals("wrong ID", "1", record.getValue("ID")); assertEquals("wrong NAME", "AND", record.getValue("NAME")); assertEquals("wrong EMAIL", "BBBBB", record.getValue("EMAIL")); Collection<String> props = record.getProperties(); assertEquals("wrong number of properties", 3, props.size()); assertTrue("no ID", props.contains("ID")); assertTrue("no NAME", props.contains("NAME")); assertTrue("no EMAIL", props.contains("EMAIL")); }
for (String propname : record.getProperties()) { Property prop = config.getPropertyByName(propname); if (prop == null)
private void findNext() { while (it.hasNext()) { next = it.next(); if (!next.getProperties().isEmpty()) return; // we found it! } next = null; } }
public static String toString(Record r) { StringBuffer buf = new StringBuffer(); for (String p : r.getProperties()) { Collection<String> vs = r.getValues(p); if (vs == null || vs.isEmpty()) continue; buf.append(p + ": "); for (String v : vs) buf.append("'" + v + "', "); } //buf.append(";;; " + r); return buf.toString(); }
private String getid(Record r) { for (String propname : r.getProperties()) if (config.getPropertyByName(propname).isIdProperty()) return r.getValue(propname); return null; }
double prob = AVERAGE_SCORE; for (String propname : r1.getProperties()) { Collection<String> vs1 = r1.getValues(propname); Collection<String> vs2 = r2.getValues(propname);
private String getid(Record r) { for (String propname : r.getProperties()) if (config.getPropertyByName(propname).isIdProperty()) return r.getValue(propname); return null; } }
/** * . Computes probability that objects are the same * * @return float the computed score */ @Override public double runAsDouble() { HashMap<String, Collection<String>> props = new HashMap<>(); LeafDocLookup doc = doc(); Collection<String> docKeys = comparedRecord.getProperties(); for (String key : docKeys) { if (doc.containsKey(key)) { String value = (doc.get(key) == null ? "" : getFieldValue(doc.get(key))); props.put(key, value == null ? Collections.singleton("") : Collections.singleton(value)); } } Record r2 = new RecordImpl(props); return compare(comparedRecord, r2, entityParams); }
for (String propname : record.getProperties()) { Property prop = config.getPropertyByName(propname); if (prop == null)
comparisons++; double prob = 0.5; for (String propname : r1.getProperties()) { Property prop = config.getPropertyByName(propname); if (prop == null)