JCoReEntityDataset extends Dataset { @Override public void load(HierarchicalConfiguration config) { HierarchicalConfiguration localConfig = config.configurationAt(Dataset.class.getPackage().getName()); String sentenceFilename = localConfig.getString("sentenceFilename"); String mentionsFilename = localConfig.getString("mentionTestFilename"); load(new File(sentenceFilename), new File(mentionsFilename)); } JCoReEntityDataset(Tokenizer tokenizer);  JCoReEntityDataset(); @Override void load(HierarchicalConfiguration config); void load(File sentenceFile, File mentionsFile); @Override List<Dataset> split(int n);  }
@Test public void testLoad() { JCoReEntityDataset ds = new JCoReEntityDataset(new SimpleTokenizer()); ds.load(new File("src/test/resources/data/jcoreentitydataset/sentences.tsv"), new File("src/test/resources/data/jcoreentitydataset/entities.tsv")); assertNotNull(ds.getSentences()); assertTrue(ds.getSentences().size() > 0); Set<String> mentionStrings = ds.getSentences().stream().map(s -> s.getMentions()).flatMap(ms -> ms.stream()).map(m -> m.getText()).collect(Collectors.toSet()); assertTrue(mentionStrings.contains("lysophospholipase")); assertTrue(mentionStrings.contains("lysophospholipid-specific lysophospholipase")); assertTrue(mentionStrings.contains("hLysoPLA")); }