Search in sources :

Example 1 with SKOSEngineMock

use of at.ac.univie.mminf.luceneSKOS.skos.engine.mock.SKOSEngineMock in project lucene-skos by behas.

the class AbstractFilterTest method setUp.

@Before
protected void setUp() throws Exception {
    // adding some test data
    skosEngine = new SKOSEngineMock();
    skosEngine.addEntry("http://example.com/concept/1", SKOSType.PREF, "jumps");
    skosEngine.addEntry("http://example.com/concept/1", SKOSType.ALT, "leaps", "hops");
    skosEngine.addEntry("http://example.com/concept/2", SKOSType.PREF, "quick");
    skosEngine.addEntry("http://example.com/concept/2", SKOSType.ALT, "fast", "speedy");
    skosEngine.addEntry("http://example.com/concept/3", SKOSType.PREF, "over");
    skosEngine.addEntry("http://example.com/concept/3", SKOSType.ALT, "above");
    skosEngine.addEntry("http://example.com/concept/4", SKOSType.PREF, "lazy");
    skosEngine.addEntry("http://example.com/concept/4", SKOSType.ALT, "apathic", "sluggish");
    skosEngine.addEntry("http://example.com/concept/5", SKOSType.PREF, "dog");
    skosEngine.addEntry("http://example.com/concept/5", SKOSType.ALT, "canine", "pooch");
    skosEngine.addEntry("http://example.com/concept/6", SKOSType.PREF, "united nations");
    skosEngine.addEntry("http://example.com/concept/6", SKOSType.ALT, "UN");
    skosEngine.addEntry("http://example.com/concept/7", SKOSType.PREF, "lazy dog");
    skosEngine.addEntry("http://example.com/concept/7", SKOSType.ALT, "Odie");
    this.directory = new RAMDirectory();
}
Also used : SKOSEngineMock(at.ac.univie.mminf.luceneSKOS.skos.engine.mock.SKOSEngineMock) RAMDirectory(org.apache.lucene.store.RAMDirectory) Before(org.junit.Before)

Example 2 with SKOSEngineMock

use of at.ac.univie.mminf.luceneSKOS.skos.engine.mock.SKOSEngineMock in project lucene-skos by behas.

the class SKOSStandardQueryParserTest method setUp.

@Before
public void setUp() throws Exception {
    // adding some test data
    skosEngine = new SKOSEngineMock();
    skosEngine.addEntry("http://example.com/concept/1", SKOSType.PREF, "jumps");
    skosEngine.addEntry("http://example.com/concept/1", SKOSType.ALT, "leaps", "hops");
    skosEngine.addEntry("http://example.com/concept/2", SKOSType.PREF, "quick");
    skosEngine.addEntry("http://example.com/concept/2", SKOSType.ALT, "fast", "speedy");
    skosEngine.addEntry("http://example.com/concept/3", SKOSType.PREF, "over");
    skosEngine.addEntry("http://example.com/concept/3", SKOSType.ALT, "above");
    skosEngine.addEntry("http://example.com/concept/4", SKOSType.PREF, "lazy");
    skosEngine.addEntry("http://example.com/concept/4", SKOSType.ALT, "apathic", "sluggish");
    skosEngine.addEntry("http://example.com/concept/5", SKOSType.PREF, "dog");
    skosEngine.addEntry("http://example.com/concept/5", SKOSType.ALT, "canine", "pooch");
    skosEngine.addEntry("http://example.com/concept/6", SKOSType.PREF, "united nations");
    skosEngine.addEntry("http://example.com/concept/6", SKOSType.ALT, "UN");
    skosEngine.addEntry("http://example.com/concept/7", SKOSType.PREF, "lazy dog");
    skosEngine.addEntry("http://example.com/concept/7", SKOSType.ALT, "Odie");
    directory = new RAMDirectory();
    skosAnalyzer = new SKOSAnalyzer(skosEngine, ExpansionType.LABEL);
    writer = new IndexWriter(directory, new IndexWriterConfig(skosAnalyzer));
}
Also used : IndexWriter(org.apache.lucene.index.IndexWriter) SKOSEngineMock(at.ac.univie.mminf.luceneSKOS.skos.engine.mock.SKOSEngineMock) RAMDirectory(org.apache.lucene.store.RAMDirectory) SKOSAnalyzer(at.ac.univie.mminf.luceneSKOS.analysis.SKOSAnalyzer) IndexWriterConfig(org.apache.lucene.index.IndexWriterConfig) Before(org.junit.Before)

Aggregations

SKOSEngineMock (at.ac.univie.mminf.luceneSKOS.skos.engine.mock.SKOSEngineMock)2 RAMDirectory (org.apache.lucene.store.RAMDirectory)2 Before (org.junit.Before)2 SKOSAnalyzer (at.ac.univie.mminf.luceneSKOS.analysis.SKOSAnalyzer)1 IndexWriter (org.apache.lucene.index.IndexWriter)1 IndexWriterConfig (org.apache.lucene.index.IndexWriterConfig)1