lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com>
Subject Re: Recommend a example to implement an analyzer with parsing Camelcase
Date Sun, 07 Feb 2010 16:37:52 GMT

> Hi Ahmet,
> I have ever known WordDelimiterFilterFactory, but never use
> Solr.
> But how to download this class.

http://repo1.maven.org/maven2/org/apache/solr/solr-core/1.4.0/

> Can I use it in Lucene 3.0, or extends Analyzer with
> overloading its
> methods.

It is not using new token stream API yet, but you can use it. WordDelimiterFilter is package-private
but you can use its factory as follows: 

Map<String, String> delimeterArgs = new HashMap<String, String>(9);

 delimeterArgs.put("generateWordParts", "1");
 delimeterArgs.put("generateNumberParts", "0");
 delimeterArgs.put("catenateWords", "0");
 delimeterArgs.put("catenateNumbers", "0");
 delimeterArgs.put("catenateAll", "0");
 delimeterArgs.put("splitOnCaseChange", "0");
 delimeterArgs.put("splitOnNumerics", "1");
 delimeterArgs.put("preserveOriginal", "1");
 delimeterArgs.put("stemEnglishPossessive", "0");

WordDelimiterFilterFactory wordDelimiterFactory = new WordDelimiterFilterFactory();

wordDelimiterFactory.init(delimeterArgs);

You can appned it to your analyzer chain:

result = wordDelimiterFactory.create(result);

Explanations of parameters are explained in the wiki.


      


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message