Examples of countWord()


Examples of org.vietspider.common.text.TextCounter.countWord()

    while(index < end) {
      char c = text.charAt(index);
      if(c == '\\') {
        //tinh toan diem cho phan truoc
        int sentence = textCounter.countSentence(text, s, index);
        int word = textCounter.countWord(text, s, index);
//        if(sentence > 5) {
//          System.out.println("========================================");
//          System.out.println(text.substring(s, index));
//          System.out.println(" ===== > "+ sentence+  " : "
//              + word + " : "+ calculate(pattern, sentence, word));
View Full Code Here

Examples of org.vietspider.common.text.TextCounter.countWord()

      index++;
    }
   
    if(s < index) {
      int sentence = textCounter.countSentence(text, s, index);
      int word = textCounter.countWord(text, s, index);
      score += new ScoreCalculator().calculate(pattern, sentence, word);
    }
   
//    System.out.println("================================================================");
    for(int i = 0;  i < nodes.size(); i++) {
View Full Code Here

Examples of org.vietspider.common.text.TextCounter.countWord()

      if(isTextElement(nodes[i])) return;
      else if(isBlockElement(nodes[i])) {
        AnalyticsRenderer renderer = new AnalyticsRenderer(nodes[i], true);
        String text = renderer.getTextValue().toString();
        int sentence = textCounter.countSentence(text, 0, text.length());
        int word = textCounter.countWord(text, 0, text.length());

        int score = scoreCalculator.calculate(sentence, word);
        models.add(new AnalyticsModel(nodes[i], score));
        if(score > maxScore) maxScore = score;
      }
View Full Code Here

Examples of org.vietspider.common.text.TextCounter.countWord()

    TextCounter textCounter = contentChecker.getTextCounter();
    for(String element : elements) {
      int counter = textCounter.countSentence(element);
      if(counter > max) return true;

      counter = textCounter.countWord(element, 0, element.length());
      if(counter >= 15) return true;
    }
    return false;
  }
 
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.