private static void error(String message) throws Exception { Logger logger = UimaContextFactory.createUimaContext().getLogger(); logger.log(Level.SEVERE, String.format("%s\nusage: " + "VerbClauseTemporalMain timebank-dir treebank-dir", message)); System.exit(1); }
private static void error(String message) throws Exception { Logger logger = UimaContextFactory.createUimaContext().getLogger(); logger.log( Level.SEVERE, String.format( "%s\nusage: java %s input-file-or-dir [output-dir]", TimeMlAnnotate.class.getName(), message)); System.exit(1); }
private static void error(String message) throws Exception { Logger logger = UimaContextFactory.createUimaContext().getLogger(); logger.log(Level.SEVERE, String.format("%s\nusage: " + "VerbClauseTemporalAnnotate input-file-or-dir [output-dir]", message)); System.exit(1); }
@Test public void testGetPipelineName() throws ResourceInitializationException { assertEquals("unknown", UimaUtils.getPipelineName(UimaContextFactory.createUimaContext())); assertEquals( "unknown", UimaUtils.getPipelineName( UimaContextFactory.createUimaContext(PipelineBuilder.PIPELINE_NAME, true))); assertEquals( "default", UimaUtils.getPipelineName( UimaContextFactory.createUimaContext(PipelineBuilder.PIPELINE_NAME, "default"))); }
@Before public void setUp() throws UIMAException { jCas = JCasSingleton.getJCasInstance(); annotation = new Annotation(jCas); context = UimaContextFactory.createUimaContext(PipelineBuilder.PIPELINE_NAME, PIPELINE_NAME); }
@Before public void setUp() throws UIMAException { jCas = JCasSingleton.getJCasInstance(); annotation = new Annotation(jCas); context = UimaContextFactory.createUimaContext(PipelineBuilder.PIPELINE_NAME, PIPELINE_NAME); }
@Test public void testIsMergeDistinctEntities() throws ResourceInitializationException { assertFalse(UimaUtils.isMergeDistinctEntities(UimaContextFactory.createUimaContext())); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "null"))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "hello"))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, false))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, new Boolean(false)))); assertTrue( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, new Boolean(true)))); assertTrue( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, true))); // Questionable if we should convert here? assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "false"))); assertFalse( UimaUtils.isMergeDistinctEntities( UimaContextFactory.createUimaContext(MERGE_DISTINCT_ENTITIES, "true"))); }
@Test public void test() throws Exception { ExternalResourceDescription contentExtractor = ExternalResourceFactory.createExternalResourceDescription( KEY_CONTENT_EXTRACTOR, FakeBaleenContentExtractor.class); FakeCollectionReader cr = (FakeCollectionReader) CollectionReaderFactory.createReader( FakeCollectionReader.class, BaleenCollectionReader.KEY_CONTENT_EXTRACTOR, contentExtractor); UimaContext context = UimaContextFactory.createUimaContext(); cr.initialize(context); assertTrue(cr.initialised); assertNotNull(cr.getSupport()); assertNotNull(cr.getMonitor()); assertNotNull(cr.getProgress()); Progress[] progress = cr.getProgress(); assertEquals("testunits", progress[0].getUnit()); assertFalse(cr.hasNext()); assertTrue(cr.hasNext); cr.getNext((JCas) null); assertTrue(cr.getNext); cr.destroy(); assertTrue(cr.closed); }