Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 7783 invoked from network); 19 Sep 2002 19:51:16 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Sep 2002 19:51:16 -0000 Received: (qmail 19161 invoked by uid 97); 19 Sep 2002 19:50:44 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 19108 invoked by uid 97); 19 Sep 2002 19:50:43 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 19061 invoked by uid 98); 19 Sep 2002 19:50:42 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Subject: [patch] [betwixt] From: John Thorhauer To: Jakarta Commons Developers List Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 19 Sep 2002 15:49:41 -0400 Message-Id: <1032464982.2002.0.camel@thor.zenplex.com> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I have a patch for betwixt. The problem that I am having is with the DefaultPluralStemmer. It does not deal real well with plurals that end in 'es'. I have included a patch for both the test case and the patch for the DefaultPluralStemmer. If you run the test without applying the fix you will see the problem. Could someone please apply this? Index: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy/DefaultPluralStemmer.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy/DefaultPluralStemmer.java,v retrieving revision 1.2 diff -r1.2 DefaultPluralStemmer.java 92a93,97 > > if ( answer == null && !propertyName.endsWith( "y" )) { > answer = (ElementDescriptor) map.get( propertyName + "es" ); > } > 129c134 < log.warn("More then one type matches, using closest match "+keyFound); --- > log.warn("More than one type matches, using closest match "+keyFound); Index: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/strategy/TestDefaultPluralStemmer.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/strategy/TestDefaultPluralStemmer.java,v retrieving revision 1.1 diff -r1.1 TestDefaultPluralStemmer.java 154c154 < --- > 181c181,205 < --- > > /** > * Test to find matched where plural ending is "es" > */ > public void testESPluralEndingMatch() { > HashMap map = new HashMap(); > > ElementDescriptor index = new ElementDescriptor("index", "index",""); > map.put("index", index); > ElementDescriptor indexes = new ElementDescriptor("indexes", "indexes",""); > map.put("indexes", indexes); > > ElementDescriptor patch = new ElementDescriptor("patch", "patch",""); > map.put("patch", patch); > ElementDescriptor patches = new ElementDescriptor("patches", "patches",""); > map.put("patches", patches); > > DefaultPluralStemmer stemmer = new DefaultPluralStemmer(); > ElementDescriptor result = stemmer.findPluralDescriptor("index", map); > assertEquals(indexes, result); > > result = stemmer.findPluralDescriptor("patches", map); > assertEquals(patches, result); > } > Thanks, John -- ******************************** ** John Thorhauer ** john@zenplex.com ** take a look at: ** http://tambora.zenplex.org ** http://www.zenplex.org ** http://www.zenplex.com ******************************** -- ******************************** ** John Thorhauer ** john@zenplex.com ** take a look at: ** http://tambora.zenplex.org ** http://www.zenplex.org ** http://www.zenplex.com ******************************** -- To unsubscribe, e-mail: For additional commands, e-mail: