Package org.geonames.wikipedia
Class TextSummaryExtractor
- java.lang.Object
-
- org.geonames.wikipedia.TextSummaryExtractor
-
public class TextSummaryExtractor extends Object
- Author:
- marc
-
-
Constructor Summary
Constructors Constructor Description TextSummaryExtractor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
extractSummary(String pText, int length)
extract a text summary from a wikipedia article.static String
extractSummary(String pText, int length, boolean stopAtParagraph)
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
-
-
-
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. It stops at a new paragraph.- Parameters:
pText
-length
-- Returns:
-
extractSummary
public static String extractSummary(String pText, int length, boolean stopAtParagraph)
-
removeWhiteSpace
public static String removeWhiteSpace(String pString)
removes sequences of whitespace and keeps only one whitespace character- Parameters:
pString
-- Returns:
-
-