moj.lang
Class Readability

java.lang.Object
  extended by moj.lang.Readability

public class Readability
extends java.lang.Object

Version:
2009-April-21
Author:
Martin Hassel

Constructor Summary
Readability()
           
 
Method Summary
static float calcLIX(java.lang.String text)
          Calculate the LIX value for a given String of text.

LIX is a Swedish acronym for "Läsbarhetsindex", or Readability Index, and is a much disputed measure of how accessible a text is.
static float calcLIX(java.lang.String text, GenericTokenizer gt)
          Calculate the LIX value for a given String of text using the provided GenericTokenizer for splitting the text into sentences and words.
static float calcLIX(java.lang.String text, GenericTokenizer gt, boolean verbose)
          Calculate the LIX value for a given String of text using the provided GenericTokenizer for splitting the text into sentences and words.
static float calcSMOG(java.lang.String text)
           
static float calcSMOG(java.lang.String text, GenericTokenizer gt)
           
static int calcSyllables(java.lang.String word)
          Note that this is not infallible.
static void main(java.lang.String[] args)
          Usage: moj.lang.Readability <file>
<file> : text file to calculate LIX for
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Readability

public Readability()
Method Detail

calcLIX

public static float calcLIX(java.lang.String text)
Calculate the LIX value for a given String of text.

LIX is a Swedish acronym for "Läsbarhetsindex", or Readability Index, and is a much disputed measure of how accessible a text is. The higher the LIX the harder, arguably, the text is to understand. For a short description of LIX in Swedish, as well as a table of how to interpret the LIX value according to prespecified "readability classes", please see: http://sv.wikipedia.org/wiki/LIX

Parameters:
text - String to calculate LIX for
Returns:
the LIX value for the given String

calcLIX

public static float calcLIX(java.lang.String text,
                            GenericTokenizer gt)
Calculate the LIX value for a given String of text using the provided GenericTokenizer for splitting the text into sentences and words.

Parameters:
text - String to calculate LIX for
gt - GenericTokenizer to use for tokenizing the text
Returns:
the LIX value for the given String

calcLIX

public static float calcLIX(java.lang.String text,
                            GenericTokenizer gt,
                            boolean verbose)
Calculate the LIX value for a given String of text using the provided GenericTokenizer for splitting the text into sentences and words.

Parameters:
text - String to calculate LIX for
gt - GenericTokenizer to use for tokenizing the text
verbose - true prints the underlying statistics for for the LIX calculation, false does not
Returns:
the LIX value for the given String

calcSMOG

public static float calcSMOG(java.lang.String text)

calcSMOG

public static float calcSMOG(java.lang.String text,
                             GenericTokenizer gt)

calcSyllables

public static int calcSyllables(java.lang.String word)
Note that this is not infallible. it does fail for some percentage of words (10% seems a good guess)... so it's useful for approximation, but don't use this for running your nuclear reactor...
© Greg Fast (gdf@imsa.edu)


main

public static void main(java.lang.String[] args)
Usage: moj.lang.Readability <file>
<file> : text file to calculate LIX for