Class ADSentenceStream

All Implemented Interfaces:
AutoCloseable, ObjectStream<ADSentenceStream.Sentence>

@Internal public class ADSentenceStream extends FilterObjectStream<String,ADSentenceStream.Sentence>
Stream filter which merges text lines into sentences, following the Arvores Deitadas syntax.

Information about the format:
Susana Afonso. "Árvores deitadas: Descrição do formato e das opções de análise na Floresta Sintáctica".
12 de Fevereiro de 2006.

Whitespace in the markup and the tree lines is the Unicode White_Space property, see StringUtil.isUnicodeWhitespace(char), independent of the whitespace mode.

Note: Do not use this class, internal use only!

  • Field Details

  • Constructor Details

  • Method Details

    • read

      public ADSentenceStream.Sentence read() throws IOException
      Reads the next sentence.
      Returns:
      The next ADSentenceStream.Sentence, or null at the end of the input. A sentence cut off before the closing tag is returned with the lines read so far; an opening tag with no lines after it at the end of the input yields no sentence.
      Throws:
      IOException - Thrown if the line stream cannot be read.
    • isOpeningTag

      boolean isOpeningTag(String line, String name)
      Checks whether a line is an opening markup tag with the given name: the name right after the opening angle bracket, then either the closing angle bracket or whitespace and attributes, which contain no closing angle bracket, then the closing angle bracket as the last character. A self-closing tag, with a slash right before the closing angle bracket as in <s/>, <s /> or <s id="1"/>, is not an opening tag.
      Parameters:
      line - The line.
      name - The tag name.
      Returns:
      true if the whole line is such a tag.
    • isClosingTag

      boolean isClosingTag(String line, String name)
      Tests whether a line is exactly the closing markup tag with the given name.
      Parameters:
      line - The line.
      name - The tag name.
      Returns:
      true if the whole line is that closing tag.