def _read_sent_block(self, stream):
        """
        Method for retrieving sentence annotations from text, and 
        the tok annotations within each sentence.
        @type stream: SeekableUnicodeStreamReader
        @param stream: file stream from StreamBackedCorpusView 
                        in corpus/reader/util.py
        @return: list of sentences, each of which is a list of words, 
                        from a block of the file stream
        @rtype: C{list} of C{str}
        """
        file = self._get_basename(stream.name) + '-s.xml'
        words_file = self._get_basename(stream.name) + '-ptbtok.xml'

        if not file == self._cur_sents_file:
            self._cur_sents_file = file
            self._cur_words_file = words_file
            offsets = self._get_annotation(file, 's')
            words_offsets = self._get_annotation(words_file, 'tok')
            self._cur_sents_offsets = offsets
            self._cur_words_offsets = words_offsets
            self._get_disc(stream)
            char_to_byte = self._char_to_byte
            byte_to_char = self._byte_to_char
        else:
            offsets = self._cur_sents_offsets
            words_offsets = self._cur_words_offsets
            char_to_byte = self._char_to_byte
            byte_to_char = self._byte_to_char

        slimit = stream.tell()
        offset_slimit = byte_to_char.get(slimit, slimit)
        offset_elimit = offset_slimit + 500

        subset = self._get_subset(offsets, offset_slimit, offset_elimit)

        read_size = self._get_read_size(subset, char_to_byte, 
                        slimit, offset_elimit)
        text = stream.read(read_size)


        block = []
        for s in subset:
            sent = []
            for w in words_offsets:
                if w[0] >= s[0] and w[1] <= s[1] and w[0] != w[1]:
                    start = w[0] - offset_slimit
                    end = w[1] - offset_slimit
                    chunk = text[start:end].encode('utf-8')
                    chunk = self._remove_ws(chunk)
                    sent.append(chunk)
            block.append(sent)

        return block
dataset/ETHPy150Open cidles/graf-python/nltk/masc.py/MascCorpusReader._read_sent_block/original