def fit_on_text(self, text):
    if self.lower:
        text = text.lower()
    words = text.split()
    for word in words:
        if (word not in self.word2idx):
            self.word2idx[word] = self.idx
            self.idx2word[self.idx] = word
            self.idx += 1
def fit_on_text(self, text):
    if self.lower:
        text = text.lower()
    words = text.split()
    for word in words:
        if (word not in self.word2idx):
            self.word2idx[word] = self.idx
            self.idx2word[self.idx] = word
            self.idx += 1