public static Analyzer newTupleAnalyzer() { final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); final TupleAnalyzer analyzer = new TupleAnalyzer(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT), uriAnalyzer); return analyzer; }
public static Analyzer newJsonAnalyzer() { final AnyURIAnalyzer fieldAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); fieldAnalyzer.setUriNormalisation(URINormalisation.FULL); final Analyzer literalAnalyzer = new StandardAnalyzer(TEST_VERSION_CURRENT); final JsonAnalyzer analyzer = new JsonAnalyzer(TEST_VERSION_CURRENT, fieldAnalyzer, literalAnalyzer); return analyzer; }
@Override protected TupleAnalyzer getNodeAnalyzer() { final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); final TupleAnalyzer tupleAnalyzer = new TupleAnalyzer(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT), uriAnalyzer); tupleAnalyzer.registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); return tupleAnalyzer; }
@Override protected void configure() throws IOException { this.setAnalyzer(AnalyzerType.TUPLE); // TODO: remove when TupleAnalyzer is no more used final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); ((TupleAnalyzer) analyzer).registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.setPostingsFormat(PostingsFormatType.RANDOM); }
@Override protected void configure() throws IOException { this.setAnalyzer(AnalyzerType.TUPLE); // TODO: remove when TupleAnalyzer is no more used final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); ((TupleAnalyzer) analyzer).registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.setPostingsFormat(PostingsFormatType.RANDOM); }
@Override protected void configure() throws IOException { this.setAnalyzer(AnalyzerType.TUPLE); // TODO: remove when TupleAnalyzer is no more used final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); ((TupleAnalyzer) analyzer).registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.setPostingsFormat(PostingsFormatType.RANDOM); }
@Override protected void configure() throws IOException { this.setAnalyzer(AnalyzerType.TUPLE); // TODO: remove when TupleAnalyzer is no more used final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); ((TupleAnalyzer) analyzer).registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.setPostingsFormat(PostingsFormatType.RANDOM); }
@Override protected void configure() throws IOException { this.setAnalyzer(AnalyzerType.TUPLE); // TODO: remove when TupleAnalyzer is no more used final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); ((TupleAnalyzer) analyzer).registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.setPostingsFormat(PostingsFormatType.RANDOM); }
/** * Test the local URINormalisation: the word "the" is a stop word, hence it is * filtered. The position increment is updated accordingly, but it is not reset for * future calls. Corrects issue SRN-117. * @throws Exception */ @Test public void testURINormalisation() throws Exception { final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.LOCALNAME); _a = new TupleAnalyzer(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT), uriAnalyzer); _a.registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.assertAnalyzesTo(_a, "<http://dbpedia.org/resource/The_Kingston_Trio>", new String[] { "kingston", "trio", "the_kingston_trio", "http://dbpedia.org/resource/the_kingston_trio" }, new String[] { "word", "word", "word", "word" }, new int[] { 2, 1, 0, 0 }); }
/** * The same, with Full normalisation -- the stop word is now "their" because in * {@link URINormalisationFilter}, there is inside a filter of words smaller * than 4 (it was 3 for {@link URILocalnameFilter}. * @throws Exception */ @Test public void testURINormalisation2() throws Exception { final AnyURIAnalyzer uriAnalyzer = new AnyURIAnalyzer(TEST_VERSION_CURRENT); uriAnalyzer.setUriNormalisation(URINormalisation.FULL); _a = new TupleAnalyzer(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT), uriAnalyzer); _a.registerDatatype(XSDDatatype.XSD_ANY_URI.toCharArray(), uriAnalyzer); this.assertAnalyzesTo(_a, "<http://dbpedia.org/resource/their_Kingston_Trio>", new String[] { "dbpedia", "resource", "kingston", "trio", "http://dbpedia.org/resource/their_kingston_trio" }, new String[] { "word", "word", "word", "word", "word" }, new int[] { 1, 1, 2, 1, 0 }); }