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 ; }
Returns the Dale Chall Score of the text .