Added a test case that runs almost all the tsheg bars from all
non-reference, publicly available ACIP files (hundreds of megabytes of them) through the converter. The frequencies of these tsheg bars in in the file, too.
This commit is contained in:
parent
7ba1ad0735
commit
31b3020d07
8 changed files with 23771 additions and 7 deletions
|
@ -419,6 +419,11 @@ Contributor(s): ______________________________________.
|
||||||
<param name="my.included.source.file"
|
<param name="my.included.source.file"
|
||||||
value="org/thdl/tib/text/ttt/PackageTest.java"/>
|
value="org/thdl/tib/text/ttt/PackageTest.java"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
|
<antcall target="our-internal-javac-task">
|
||||||
|
<param name="mybin" value="${junitbin}"/>
|
||||||
|
<param name="my.included.source.file"
|
||||||
|
value="org/thdl/tib/text/ttt/LotsOfTshegBarsTest.java"/>
|
||||||
|
</antcall>
|
||||||
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
|
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
|
||||||
<param name="mybin" value="${junitbin}"/>
|
<param name="mybin" value="${junitbin}"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
build.xml check-report' will fail. -->
|
build.xml check-report' will fail. -->
|
||||||
<sysproperty key="java.awt.headless" value="true"/>
|
<sysproperty key="java.awt.headless" value="true"/>
|
||||||
<test name="org.thdl.tib.text.ttt.PackageTest"/>
|
<test name="org.thdl.tib.text.ttt.PackageTest"/>
|
||||||
|
<test name="org.thdl.tib.text.ttt.LotsOfTshegBarsTest"/>
|
||||||
<test name="org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIETest"/>
|
<test name="org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIETest"/>
|
||||||
<test name="org.thdl.util.RTFFixerInputStreamTest"/>
|
<test name="org.thdl.util.RTFFixerInputStreamTest"/>
|
||||||
<test name="org.thdl.util.ThdlLazyExceptionTest"/>
|
<test name="org.thdl.util.ThdlLazyExceptionTest"/>
|
||||||
|
|
|
@ -245,6 +245,9 @@ public class TibetanConverter implements FontConverterConstants {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
return 4;
|
return 4;
|
||||||
|
} catch (OutOfMemoryError e) {
|
||||||
|
e.printStackTrace(out);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
23753
source/org/thdl/tib/text/ttt/LotsOfTshegBarsTest.java
Normal file
23753
source/org/thdl/tib/text/ttt/LotsOfTshegBarsTest.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -51,7 +51,7 @@ public class PackageTest extends TestCase {
|
||||||
|
|
||||||
|
|
||||||
public PackageTest() { }
|
public PackageTest() { }
|
||||||
private static void tstHelper(String acip) {
|
static void tstHelper(String acip) {
|
||||||
tstHelper2(acip, null, false, null, null, null, 0);
|
tstHelper2(acip, null, false, null, null, null, 0);
|
||||||
}
|
}
|
||||||
private static void tstHelper(String acip, String expectedPairs) {
|
private static void tstHelper(String acip, String expectedPairs) {
|
||||||
|
|
|
@ -317,7 +317,7 @@ class TParseTree {
|
||||||
if (warningLevel == "All")
|
if (warningLevel == "All")
|
||||||
return "Warning: The last stack does not have a vowel in the ACIP {" + ((null != originalACIP) ? originalACIP : recoverACIP()) + "}; this may indicate a typo, because Sanskrit, which this is (because it's not legal Tibetan), should have a vowel after each stack.";
|
return "Warning: The last stack does not have a vowel in the ACIP {" + ((null != originalACIP) ? originalACIP : recoverACIP()) + "}; this may indicate a typo, because Sanskrit, which this is (because it's not legal Tibetan), should have a vowel after each stack.";
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Can't happen now that we stack greedily");
|
return "Warning: Trying to stack non-consonants."; // DLC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,8 +213,9 @@ class TStackList {
|
||||||
&& l.charAt(0) >= '0' && l.charAt(0) <= '9')) {
|
&& l.charAt(0) >= '0' && l.charAt(0) <= '9')) {
|
||||||
if (null != isLastStack) {
|
if (null != isLastStack) {
|
||||||
isLastStack[0] = (i + 1 == size());
|
isLastStack[0] = (i + 1 == size());
|
||||||
if (!isLastStack[0])
|
if (!isLastStack[0]) {
|
||||||
throw new Error("But we now stack greedily!");
|
System.err.println("DLC NOW: But we now stack greedily! '7 and B5 cause trouble, though, e.g. " + this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.thdl.tib.text.ttt;
|
||||||
import org.thdl.util.ThdlOptions;
|
import org.thdl.util.ThdlOptions;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An TString is some Latin text and a type, the type stating whether
|
* An TString is some Latin text and a type, the type stating whether
|
||||||
|
@ -130,15 +131,15 @@ public class TString {
|
||||||
outputTshegBar(ftext);
|
outputTshegBar(ftext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Prints x to standard output if and only if we have never
|
/** Prints x to standard error if and only if we have never
|
||||||
encountered x before. */
|
encountered x before. */
|
||||||
private static void outputTshegBar(String x) {
|
private static void outputTshegBar(String x) {
|
||||||
if (outputAllTshegBars) {
|
if (outputAllTshegBars) {
|
||||||
System.out.println(outputTshegBarsPrefix + x);
|
System.err.println(outputTshegBarsPrefix + x);
|
||||||
} else if (outputUniqueTshegBars) {
|
} else if (outputUniqueTshegBars) {
|
||||||
if (!tshegBars.contains(x)) {
|
if (!tshegBars.contains(x)) {
|
||||||
tshegBars.add(x);
|
tshegBars.add(x);
|
||||||
System.out.println(outputTshegBarsPrefix + x);
|
System.err.println(outputTshegBarsPrefix + x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue