def _read_text_file(self, file_name, raw=False):
        """Read a text file with the appropriate compression and encoding.

        Comments and empty lines are skipped unless raw is True.

        """
        inp = self._open_text_file_read(file_name)
        try:
            for line in inp:
                line = line.rstrip()
                if not raw and \
                   (len(line) == 0 or line.startswith(self.comment_start)):
                    continue
                if self.lowercase:
                    yield line.lower()
                else:
                    yield line
        except __HOLE__:
            if file_name == '-':
                _logger.info("Finished reading from stdin")
                return
            else:
                raise
dataset/ETHPy150Open aalto-speech/morfessor/morfessor/io.py/MorfessorIO._read_text_file