Class TextDocument

java.lang.Object
de.l3s.boilerpipe.document.TextDocument

public class TextDocument extends Object
A text document, consisting of one or more TextBlocks.
Author:
Christian Kohlschütter
  • Constructor Details

    • TextDocument

      public TextDocument(List<TextBlock> textBlocks)
      Creates a new TextDocument with given TextBlocks, and no title.
      Parameters:
      textBlocks - The text blocks of this document.
    • TextDocument

      public TextDocument(String title, List<TextBlock> textBlocks)
      Creates a new TextDocument with given TextBlocks and given title.
      Parameters:
      title - The "main" title for this text document.
      textBlocks - The text blocks of this document.
  • Method Details

    • getTextBlocks

      public List<TextBlock> getTextBlocks()
      Returns the TextBlocks of this document.
      Returns:
      A list of TextBlocks, in sequential order of appearance.
    • getTitle

      public String getTitle()
      Returns the "main" title for this document, or null if no such title has ben set.
      Returns:
      The "main" title.
    • setTitle

      public void setTitle(String title)
      Updates the "main" title for this document.
      Parameters:
      title -
    • getContent

      public String getContent()
      Returns the TextDocument's content.
      Returns:
      The content text.
    • getText

      public String getText(boolean includeContent, boolean includeNonContent)
      Returns the TextDocument's content, non-content or both
      Parameters:
      includeContent - Whether to include TextBlocks marked as "content".
      includeNonContent - Whether to include TextBlocks marked as "non-content".
      Returns:
      The text.
    • debugString

      public String debugString()
      Returns detailed debugging information about the contained TextBlocks.
      Returns:
      Debug information.