Package com.clearnlp.reader

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


  }
 
  public void countDEP(String[] args) throws Exception
  {
    DEPReader reader = new DEPReader(0, 1, 2, 3, 4, 6, 7);
    reader.open(UTInput.createBufferedFileReader(args[0]));
    Prob1DMap map = new Prob1DMap();
    int[] count = {0, 0};
    DEPTree tree;
   
    while ((tree = reader.next()) != null)
View Full Code Here


    int i, size;
    String str;
   
    for (String filename : UTFile.getInputFileList(trainPath, ".*.std"))
    {
      reader.open(UTInput.createBufferedFileReader(filename));
     
      while ((tree = reader.next()) != null)
      {
        size = tree.size();
       
View Full Code Here

      reader.close();
    }
   
    for (String filename : UTFile.getInputFileList(testPath, ".*.std"))
    {
      reader.open(UTInput.createBufferedFileReader(filename));
     
      while ((tree = reader.next()) != null)
      {
        size = tree.size();
       
View Full Code Here

  }
 
  void getVerbForms(String[] args)
  {
    DEPReader fin = new DEPReader(0, 1, 2, 3, 4, 5, 6);
    fin.open(UTInput.createBufferedFileReader(args[0]));
    Set<String> keys = new TreeSet<String>();
    Prob2DMap mVBD = new Prob2DMap();
    Prob2DMap mVBN = new Prob2DMap();
    String form, base, past, part;
    int i, size, cutoff = 1;
View Full Code Here

 
  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

  }
 
  void getVerbForms(String[] args)
  {
    DEPReader fin = new DEPReader(0, 1, 2, 3, 4, 5, 6);
    fin.open(UTInput.createBufferedFileReader(args[0]));
    Set<String> keys = new TreeSet<String>();
    Prob2DMap mVBD = new Prob2DMap();
    Prob2DMap mVBN = new Prob2DMap();
    String form, base, past, part;
    int i, size, cutoff = 1;
View Full Code Here

 
  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

  }
 
  void getVerbForms(String[] args)
  {
    DEPReader fin = new DEPReader(0, 1, 2, 3, 4, 5, 6);
    fin.open(UTInput.createBufferedFileReader(args[0]));
    Set<String> keys = new TreeSet<String>();
    Prob2DMap mVBD = new Prob2DMap();
    Prob2DMap mVBN = new Prob2DMap();
    String form, base, past, part;
    int i, size, cutoff = 1;
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.