Helper function to create a statement with the search text populated.
(self, text, in_response_to=None, **kwargs)
| 42 | return Statement(**kwargs) |
| 43 | |
| 44 | def _create_with_search_text(self, text, in_response_to=None, **kwargs): |
| 45 | """ |
| 46 | Helper function to create a statement with the search text populated. |
| 47 | """ |
| 48 | search_in_response_to = None |
| 49 | |
| 50 | if in_response_to: |
| 51 | search_in_response_to = self.chatbot.tagger.get_text_index_string( |
| 52 | in_response_to |
| 53 | ) |
| 54 | |
| 55 | self.chatbot.storage.create( |
| 56 | text=text, |
| 57 | in_response_to=in_response_to, |
| 58 | search_text=self.chatbot.tagger.get_text_index_string(text), |
| 59 | search_in_response_to=search_in_response_to, |
| 60 | **kwargs |
| 61 | ) |
| 62 | |
| 63 | def _create_many_with_search_text(self, statements): |
| 64 | """ |