use of org.apache.stanbol.commons.solr.utils.DataFileResourceLoader in project stanbol by apache.
the class TestKuromojiNlpEngine method setUpServices.
@Before
public void setUpServices() throws IOException, ConfigurationException {
engine = new KuromojiNlpEngine();
//we need to set some fields that would otherwise be injected by the container
engine.parentResourceLoader = new DataFileResourceLoader(dataFileProvider);
engine.analysedTextFactory = AnalysedTextFactory.getDefaultInstance();
Dictionary<String, Object> config = new Hashtable<String, Object>();
config.put(EnhancementEngine.PROPERTY_NAME, "gosen-nlp");
engine.activate(new MockComponentContext(config));
contentItem = contentItemFactory.createContentItem(id, new StringSource(text));
//add an annotation that this is Japanese
contentItem.getMetadata().add(new TripleImpl(id, Properties.DC_LANGUAGE, new PlainLiteralImpl("ja")));
}
Aggregations