def set_past_word_count(self): # self.sentencesはすでにある前提 if not hasattr(self, 'past_word_count'): self.past_word_count = {} for sentence_index, sentence in enumerate(self.sentences): m_words = SentenceSeparator.m_words(sentence) for i, m_word in enumerate(m_words): # iはm_wordに分けたあとの順番 past_text = self.past_text(i, m_word, m_words) if past_text: self.past_word_count_up(past_text)
def set_sentences_from_text(self): sp = SentenceSeparator(self.text) sentence_texts = sp.split_by_dots() for sentence_text in sentence_texts: sentence = Sentence(sentence_text, self.query) self.sentences.append(sentence)
def set_sahens_from_text(self): self.sahens = SentenceSeparator.sahens(self.text)
def set_verbs_from_text(self): self.verbs = SentenceSeparator.verbs(self.text)