ReferentToEntity extends BaleenAnnotator { protected static boolean isBetterEntity(Entity original, Entity challenger) { String origValue = original.getValue(); if (origValue == null) { origValue = original.getCoveredText(); } String challValue = challenger.getValue(); if (challValue == null) { challValue = challenger.getCoveredText(); } return origValue.length() < challValue.length(); }  @Override AnalysisEngineAction getAction();  }
@Test public void testIsBetter() { Entity a = new Entity(jCas, 0, 5); a.setValue("Simon"); Entity b = new Entity(jCas, 0, 11); b.setValue("Simon Brown"); assertTrue(ReferentToEntity.isBetterEntity(a, b)); assertFalse(ReferentToEntity.isBetterEntity(b, a)); }