(self, name)
| 153 | |
| 154 | class Lang: |
| 155 | def __init__(self, name): |
| 156 | self.name = name |
| 157 | self.word2index = {} |
| 158 | self.word2count = {} |
| 159 | self.index2word = {0: "SOS", 1: "EOS"} |
| 160 | self.n_words = 2 # Count SOS and EOS |
| 161 | |
| 162 | def addSentence(self, sentence): |
| 163 | for word in sentence.split(' '): |