Package com.clearnlp.reader

Examples of com.clearnlp.reader.DEPReader.open()


 
  void countLR(String inputFile)
  {
  //  DEPReader reader = new DEPReader(0, 1, 2, 3, 5, 6, 7);
    DEPReader reader = new DEPReader(0, 1, 2, 4, 6, 8, 10);
    reader.open(UTInput.createBufferedFileReader(inputFile));
    int i, size, left = 0, right = 0, l, r, prevId, depId;
    DEPTree tree;
    DEPNode node;
   
    while ((tree = reader.next()) != null)
View Full Code Here


  void projectivize(String inputFile, String outputFile)
  {
    DEPReader reader = new DEPReader(0, 1, 2, 4, 6, 8, 10);
    DEPTree tree;
   
    reader.open(UTInput.createBufferedFileReader(inputFile));
    PrintStream fold = UTOutput.createPrintBufferedFileStream(outputFile+".old");
    PrintStream fnew = UTOutput.createPrintBufferedFileStream(outputFile+".new");
    int i;
   
    for (i=0; (tree = reader.next()) != null; i++)
View Full Code Here

    DEPReader gReader = new DEPReader(0, 1, 2, 4, 6, 7, 9);
    DEPReader sReader = new DEPReader(0, 1, 3, 5, 6, 8, 10);
    DEPTree gTree, sTree;
   
    gReader.open(UTInput.createBufferedFileReader(mergeFile));
    sReader.open(UTInput.createBufferedFileReader(mergeFile));
   
    String[] errors = {
        "sHead is a dependent       of gHead",
        "sHead is a grand-dependent of gHead",
        "gHead is a sibling         of sHead",
View Full Code Here

 
  public void assign(String depFile, String tpcFile, String outFile, int threshold) throws IOException
  {
    List<List<String[]>> topics = getTopics(tpcFile, threshold);
    DEPReader reader = new DEPReader(0, 1, 2, 3, 4, 5, 6);
    reader.open(UTInput.createBufferedFileReader(depFile));
    PrintStream fout = UTOutput.createPrintBufferedFileStream(outFile);
    IntOpenHashSet[] sets;
    StringBuilder build;
    IntOpenHashSet set;
    int[] indices;
View Full Code Here

    for (i=0; i<fout.length; i++)
      fout[i] = UTOutput.createPrintBufferedFileStream(args[1]+File.separator+i+".dep");
   
    for (String filename : filelist)
    {
      reader.open(UTInput.createBufferedFileReader(filename));
     
      while ((tree = reader.next()) != null)
      {
        i = (tree.size() > 101) ? 9 : (tree.size()-2) / 10;
        fout[i].println(tree.toStringCoNLL()+"\n");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.