Class TextSummaryExtractor


  • public class TextSummaryExtractor
    extends Object
    Author:
    marc
    • 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. 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:
      • removeBold

        public static String removeBold​(String pString)
      • removeItalic

        public static String removeItalic​(String pString)