@Test public void sentenceLocationTest() throws Exception { List<Instance> ins = initialize(false, true); String prefix = KeywordNGram.class.getSimpleName(); assertTrue(containsFeatureName(ins, prefix + "_cherry")); assertTrue(containsFeatureName(ins, prefix + "_apricot_peach")); assertFalse(containsFeatureName(ins, prefix + "_peach_nectarine_SB")); assertTrue(containsFeatureName(ins, prefix + "_cherry" + KeywordNGramUtils.MIDNGRAMGLUE + "trees")); assertFalse(containsFeatureName(ins, prefix + "_guava")); assertFalse(containsFeatureName(ins, prefix + "_peach_CA")); assertTrue(containsFeatureName(ins, prefix + "_nectarine_SBBEG")); }
@Override public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException { if (!super.initialize(aSpecifier, aAdditionalParams)) { return false; } try { keywords = FeatureUtil.getStopwords(keywordsFile, true); } catch (IOException e) { throw new ResourceInitializationException(e); } return true; }
KeywordNGram extends AbstractNgram { @Override public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException { if (!super.initialize(aSpecifier, aAdditionalParams)) { return false; } try { keywords = FeatureUtil.getStopwords(keywordsFile, true); } catch (IOException e) { throw new ResourceInitializationException(e); } return true; } }
KeywordNGram extends AbstractNgram { @Override public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException { if (!super.initialize(aSpecifier, aAdditionalParams)) { return false; } try { keywords = FeatureUtil.getStopwords(keywordsFile, true); } catch (IOException e) { throw new ResourceInitializationException(e); } return true; }  }
KeywordNGram extends AbstractNgram { @Override public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException { if (!super.initialize(aSpecifier, aAdditionalParams)) { return false; } try { keywords = FeatureUtil.getStopwords(keywordsFile, true); } catch (IOException e) { throw new ResourceInitializationException(e); } return true; }  @Override Set<Feature> extract(JCas jcas, TextClassificationTarget aTarget); @Override boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams); @Override List<MetaCollectorConfiguration> getMetaCollectorClasses(
            Map<String, Object> parameterSettings); }
KeywordNGram extends AbstractNgram { @Override public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException { if (!super.initialize(aSpecifier, aAdditionalParams)) { return false; } try { keywords = FeatureUtil.getStopwords(keywordsFile, true); } catch (IOException e) { throw new ResourceInitializationException(e); } return true; }  @Override Set<Feature> extract(JCas jcas, TextClassificationTarget aTarget); @Override boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams); @Override List<MetaCollectorConfiguration> getMetaCollectorClasses(
            Map<String, Object> parameterSettings); static final String PARAM_NGRAM_KEYWORDS_FILE; static final String PARAM_KEYWORD_NGRAM_MARK_SENTENCE_BOUNDARY; static final String PARAM_KEYWORD_NGRAM_MARK_SENTENCE_LOCATION; static final String PARAM_KEYWORD_NGRAM_INCLUDE_COMMAS; }