Package edu.ucla.sspace.dependency

Examples of edu.ucla.sspace.dependency.DependencyExtractor


        Stemmer stemmer = argOptions.getObjectOption("stemmingAlgorithm", null);
        String format = argOptions.getStringOption(
            "dependencyParseFormat", "CoNLL");

        if (format.equals("CoNLL")) {
            DependencyExtractor e = (argOptions.hasOption('G'))
                ? new CoNLLDependencyExtractor(argOptions.getStringOption('G'),
                                               filter, stemmer)
                : new CoNLLDependencyExtractor(filter, stemmer);
            DependencyExtractorManager.addExtractor("CoNLL", e, true);
        } else if (format.equals("WaCKy")) {
            if (argOptions.hasOption('G'))
                throw new IllegalArgumentException(
                    "WaCKy does not support configuration with -G");
            DependencyExtractor e =
                new WaCKyDependencyExtractor(filter, stemmer);
            DependencyExtractorManager.addExtractor("WaCKy", e, true);
        } else
            throw new IllegalArgumentException(
                "Unrecognized dependency parsed format: " + format);
View Full Code Here


            combinor = ReflectionUtil.getObjectInstance(
                    argOptions.getStringOption("vectorCombinor"));
        else
            combinor = new PointWiseCombinor();

        DependencyExtractor extractor =
            DependencyExtractorManager.getDefaultExtractor();
        return new StructuredVectorSpace(extractor, acceptor, combinor);
    }
View Full Code Here

        String format = options.getStringOption(
                "dependencyParseFormat", "CoNLL");

        // setup the dependency extractor.
        DependencyExtractor e = null;
        if (format.equals("CoNLL"))
            e = new CoNLLDependencyExtractor(filter, stemmer);
        else if (format.equals("WaCKy"))
            e = new WaCKyDependencyExtractor(filter, stemmer);
View Full Code Here

        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(" ");
              }
              writer.println(builder.toString());
              builder = new StringBuilder();
View Full Code Here

        TokenFilter filter = (options.hasOption("tokenFilter"))
            ? TokenFilter.loadFromSpecification(options.getStringOption('F'))
            : null;

        // setup the dependency extractor.
        DependencyExtractor e = new CoNLLDependencyExtractor(filter, null);
        DepSemTokenCounter counter = new DepSemTokenCounter(e);

        // Process each of the input files
        for (int i = 1; i < options.numPositionalArgs(); ++i)
            counter.process(new DependencyFileDocumentIterator(
View Full Code Here

        TokenFilter filter = (options.hasOption("tokenFilter"))
            ? TokenFilter.loadFromSpecification(options.getStringOption('F'))
            : null;

        // setup the dependency extractor.
        DependencyExtractor e = new CoNLLDependencyExtractor(filter, null);
        DepPsdTokenCounter counter = new DepPsdTokenCounter(e);

        // Process each of the input files
        for (int i = 1; i < options.numPositionalArgs(); ++i)
            counter.process(new DependencyFileDocumentIterator(
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.dependency.DependencyExtractor

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.