summaryrefslogtreecommitdiff
path: root/src/examples/java/bjc/inflexion/InflexionTester.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2017-04-04 20:42:47 -0400
committerbjculkin <bjculkin@mix.wvu.edu>2017-04-04 20:42:47 -0400
commit128bc87156e42a75c4cdc5fa9ead725253855677 (patch)
tree7697cd245fb87c943d721b0a7f87b041cea1292f /src/examples/java/bjc/inflexion/InflexionTester.java
parent7b56beefe4df24acd8437bf42262e7cd30d43970 (diff)
Add test output
Also, some plural fixes
Diffstat (limited to 'src/examples/java/bjc/inflexion/InflexionTester.java')
-rw-r--r--src/examples/java/bjc/inflexion/InflexionTester.java45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/examples/java/bjc/inflexion/InflexionTester.java b/src/examples/java/bjc/inflexion/InflexionTester.java
index a11d168..ef34ea7 100644
--- a/src/examples/java/bjc/inflexion/InflexionTester.java
+++ b/src/examples/java/bjc/inflexion/InflexionTester.java
@@ -60,24 +60,24 @@ public class InflexionTester {
wikitest(scn, nounDB);
- /*System.out.print("Enter a noun to inflect (blank line to quit): ");
- String ln = scn.nextLine().trim();
-
- while(!ln.equals("")) {
- System.out.println();
-
- Noun noun = nounDB.getNoun(ln);
-
- if(noun == null) {
- System.out.println("No inflection available for noun " + ln);
- } else {
- System.out.printf(OUTPUT_FMT, ln, noun.singular(), noun.modernPlural(),
- noun.classicalPlural());
- }
-
- System.out.print("Enter a noun to inflect (blank line to quit): ");
- ln = scn.nextLine().trim();
- }*/
+ /*
+ * System.out.
+ * print("Enter a noun to inflect (blank line to quit): ");
+ * String ln = scn.nextLine().trim();
+ *
+ * while(!ln.equals("")) { System.out.println();
+ *
+ * Noun noun = nounDB.getNoun(ln);
+ *
+ * if(noun == null) {
+ * System.out.println("No inflection available for noun " + ln);
+ * } else { System.out.printf(OUTPUT_FMT, ln, noun.singular(),
+ * noun.modernPlural(), noun.classicalPlural()); }
+ *
+ * System.out.
+ * print("Enter a noun to inflect (blank line to quit): "); ln =
+ * scn.nextLine().trim(); }
+ */
scn.close();
}
@@ -199,7 +199,7 @@ public class InflexionTester {
}
if(!ok) {
- wrong++;
+ if(!uncountable) wrong++;
if(uncountable) {
wrongUncountable++;
} else if(noPlural) {
@@ -210,7 +210,7 @@ public class InflexionTester {
+ calculatedPlural + ", but expected "
+ enNounMatcher.group(1));
basicWrong++;
- } else {
+ } else if(!uncountable) {
System.out.println(word + " got: " + calculatedPlural
+ ", but expected " + enNounMatcher.group(1));
}
@@ -222,15 +222,12 @@ public class InflexionTester {
float correct = (count - wrong) * 100 / (float) count;
float basicCorrect = (basicCount - basicWrong) * 100 / (float) basicCount;
- float wrongUncountablePercent = wrongUncountable * 100 / (float) count;
float wrongNoPluralPercent = wrongNoPlural * 100 / (float) count;
- int justPlainWrong = wrong - wrongUncountable - wrongNoPlural;
+ int justPlainWrong = wrong - wrongNoPlural;
float justPlainWrongPercent = justPlainWrong * 100 / (float) count;
System.out.println("Words checked: " + count + " (" + basicCount + " basic words)");
System.out.println("Correct: " + correct + "% (" + basicCorrect + "% basic words)");
System.out.println("Errors: ");
- System.out.println(
- " Uncountable: " + wrongUncountable + " (" + wrongUncountablePercent + "%)");
System.out.println(" No plural form specified: " + wrongNoPlural + " ("
+ wrongNoPluralPercent + "%)");
System.out.println(" Incorrect answer: " + justPlainWrong + " (" + justPlainWrongPercent