@Test public void testCompatibility() throws IOException { InputStream inputStream = ZawgyiDetector.class.getResourceAsStream("/com/google/myanmartools/compatibility.tsv"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); String line = null; while ((line = reader.readLine()) != null) { int tabIdx = line.indexOf('\t'); double expected = Double.parseDouble(line.substring(0, tabIdx)); String input = line.substring(tabIdx + 1); double actual = detector.getZawgyiProbability(input); try { if (Double.isInfinite(expected)) { assertWithMessage(line).that(actual).isEqualTo(expected); } else { assertWithMessage(line).that(actual).isWithin(1e-6).of(expected); } } catch (AssertionError e) { detector.getZawgyiProbability(input, true); throw e; } } reader.close(); }
public double getZawgyiProbability(String input, boolean verbose) { return model.predict(input, verbose); }
ZawgyiDetector { public double getZawgyiProbability(String input, boolean verbose) { return model.predict(input, verbose); } }
ZawgyiDetector { public double getZawgyiProbability(String input, boolean verbose) { return model.predict(input, verbose); } ZawgyiDetector();   ZawgyiDetector(InputStream inStream); }
ZawgyiDetector { public double getZawgyiProbability(String input, boolean verbose) { return model.predict(input, verbose); } ZawgyiDetector();   ZawgyiDetector(InputStream inStream); double getZawgyiProbability(String input, boolean verbose); double getZawgyiProbability(String input); }
ZawgyiDetector { public double getZawgyiProbability(String input, boolean verbose) { return model.predict(input, verbose); } ZawgyiDetector();   ZawgyiDetector(InputStream inStream); double getZawgyiProbability(String input, boolean verbose); double getZawgyiProbability(String input);  }