On Thu, 12 Feb 2009, Andi Vajda wrote:
On Thu, 12 Feb 2009, Jacob Floyd wrote:
Simple question regarding the Makefile:
--- snippet ---
$(REGEX_JAR): $(LUCENE_JAR)
rm -f
$(LUCENE)/contrib/regex/src/java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java
rm -f
$(LUCENE)/contrib/regex/src/java/org/apache/regexp/RegexpTunnel.java
cd $(LUCENE)/contrib/regex; $(ANT) -Dversion=$(LUCENE_VER)
--- snippet ---
Why was it necessary to remove these .java files? Is this a change
that needs to become part of lucene itself?
These file depend on yet another thirdparty project, Apache Regex (?), and I
didn't want to have a dependency on that. Given that Python has excellent
regular expression support, I replaced these files with a Python-based
implementation.
It turns out that the Python implementation is currently missing in PyLucene
(and has been since the move to JCC). I should have that resurrected shortly
but it involves a patch to the Lucene Regex contrib package. You might want
to consider skipping that contrib package in your ebuild.
Correction: I replied too fast, sorry. The Python implementation indeed
existed in the gcj times but in the current PyLucene, the default
JavaUtilRegexCapabilities class is used and works just fine. The gcj java
runtime library, libgcj, didn't have support for regex implemented at the
time so I had to use Python's instead. The test/test_RegexQuery.py test
passes and illustrates the functionality.
Still, I removed the two files you asked about because they depend on third
party libraries that I didn't want PyLucene to depend on.
In other words, contrary to what I wrote earlier, you can include the regex
contrib with your PyLucene ebuild. No extra dependencies or patches are
necessary provided these two files are removed first.
Andi..