void assertUnParseable(String... words) { SimpleParser parser = new SimpleParser(graph); for (String word : words) { List<ParseResult> results = parser.parse(word); Assert.assertTrue( "Unexpected parse for:" + word + " parse:" + results, results.size() == 0); } }
void assertUnParseable(Suffix suffix, String... words) { SimpleParser parser = new SimpleParser(graph); for (String word : words) { List<ParseResult> results = parser.parse(word); for (ParseResult result : results) { Assert.assertFalse( word + " parse should not contain suffix:" + suffix.id + " parse:" + results, result.getSuffixNodes().contains(suffix)); } } }
void assertHasParses(String... words) { SimpleParser parser = new SimpleParser(graph); for (String word : words) { List<ParseResult> results = parser.parse(word); if (results.size() == 0) parser.dump(word); Assert.assertTrue("No parse for:" + word, results.size() > 0); for (ParseResult result : results) { System.out.println(word + "= " + result.asParseString()); } } }