private <T extends Entity> T addToHeaderBlock( final String v, final int offset, final StringBuilder sb, final T annotation) { final int begin = sb.length() + offset; sb.append(v); final int end = sb.length() + offset; sb.append("\n"); annotation.setBegin(begin); annotation.setEnd(end); annotation.setConfidence(1); annotation.setValue(v); annotation.addToIndexes(); return annotation; }
private <T extends Entity> T addToHeaderBlock( final String v, final int offset, final StringBuilder sb, final T annotation) { final int begin = sb.length() + offset; sb.append(v); final int end = sb.length() + offset; sb.append("\n"); annotation.setBegin(begin); annotation.setEnd(end); annotation.setConfidence(1); annotation.setValue(v); annotation.addToIndexes(); return annotation; }
a.setEnd(e.getEnd()); a.setValue(e.getValue()); a.setConfidence(e.getConfidence());
a.setEnd(e.getEnd()); a.setValue(e.getValue()); a.setConfidence(e.getConfidence());
@Test public void testDouble() { Entity e = new Entity(jCas); e.setConfidence(0.5); e.addToIndexes(); Feature f = e.getType().getFeatureByBaseName("confidence"); Object o = FeatureUtils.featureToObject(f, e); assertTrue(o instanceof Double); assertEquals(new Double(0.5), (Double) o); }
@Test public void testDouble() { Entity e = new Entity(jCas); e.setConfidence(0.5); e.addToIndexes(); Feature feature = e.getType().getFeatureByBaseName("confidence"); NewFeatureUtils.setPrimitive(e, feature, 1.0); assertEquals(1.0, e.getDoubleValue(feature), 0.0); }