Package edu.stanford.nlp.trees.international.french

Examples of edu.stanford.nlp.trees.international.french.FrenchXMLTreeReader


    for (String filename : filenames) {
      File file = new File(filename);
      String canonicalFilename =
        file.getName().substring(0, file.getName().lastIndexOf('.'));

      FrenchXMLTreeReader tr = (FrenchXMLTreeReader)
        trf.newTreeReader(new BufferedReader
                          (new InputStreamReader
                           (new FileInputStream(file),"ISO8859_1")));

      Tree t = null;
      int numTrees;
      for (numTrees = 0; (t = tr.readTree()) != null; numTrees++) {
        String id = canonicalFilename + "-" + ((CoreLabel) t.label()).get(CoreAnnotations.SentenceIDAnnotation.class);
        treeMap.put(id, t);
      }

      tr.close();
      System.err.printf("%s: %d trees%n", file.getName(), numTrees);
    }
    return treeMap;
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.trees.international.french.FrenchXMLTreeReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.