public int getScore() { return score; }
private void analytics() {
if(maxPattern > -1) return;
TextCounter textCounter = new TextCounter();
int s = start;
int index = start;
String text = renderer.getTextValue();
int pattern = 0;
maxPattern = 0;
minPattern = -1;
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));
// System.out.println("========================================");
// }
score += new ScoreCalculator().calculate(pattern, sentence, word);
//end ket thuc
pattern = 0;
while(c == '\\') {
pattern++;
index++;
if(index >= end) break;
c = text.charAt(index);
}
s = index;
if(pattern > maxPattern) maxPattern = pattern;
if(pattern < minPattern || minPattern < 0) minPattern = pattern;
timePattern++;
totalSeparator += pattern;
}
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++) {