@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); MongoDatabase db = mongo.getDB(); documentsCollection = db.getCollection(documentCollectionName); stopwords = stopwordResource.getStopwords(stoplist); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); MongoDatabase db = mongo.getDB(); documentsCollection = db.getCollection(documentCollectionName); stopwords = stopwordResource.getStopwords(stoplist); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); MongoDatabase db = mongo.getDB(); documentsCollection = db.getCollection(documentCollectionName); stopwords = stopwordResource.getStopwords(stoplist); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); MongoDatabase db = mongo.getDB(); documentsCollection = db.getCollection(documentCollectionName); stopwords = stopwordResource.getStopwords(stoplist); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); MongoDatabase db = mongo.getDB(); documentsCollection = db.getCollection(documentCollectionName); labelsAndFeatures = readLabelsAndFeaturesFromFile(labelsFile); stopwords = stopwordResource.getStopwords(stoplist); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); MongoDatabase db = mongo.getDB(); documentsCollection = db.getCollection(documentCollectionName); labelsAndFeatures = readLabelsAndFeaturesFromFile(labelsFile); stopwords = stopwordResource.getStopwords(stoplist); }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); try { model = ParallelTopicModel.read(new File(modelPath)); pipe = new TopicModelPipe(stopwordResource.getStopwords(stoplist), model.getAlphabet()); topicWords = new TopicWords(model); } catch (Exception e) { throw new ResourceInitializationException(); } }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); try { model = ParallelTopicModel.read(new File(modelPath)); pipe = new TopicModelPipe(stopwordResource.getStopwords(stoplist), model.getAlphabet()); topicWords = new TopicWords(model); } catch (Exception e) { throw new ResourceInitializationException(); } }
@Test public void testDefault() throws IOException { assertTrue(ssr.getStopwords().contains("the")); assertTrue(ssr.getStopwords(StopwordList.DEFAULT).contains("the")); }
@Test public void testBadCustom() throws IOException { try { ssr.getStopwords(new File("missing.txt")); fail("Expected exception not thrown"); } catch (IOException ioe) { // Do nothing, expected exception for missing file } } }
throws ResourceInitializationException { try { return getStopwords(SharedStopwordResource.StopwordList.valueOf(configuration)); } catch (IllegalArgumentException iae) { getMonitor() return getStopwords(f); } catch (IOException ioe) { throw new ResourceInitializationException( return getStopwords();
@Test public void testCustom() throws IOException { Collection<String> words = ssr.getStopwords(new File(getClass().getResource("exampleStoplist.txt").getPath())); assertTrue(words.contains("the")); assertFalse(words.contains("comment")); assertTrue(words.contains("test")); }
@Test public void testRanksNl() throws IOException { assertTrue(ssr.getStopwords(StopwordList.RANKS_NL).contains("the")); }
@Test public void testLong() throws IOException { assertTrue(ssr.getStopwords(StopwordList.LONG).contains("the")); }
@Override @SuppressWarnings("unchecked") public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); Collection<String> stopwords = stopwordResource.getStopwords(stoplist); try { entityClass = BuilderUtils.getClassFromString( entityTypeClassName, SEMANTIC_ENTITY_PACKAGE, COMMON_ENTITY_PACKAGE); informationCollector = (InformationCollector) BuilderUtils.getClassFromString(informationCollectorClassName, COLLECTOR_PACKAGE) .newInstance(); candidateSupplier = (CandidateSupplier<T>) BuilderUtils.getClassFromString(candidateSupplierClassName, SUPPLIER_PACKAGE) .newInstance(); candidateSupplier.configure(candidateSupplierOptions); candidateRanker = (CandidateRanker<T>) BuilderUtils.getClassFromString(candidateRankerClassName, RANKER_PACKAGE) .newInstance(); candidateRanker.initialize(stopwords); } catch (Exception e) { throw new ResourceInitializationException(e); } }
@Test public void testSmart() throws IOException { assertTrue(ssr.getStopwords(StopwordList.SMART).contains("the")); }
@Test public void testFox() throws IOException { assertTrue(ssr.getStopwords(StopwordList.FOX).contains("the")); }
@Test public void testMySql() throws IOException { assertTrue(ssr.getStopwords(StopwordList.MYSQL).contains("the")); }
@Override @SuppressWarnings("unchecked") public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); Collection<String> stopwords = stopwordResource.getStopwords(stoplist); try { entityClass = BuilderUtils.getClassFromString( entityTypeClassName, SEMANTIC_ENTITY_PACKAGE, COMMON_ENTITY_PACKAGE); informationCollector = (InformationCollector) BuilderUtils.getClassFromString(informationCollectorClassName, COLLECTOR_PACKAGE) .newInstance(); candidateSupplier = (CandidateSupplier<T>) BuilderUtils.getClassFromString(candidateSupplierClassName, SUPPLIER_PACKAGE) .newInstance(); candidateSupplier.configure(candidateSupplierOptions); candidateRanker = (CandidateRanker<T>) BuilderUtils.getClassFromString(candidateRankerClassName, RANKER_PACKAGE) .newInstance(); candidateRanker.initialize(stopwords); } catch (Exception e) { throw new ResourceInitializationException(e); } }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); try { stopwords = stopwordResource.getStopwords(SharedStopwordResource.StopwordList.valueOf(stoplist)); } catch (IOException ioe) { getMonitor().error("Unable to load stopwords", ioe); throw new ResourceInitializationException(ioe); } write( "source", "id", "reference", "type", "value", "EntityCount then Entities... " + "then nonEntityNonStopWords (format word then pos) " + "then NonStopWordsNotCoveredByEntitiesCount " + "then (format word then pos)..."); }