@Test public void testDale_chall_score() { logger.info("dale_chall_score"); String strText = TEST_STRING; double expResult = 20.486603754266213; double result = ReadabilityStatistics.daleChallScore(strText); assertEquals(expResult, result, Constants.DOUBLE_ACCURACY_HIGH); }
public static double daleChallScore(String strText) { strText = cleanText(strText); int intDifficultWordCount = 0; List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText); int intWordCount = arrWords.size(); for (int i = 0; i < intWordCount; ++i) { if (!DALECHALL_WORDLIST.contains(arrWords.get(i))) { ++intDifficultWordCount; } } int intSentenceCount=sentenceCount(strText); double percentageOfDifficultWords=intDifficultWordCount/(double)intWordCount; double score=0.1579*(100*percentageOfDifficultWords)+0.0496*(intWordCount/(double)intSentenceCount); if(percentageOfDifficultWords>0.05) { score+=3.6365; } return score; }
ReadabilityStatistics { public static double daleChallScore(String strText) { strText = cleanText(strText); int intDifficultWordCount = 0; List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText); int intWordCount = arrWords.size(); for (int i = 0; i < intWordCount; ++i) { if (!DALECHALL_WORDLIST.contains(arrWords.get(i))) { ++intDifficultWordCount; } } int intSentenceCount=sentenceCount(strText); double percentageOfDifficultWords=intDifficultWordCount/(double)intWordCount; double score=0.1579*(100*percentageOfDifficultWords)+0.0496*(intWordCount/(double)intSentenceCount); if(percentageOfDifficultWords>0.05) { score+=3.6365; } return score; } }
ReadabilityStatistics { public static double daleChallScore(String strText) { strText = cleanText(strText); int intDifficultWordCount = 0; List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText); int intWordCount = arrWords.size(); for (int i = 0; i < intWordCount; ++i) { if (!DALECHALL_WORDLIST.contains(arrWords.get(i))) { ++intDifficultWordCount; } } int intSentenceCount=sentenceCount(strText); double percentageOfDifficultWords=intDifficultWordCount/(double)intWordCount; double score=0.1579*(100*percentageOfDifficultWords)+0.0496*(intWordCount/(double)intSentenceCount); if(percentageOfDifficultWords>0.05) { score+=3.6365; } return score; }  }
ReadabilityStatistics { public static double daleChallScore(String strText) { strText = cleanText(strText); int intDifficultWordCount = 0; List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText); int intWordCount = arrWords.size(); for (int i = 0; i < intWordCount; ++i) { if (!DALECHALL_WORDLIST.contains(arrWords.get(i))) { ++intDifficultWordCount; } } int intSentenceCount=sentenceCount(strText); double percentageOfDifficultWords=intDifficultWordCount/(double)intWordCount; double score=0.1579*(100*percentageOfDifficultWords)+0.0496*(intWordCount/(double)intSentenceCount); if(percentageOfDifficultWords>0.05) { score+=3.6365; } return score; }  static double fleschKincaidReadingEase(String strText); static double fleschKincaidGradeLevel(String strText); static double gunningFogScore(String strText); static double colemanLiauIndex(String strText); static double smogIndex(String strText); static double automatedReadabilityIndex(String strText); static double daleChallScore(String strText); static double daleChallGrade(String strText); static double spacheScore(String strText); }
ReadabilityStatistics { public static double daleChallScore(String strText) { strText = cleanText(strText); int intDifficultWordCount = 0; List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText); int intWordCount = arrWords.size(); for (int i = 0; i < intWordCount; ++i) { if (!DALECHALL_WORDLIST.contains(arrWords.get(i))) { ++intDifficultWordCount; } } int intSentenceCount=sentenceCount(strText); double percentageOfDifficultWords=intDifficultWordCount/(double)intWordCount; double score=0.1579*(100*percentageOfDifficultWords)+0.0496*(intWordCount/(double)intSentenceCount); if(percentageOfDifficultWords>0.05) { score+=3.6365; } return score; }  static double fleschKincaidReadingEase(String strText); static double fleschKincaidGradeLevel(String strText); static double gunningFogScore(String strText); static double colemanLiauIndex(String strText); static double smogIndex(String strText); static double automatedReadabilityIndex(String strText); static double daleChallScore(String strText); static double daleChallGrade(String strText); static double spacheScore(String strText);  }