commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Thorhauer <j...@zenplex.com>
Subject [patch] [betwixt]
Date Thu, 19 Sep 2002 19:49:41 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message