Hello Cristophe,
christophe leroy wrote:
> I need an Analyzer which doesn't separate the
> underscored words and with the StandardAnalyzer
> functionnalities.
> So, the solution is to create a new Analyzer .
>
> I have seen several mails about that. I tried to apply
> the proposed solutions but I have a problem.
[...]
> C:\Documents and
> Settings\CLEROY\Bureau\pb_lucene2\lucene-1.4.3-src\lucene-1.4.3
> \src\java\org\apache\lucene\analysis\standard>"C:\Documents
> and Settings\CLEROY\
> Bureau\pb_lucene2\javacc-4.0\javacc-4.0\bin\javacc"
> StandardTokenizer.jj
[...]
I don't know if your problem is being caused by this (though I suspect
it is -- see below), but the standard way to rebuild the JavaCC-based
parsers is via an ant target -- from Lucene's BUILD.txt:
- After JavaCC is installed, create a build.properties file
[...] and add the line
javacc.home=/javacc
where this points to the root directory of your javacc
installation (the directory that contains bin/lib/javacc.jar).
- To rebuild any of the JavaCC-based parsers, run "ant javacc".
So, your build.properties should contain (all on one line):
javacc.home = C:/Documents and
Settings/CLEROY/Bureau/pb_lucene2/javacc-4.0/javacc-4.0
----
The "javacc" ant target calls the "javacc-StandardAnalyzer" target,
which generates the source files in a temporary directory, then copies
them back where they need to be for compilation, in the process getting
rid of ParseException.java:
<target name="javacc-StandardAnalyzer"
depends="init,javacc-check"
if="javacc.present">
<!-- generate this in a build directory so we can exclude
ParseException -->
<mkdir dir="${build.dir}/gen/org/apache/lucene/analysis/standard"/>
<invoke-javacc
target="src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj"
outputDir="${build.dir}/gen/org/apache/lucene/analysis/standard"/>
<copy todir="src/java/org/apache/lucene/analysis/standard">
<fileset
dir="${build.dir}/gen/org/apache/lucene/analysis/standard">
<include name="*.java"/>
<exclude name="ParseException.java"/>
</fileset>
</copy>
</target>
Good luck,
Steve
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]