On Fri, 13 Feb 2009, Jacob Floyd wrote:
My comments below.
Andi Vajda <va...@apache.org> wrote:
...
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.
...
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.
In the ebuild it is a simple matter to include other dependencies or
not based on the user's preference. If I were to allow the inclusion
of the jakarta-regexp package would I just have to add a "--classpath
{path to jakarta-regexp.jar}/regexp.jar" to the --build and --install
portions, or do you think that would work? Would I need to use
--include instead? or perhaps --exclude those particular classes?
It looks like these classes are not used unless one writes (or modifies)
their own version of SpanRegexQuery and RegexQuery to use these alternate
regex providers. In particular, I can't imagine them being used by JCC
directly. I don't see a need to generate wrappers for them.
Now, if you'd like to make it possible to keep these classes, the jar files
they depend on need to be findable by the Java VM when JCC generates
wrappers for the regex contrib package and at user runtime. Adding these
thirdparty jar files to JCC's --classpath arg should be enough. Using
--include would have the additional effect of installing these thirdparty
jar files inside the generated egg's resources which would be undesirable, I
think by leading to needless duplication with later hard to track down
potential version clashes.
Another use case for this, going back to the way it was done in the gcj
times, is to add another RegexCapabilities implementation that hooks into
Python's regex implementation. This would be done by implementing a subclass
of RegexCapabilities as a Python 'extension' as defined here:
http://lucene.apache.org/pylucene/jcc/documentation/readme.html#extensions
But this is off topic, I think.
Andi..