def _remove_ws(self, chunk):
        """
        @return: string of text from chunk without end line characters
        and multiple spaces
        @rtype: C{str}
        """
        chunk = chunk.replace("\n", "")
        words = chunk.split()
        new_str = ""
        for i in words:
            if i == words[len(words)-1]:
                new_str += i
            else:
                new_str = new_str + i + " "
        return new_str
dataset/ETHPy150Open cidles/graf-python/nltk/masc.py/MascCorpusReader._remove_ws/original