public static TreeListFactory makeFromReaders (FactorGraph fg, List readerList) { List treeList = new ArrayList (); for (Iterator it = readerList.iterator (); it.hasNext ();) { try { Reader reader = (Reader) it.next (); Document doc = new SAXBuilder ().build (reader); Element treeElt = doc.getRootElement (); Element rootElt = (Element) treeElt.getChildren ().get (0); Tree tree = readTreeRec (fg, rootElt); System.out.println (tree.dumpToString ()); treeList.add (tree); } catch (JDOMException e) { throw new RuntimeException (e); } catch (IOException e) { throw new RuntimeException (e); } } return new TreeListFactory (treeList); }
public static TreeListFactory makeFromReaders (FactorGraph fg, List readerList) { List treeList = new ArrayList (); for (Iterator it = readerList.iterator (); it.hasNext ();) { try { Reader reader = (Reader) it.next (); Document doc = new SAXBuilder ().build (reader); Element treeElt = doc.getRootElement (); Element rootElt = (Element) treeElt.getChildren ().get (0); Tree tree = readTreeRec (fg, rootElt); System.out.println (tree.dumpToString ()); treeList.add (tree); } catch (JDOMException e) { throw new RuntimeException (e); } catch (IOException e) { throw new RuntimeException (e); } } return new TreeListFactory (treeList); }
public static TreeListFactory makeFromReaders (FactorGraph fg, List readerList) { List treeList = new ArrayList (); for (Iterator it = readerList.iterator (); it.hasNext ();) { try { Reader reader = (Reader) it.next (); Document doc = new SAXBuilder ().build (reader); Element treeElt = doc.getRootElement (); Element rootElt = (Element) treeElt.getChildren ().get (0); Tree tree = readTreeRec (fg, rootElt); System.out.println (tree.dumpToString ()); treeList.add (tree); } catch (JDOMException e) { throw new RuntimeException (e); } catch (IOException e) { throw new RuntimeException (e); } } return new TreeListFactory (treeList); }