Colen,
Have a closer look at the code on this. The changes you made seem to
suggest you want to keep the old behavior for the tests. What we should
probably do is go through all the classes that have case sensitivity
flags, I know there are more, and create two classes for each test. One
created with case (true) and the other with (false) and test both
situations with expected outcomes.
James
On 7/20/2011 10:04 PM, [email protected] wrote:
Author: colen
Date: Thu Jul 21 02:04:27 2011
New Revision: 1149006
URL: http://svn.apache.org/viewvc?rev=1149006&view=rev
Log:
OPENNLP-234 Abbreviation dictionar should be case sensitive by default.
Modified:
incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/dictionary/AbbreviationDictionary.java
incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/dictionary/AbbreviationDictionaryTest.java
Modified:
incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/dictionary/AbbreviationDictionary.java
URL:
http://svn.apache.org/viewvc/incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/dictionary/AbbreviationDictionary.java?rev=1149006&r1=1149005&r2=1149006&view=diff
==============================================================================
---
incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/dictionary/AbbreviationDictionary.java
(original)
+++
incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/dictionary/AbbreviationDictionary.java
Thu Jul 21 02:04:27 2011
@@ -93,10 +93,10 @@ public class AbbreviationDictionary exte
private Set<StringWrapper> entrySet = new HashSet<StringWrapper>();
/**
- * Initializes an empty case insensitive {@link AbbreviationDictionary}.
+ * Initializes an empty case sensitive {@link AbbreviationDictionary}.
*/
public AbbreviationDictionary() {
- this(false);
+ this(true);
}
/**
@@ -110,7 +110,7 @@ public class AbbreviationDictionary exte
}
/**
- * Initializes a case insensitive {@link AbbreviationDictionary} from an
existing
+ * Initializes a case sensitive {@link AbbreviationDictionary} from an
existing
* dictionary resource.
*
* @param in
@@ -120,11 +120,11 @@ public class AbbreviationDictionary exte
*/
public AbbreviationDictionary(InputStream in) throws IOException,
InvalidFormatException {
- this(in, false);
+ this(in, true);
}
/**
- * Initializes a case insensitive {@link AbbreviationDictionary} from an
existing
+ * Initializes a {@link AbbreviationDictionary} from an existing
* dictionary resource.
*
* @param in
Modified:
incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/dictionary/AbbreviationDictionaryTest.java
URL:
http://svn.apache.org/viewvc/incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/dictionary/AbbreviationDictionaryTest.java?rev=1149006&r1=1149005&r2=1149006&view=diff
==============================================================================
---
incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/dictionary/AbbreviationDictionaryTest.java
(original)
+++
incubator/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/dictionary/AbbreviationDictionaryTest.java
Thu Jul 21 02:04:27 2011
@@ -146,7 +146,7 @@ public class AbbreviationDictionaryTest
String entry1 = "1a";
String entry2 = "1A";
- AbbreviationDictionary dict = new AbbreviationDictionary();
+ AbbreviationDictionary dict = new AbbreviationDictionary(false);
dict.add(entry1);
@@ -157,7 +157,7 @@ public class AbbreviationDictionaryTest
* Tests the lookup of tokens of different case.
*/
@Test
- public void testDifferentCaseLookupCaseInsensitive() {
+ public void testDifferentCaseLookupCaseSensitive() {
String entry1 = "1a";
String entry2 = "1A";