You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by si...@apache.org on 2009/11/25 21:44:17 UTC
svn commit: r884259 - in /lucene/java/trunk/contrib/regex/src:
java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java
test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java
Author: simonw
Date: Wed Nov 25 20:44:17 2009
New Revision: 884259
URL: http://svn.apache.org/viewvc?rev=884259&view=rev
Log:
Updated JakartaRegexpCapabilities JavaDoc which gave users the impression the JakartaRegexp implementation provides a rock solid "prefix" implementation. Patch contains another testcase which shows the shaky behavior. See LUCENE-2072 for reference.
Modified:
lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java
lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java
Modified: lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java?rev=884259&r1=884258&r2=884259&view=diff
==============================================================================
--- lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java (original)
+++ lucene/java/trunk/contrib/regex/src/java/org/apache/lucene/search/regex/JakartaRegexpCapabilities.java Wed Nov 25 20:44:17 2009
@@ -21,9 +21,11 @@
import org.apache.regexp.RegexpTunnel;
/**
- * Implementation tying <a href="http://jakarta.apache.org/regexp">Jakarta Regexp</a>
- * to RegexQuery. Thanks to some internals of Jakarta Regexp, this
- * has a solid {@link #prefix} implementation.
+ * Implementation tying <a href="http://jakarta.apache.org/regexp">Jakarta
+ * Regexp</a> to RegexQuery. Jakarta Regepx internally supports a
+ * {@link #prefix} implementation which can offer performance gains under
+ * certain circumstances. Yet, the implementation appears to be rather shaky as
+ * it doesn't always provide a prefix even if one would exist.
*/
public class JakartaRegexpCapabilities implements RegexCapabilities {
private RE regexp;
Modified: lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java?rev=884259&r1=884258&r2=884259&view=diff
==============================================================================
--- lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java (original)
+++ lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestJakartaRegexpCapabilities.java Wed Nov 25 20:44:17 2009
@@ -34,4 +34,13 @@
assertTrue(cap.match("lucene"));
assertEquals("lucene", cap.prefix());
}
+
+ public void testShakyPrefix(){
+ JakartaRegexpCapabilities cap = new JakartaRegexpCapabilities();
+ cap.compile("(ab|ac)");
+ assertTrue(cap.match("ab"));
+ assertTrue(cap.match("ac"));
+ // why is it not a???
+ assertNull(cap.prefix());
+ }
}