DefaultOutcomeFeatureExtractor implements OutcomeFeatureExtractor { public void initialize(UimaContext context) throws ResourceInitializationException { ConfigurationParameterInitializer.initialize(this, context); if (mostRecentOutcome < 1) { throw CleartkInitializationException.parameterLessThan( PARAM_MOST_RECENT_OUTCOME, 1, mostRecentOutcome); } if (leastRecentOutcome < mostRecentOutcome) { throw CleartkInitializationException.parameterLessThan( PARAM_LEAST_RECENT_OUTCOME, mostRecentOutcome, leastRecentOutcome); } }  void initialize(UimaContext context); List<Feature> extractFeatures(List<Object> previousOutcomes); static final String PARAM_MOST_RECENT_OUTCOME; static final String PARAM_LEAST_RECENT_OUTCOME; static final String PARAM_USE_BIGRAM; static final String PARAM_USE_TRIGRAM; static final String PARAM_USE4GRAM; }
@Test public void testInitialize() throws ResourceInitializationException { OutcomeFeatureExtractor ofe; UimaContext context = UimaContextFactory.createUimaContext(); ResourceInitializationException rie = null; try { ofe = new DefaultOutcomeFeatureExtractor(); ofe.initialize(context); } catch (ResourceInitializationException e) { rie = e; } assertNull(rie); context = UimaContextFactory.createUimaContext( DefaultOutcomeFeatureExtractor.PARAM_MOST_RECENT_OUTCOME, new Integer(3), DefaultOutcomeFeatureExtractor.PARAM_LEAST_RECENT_OUTCOME, new Integer(1)); try { ofe = new DefaultOutcomeFeatureExtractor(); ofe.initialize(context); } catch (ResourceInitializationException e) { rie = e; } assertNotNull(rie); context = UimaContextFactory.createUimaContext( DefaultOutcomeFeatureExtractor.PARAM_MOST_RECENT_OUTCOME, new Integer(0)); rie = null; try { ofe = new DefaultOutcomeFeatureExtractor(); ofe.initialize(context); } catch (ResourceInitializationException e) { rie = e; } assertNotNull(rie); }