Ejemplo n.º 1
0
 def update_corpora_health_widget(self, word):
     """
     Update the corpora health widget if there are results
     """
     CEO.update_corpora_health(word)
     corpora_health = CEO.get_corpora_health()
     if corpora_health:
         update_grid(self.corpora_health, corpora_health)
Ejemplo n.º 2
0
    def name_new_corpus(self):
        ## today's date and time
        date_time = get_datetime_as_str()

        ## with what corpora it was based from?
        get_corpora_names = wrap(CEO.get_corpora_names())

        return date_time + ' ' + get_corpora_names + '.txt'
Ejemplo n.º 3
0
    def update_generative_text_widget(self, word):
        t1 = time.time()

        generative_text = CEO.generate([word,])
        if generative_text:
            self.generative_text.setText(generative_text)

        t2 = time.time()
        time_taken = (t2-t1)*1000.0
        self.time_generative.setText('%0.3f ms' % time_taken)
Ejemplo n.º 4
0
    def update_synonyms_widget(self, word):
        t1 = time.time()

        synonyms = CEO.synonyms(word)
        if synonyms:
            self.synonyms.setText(synonyms)

        t2 = time.time()
        time_taken = (t2-t1)*1000.0
        self.time_synonyms.setText('%0.3f ms' % time_taken)
Ejemplo n.º 5
0
    def update_grep_widget(self, word):
        """
        Update the suggestions widget if there are results
        """
        t1 = time.time()

        corpus_output = CEO.grep(word)
        if corpus_output:
            self.grep_widget.setHtml(corpus_output)

        t2 = time.time()
        time_taken = (t2-t1)*1000.0
        self.time_grep.setText('%0.3f ms' % time_taken)
Ejemplo n.º 6
0
 def update_sandwich_widget(self, word):
     ## regex sandwich widget?
     sandwich_text = CEO.sandwich(word)
     if sandwich_text:
         self.sandwich.setText(sandwich_text)