Package edu.stanford.nlp.tagger.io

Examples of edu.stanford.nlp.tagger.io.TaggedFileRecord


      boolean stdin = config.useStdin();
      OutputStyle outputStyle = OutputStyle.fromShortName(config.getOutputFormat());
      if (!stdin) {
        String filename = config.getFile();
        if (formatPattern.matcher(filename).find()) {
          TaggedFileRecord record = TaggedFileRecord.createRecord(config, filename);
          runTagger(record.reader(), writer, outputStyle);
        } else {
          br = IOUtils.readerFromString(config.getFile(), config.getEncoding());
          runTagger(br, writer, config.getTagInside(), outputStyle);
        }
      } else {
View Full Code Here


    boolean fullSentence = PropertiesUtils.getBool(config, "fullSentence", false);

    Random random = new Random();
    String tagSeparator = config.getProperty("tagSeparator", TaggerConfig.TAG_SEPARATOR);

    TaggedFileRecord record = TaggedFileRecord.createRecord(config, config.getProperty("input"));
    for (List<TaggedWord> sentence : record.reader()) {
      int len = random.nextInt(sentence.size()) + 1;
      System.out.println(Sentence.listToString(sentence.subList(0, len), false, tagSeparator));
      if (fullSentence) {
        System.out.println(Sentence.listToString(sentence, false, tagSeparator));       
      }
View Full Code Here

        description = (TaggedFileRecord.TREE_FILTER + "=" + treeFilter +
                       "," + description);
      }
      description = (TaggedFileRecord.ENCODING + "=" + inputEncoding +
                     "," + description);
      TaggedFileRecord record =
        TaggedFileRecord.createRecord(props, description);
      for (List<TaggedWord> sentence : record.reader()) {
        String output = Sentence.listToString(sentence, noTags, tagSeparator);
        if (noSpaces) {
          output = output.replaceAll(" ", "");
        }
        bout.write(output);
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.tagger.io.TaggedFileRecord

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.