Package net.yacy.kelondro.data.word

Examples of net.yacy.kelondro.data.word.Word.occurrences()


        // check if the token appears in the text
        if (words.containsKey(token)) {
          final Word word = words.get(token);
          // token appears in text and matches an existing bookmark tag
          if (tags.containsKey(token)) {
            count = word.occurrences() * tags.get(token).size() * 100;
          }
          // token appears in text and has more than 3 characters
          if (token.length()>3) {
            count = word.occurrences() * 100;
          }
 
View Full Code Here


          if (tags.containsKey(token)) {
            count = word.occurrences() * tags.get(token).size() * 100;
          }
          // token appears in text and has more than 3 characters
          if (token.length()>3) {
            count = word.occurrences() * 100;
          }
          topwords.add(new YMarkTag(token, count));
        }
      }
      count = 0;
View Full Code Here

 
  public int compare(final String k1, final String k2) {
    final Word w1 = this.words.get(k1);
    final Word w2 = this.words.get(k2);
   
        if(w1.occurrences() > w2.occurrences())
            return 1;
        else if(w1.occurrences() < w2.occurrences())
            return -1;
        else
            return 0;
View Full Code Here

    final Word w1 = this.words.get(k1);
    final Word w2 = this.words.get(k2);
   
        if(w1.occurrences() > w2.occurrences())
            return 1;
        else if(w1.occurrences() < w2.occurrences())
            return -1;
        else
            return 0;
  }
}
View Full Code Here

        // check if the token appears in the text
        if (words.containsKey(token.toString())) {         
          final Word word = words.get(token.toString());
          // token appears in text and matches an existing bookmark tag
          if (tags.containsKey(token.toString())) {
            score = word.occurrences() * tags.get(token.toString()).size() * 200;
          }
          // token appears in text and has more than 3 characters
          else if (token.length()>3) {
            score = word.occurrences() * 100;
          }
 
View Full Code Here

          if (tags.containsKey(token.toString())) {
            score = word.occurrences() * tags.get(token.toString()).size() * 200;
          }
          // token appears in text and has more than 3 characters
          else if (token.length()>3) {
            score = word.occurrences() * 100;
          }
          // if token is already part of a phrase, reduce score
          if(pwords.toString().indexOf(token.toString())>1) {
            score = score / 3;
          }
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.