org.geonames.wikipedia
Class TextSummaryExtractor

java.lang.Object
  extended by org.geonames.wikipedia.TextSummaryExtractor

public class TextSummaryExtractor
extends Object

Author:
marc

Constructor Summary
TextSummaryExtractor()
           
 
Method Summary
static String extractSummary(String pText, int length)
          extract a text summary from a wikipedia article.
static String removeBold(String pString)
           
static String removeItalic(String pString)
           
static String removeWhiteSpace(String pString)
          removes sequences of whitespace and keeps only one whitespace character
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextSummaryExtractor

public TextSummaryExtractor()
Method Detail

extractSummary

public static String extractSummary(String pText,
                                    int length)
extract a text summary from a wikipedia article. The wikipedia markup is removed. The length of the summary is equal or lower the length of the parameter. The extractor tries to end the summary at a fullstop.

Parameters:
pText -
length -
Returns:

removeWhiteSpace

public static String removeWhiteSpace(String pString)
removes sequences of whitespace and keeps only one whitespace character

Parameters:
pString -
Returns:

removeBold

public static String removeBold(String pString)

removeItalic

public static String removeItalic(String pString)