Examples of FNLPSent


Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

    Iterator<FNLPDoc> it1 = corpus.docs.iterator();
    while(it1.hasNext()){
      FNLPDoc doc = it1.next();
      Iterator<FNLPSent> it2 = doc.sentences.iterator();
      while(it2.hasNext()){
        FNLPSent sent = it2.next();
        for(String w:sent.words){
       
        String s = Tags.genSequence4Tags(new String[]{w});
        bout.write(s);
        String w1 = ChineseTrans.toFullWidth(w);
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

    Iterator<FNLPDoc> it1 = corpus.docs.iterator();
    while(it1.hasNext()){
      FNLPDoc doc = it1.next();
      Iterator<FNLPSent> it2 = doc.sentences.iterator();
      while(it2.hasNext()){
        FNLPSent sent = it2.next();
        String s = Tags.genSequence4Tags(sent.words);
        bout.write(s);
       
        for(int i=0;i<sent.words.length;i++){
          String w1 = ChineseTrans.toFullWidth(sent.words[i]);
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

       
        line = line.trim();
       
        if (line.matches("^$")){
          if(carrier.size()>0){
            FNLPSent sent = new FNLPSent();           
            sent.parse(carrier,1,HASID); //TODO: 需要根据不同语料修改
            //归一化
            for(int i=0;i<sent.words.length;i++){
              sent.words[i] = ct.normalize(sent.words[i]);
            }
            correct(sent);
            docs.add(sent);
            carrier.clear();
          }
        }else
          carrier.add(line);
      }
      if(!carrier.isEmpty()){
        FNLPSent sent = new FNLPSent();
       
        sent.parse(carrier,1,HASID); //TODO: 需要根据不同语料修改
        correct(sent);
        docs.add(sent);
        carrier.clear();
      }
      corpus.add(docs);
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

    Iterator<FNLPDoc> it1 = corpus.docs.iterator();
    while(it1.hasNext()){
      FNLPDoc doc = it1.next();
      Iterator<FNLPSent> it2 = doc.sentences.iterator();
      while(it2.hasNext()){
        FNLPSent sent = it2.next();
        if(!sent.hasTag())
          continue;
        for(int i=0;i<sent.size();i++){
          String w = ct.normalize(sent.words[i]);
          bout.write(w);
          bout.write("\t");
          bout.write(sent.tags[i]);
          bout.write("\n");
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

    Iterator<FNLPDoc> it1 = corpus.docs.iterator();
    while(it1.hasNext()){
      FNLPDoc doc = it1.next();
      Iterator<FNLPSent> it2 = doc.sentences.iterator();
      while(it2.hasNext()){
        FNLPSent sent = it2.next();
        if(!sent.hasTag())
          continue;
        for(int i=0;i<sent.size();i++){
          String w = ct.normalize(sent.words[i]);
          bout.write(w);
          bout.write("\t");
          bout.write(sent.tags[i]);
          bout.write("\n");
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

    Iterator<FNLPDoc> dit = corpus.docs.iterator();
    while(dit.hasNext()){
      FNLPDoc doc = dit.next();
      Iterator<FNLPSent> sit = doc.sentences.iterator();
      while(sit.hasNext()){
        FNLPSent sent = sit.next();
        String s = sent.getSentenceString();
        Matcher m = p.matcher(s);
        if(m.find()){
          System.out.println(s);
          sents.add(sent);
        }
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

    if(curDoc==null){
      corpus =null;
      return false;
    }
   
    FNLPSent sent = curDoc.getSent(curSentNo++);
    if(sent == null){
      curDoc = null;
      curSentNo = 0;
      return hasNext();
    }
View Full Code Here

Examples of org.fnlp.nlp.corpus.fnlp.FNLPSent

          break;
        }       

      }
      if(match){
        FNLPSent newsent = new FNLPSent(words, tags, sent.heads, sent.relations);
        return newsent.toTree();
      }
    }
    return null;
  }
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.