Logo Search packages:      
Sourcecode: ibus-table version File versions  Download package

def tabsqlitedb::tabsqlitedb::add_new_phrases (   self,
  nphrases,
  database = 'main' 
)

Add new phrases into db, new phrases is a object
of [(phrase,freq), (phrase,freq),...]

Definition at line 375 of file tabsqlitedb.py.

00375                                                          :
        '''Add new phrases into db, new phrases is a object
        of [(phrase,freq), (phrase,freq),...]'''
        n_phrases=[]
        for _ph, _freq in nphrases:
            try:
                _tabkey = self.parse_phrase_to_tabkeys(_ph)
                if not self.check_phrase_internal (_ph, _tabkey, database):
                    # we don't have this phrase
                    n_phrases.append ( (_tabkey, _ph, _freq, 0) )
            except:
                print '\"%s\" would not been added' % _ph
        if n_phrases:
            self.add_phrases ( n_phrases, database )
    
    def u_add_phrase (self,nphrase):


Generated by  Doxygen 1.6.0   Back to index