Beispiel #1
0
    def getNotVocalised(self, sents):
        tool = MyToolKit()
        not_vocalised_by_sents = []
        for i in range(len(sents)):
            not_vocalised = []
            words = tool.words(sents[i])
            j = 0
            while j < len(words):
                if not tool.HasDiac(words[j]):

                    string = ""
                    if j == 0: string = '###' + words[j]
                    else:
                        char = tool.LettersDiac(words[j - 1])
                        string = char[len(char) - 2] + char[len(char) -
                                                            1] + '#' + words[j]
                    k = j + 1
                    while k < len(words) and not tool.HasDiac(words[k]):
                        string += "#" + words[k]
                        k += 1
                    j += k
                    not_vocalised.append(string + "#")
                else:
                    j += 1
            not_vocalised_by_sents.append(not_vocalised)
        return not_vocalised_by_sents