Package org.fnlp.nlp.parser

Examples of org.fnlp.nlp.parser.Sentence


   * @param pos 词性数组
   * @return
   * @throws UnsupportedDataTypeException
   */
  public DependencyTree parse2T(String[] words, String[] pos){
    return parse2T(new Sentence(words, pos));
  }
View Full Code Here


  public Target parse2R(Instance inst)   {
    return  jointParse(inst);
  }

  public Target parse2R(String[] words, String[] pos)   {
    return parse2R(new Sentence(words, pos));
  }
View Full Code Here

       
        relations[i] = tokens[10];
       
      }

      next = new Sentence(forms, postags, heads, relations);
      next.setSource(source);
    }
  }
View Full Code Here

  public boolean hasNext() {
    return (next != null);
  }

  public Instance next() {
    Sentence cur = next;
    try {
      advance();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

      curSentNo = 0;
      return hasNext();
    }
   
    Target target = new Target(sent.heads,sent.relations);
    next = new Sentence(sent.words, sent.tags, target);
   
    return true;
  }
View Full Code Here

   
    return true;
  }

  public Instance next() {
    Sentence cur = next;
   
    return cur;
  }
View Full Code Here

    return cur;
  }
  public static void main(String args[]) throws IOException{
    FNLPReader mr = new FNLPReader("./tmpdata/FNLPDATA/ctb7.dat");
    while (mr.hasNext()){
      Sentence sen = mr.next;
      for(int i=0;i<sen.length();i++)
        System.out.print(mr.next.getDepClass(i)+"\n");
    }
   
  }
View Full Code Here

        postags[i] = tokens[2];
        heads[i] =Integer.parseInt(tokens[3])-1;
        rels[i] = tokens[4];
      }

      next = new Sentence(forms, postags, new Target(heads,rels));
      next.setSource(source);
    }
  }
View Full Code Here

  public boolean hasNext() {
    return (next != null);
  }

  public Instance next() {
    Sentence cur = next;
    try {
      advance();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

    return cur;
  }
  public static void main(String args[]) throws IOException{
    Malt2Reader mr = new Malt2Reader("./tmp/tt.txt ");
    while (mr.hasNext()){
      Sentence sen = mr.next;
      for(int i=0;i<sen.length();i++)
        System.out.print(mr.next.getDepClass(i)+"\n");
    }
   
  }
View Full Code Here

TOP

Related Classes of org.fnlp.nlp.parser.Sentence

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.