Examples of UkWacDependencyFileIterator


Examples of edu.ucla.sspace.text.UkWacDependencyFileIterator

* @author Keith Stevens
*/
public class PUkWacSentenceStripper {

    public static void main(String[] args) throws IOException {
        Iterator<Document> ukWacIter = new UkWacDependencyFileIterator(args[0]);

        PrintWriter writer = null;
        try {
          writer = new PrintWriter(args[1]);
          StringBuilder builder = new StringBuilder();
          DependencyExtractor extractor = new CoNLLDependencyExtractor();
          while (ukWacIter.hasNext()) {
              BufferedReader doc = ukWacIter.next().reader();
              for (DependencyTreeNode[] tree = null;
                   (tree = extractor.readNextTree(doc)) != null; ) {
                  for (DependencyTreeNode node : tree)
                      builder.append(node.word()).append(" ");
              }
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.