@Test(expected = DependencyParseException.class) public void canSpotFormatError() throws DependencyParseException { String stringTree = "Root_NNP\n" + "\t\tchild11_NN\n"; DependencyTreeParser.readFromString(stringTree); }
public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } } }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }  }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }  static DependencyTree readFromString(String text); static DependencyTree readFromFile(String file); static DependencyTree readFromStream(InputStream is); }
DependencyTreeParser { public static DependencyTree readFromString(String text) throws DependencyParseException { try (ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes())) { return readFromStream(is); } catch (IOException e) { throw new RuntimeException("NO io to error, should not be thrown", e); } }  static DependencyTree readFromString(String text); static DependencyTree readFromFile(String file); static DependencyTree readFromStream(InputStream is);  }