Package gannuNLP.data

Examples of gannuNLP.data.Count


            counts.get(index).increaseFrequency();
          }
          else
          {
            lemmas.add(word.getLemma());
            counts.add(new Count(1.0,this.name));
          }
          bow.add(word.getLemma());
        }
        for(AmbiguousWord word:sentence)
        {
View Full Code Here


      aux=aux.substring(aux.indexOf(this.countPrepIn)+this.countPrepIn.length());
      aux=aux.substring(0,aux.indexOf(this.countPrepOut));
      aux=aux.replaceAll("\\D", "");
      w=Double.parseDouble(aux);
    }
    Count c=new Count(w, this.name);
    return c;
  }
View Full Code Here

   * @return The frequency is stored inside an ArrayList<Count> of size=1.
   */
  public ArrayList<Count> getCounts(String lemma) {
    int i=Collections.binarySearch(wordCounts,lemma);
    ArrayList<Count> counts=new ArrayList<Count>();
    Count c;
    if(i>=0)
      c=new Count(Double.parseDouble(wordCounts.get(i).getString()),this.name);
    else
      c=new Count(0.0,this.name);
    counts.add(c);
    return counts;
  }
View Full Code Here

TOP

Related Classes of gannuNLP.data.Count

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.