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

def tabsqlitedb::tabsqlitedb::update_phrase (   self,
  entry,
  database = 'user_db' 
)

update phrase freqs

Definition at line 205 of file tabsqlitedb.py.

00205                                                        :
        '''update phrase freqs'''
        #print entry
        _con = [ entry[-1] ] + list(entry[0:2+entry[0]]) + [entry[-3]]
        #print _con
        _condition = u''.join( map(lambda x: 'AND m%d = ? ' % x, range(entry[0]) )    )
        #print _condition
        sqlstr = 'UPDATE %s.phrases SET user_freq = ? WHERE mlen = ? AND clen = ? %s AND phrase = ?;' % (database, _condition)
        #print sqlstr
        self.db.execute ( sqlstr , _con )
        # because we may update different db, we'd better commit every time.
        self.db.commit()

    def sync_usrdb (self):


Generated by  Doxygen 1.6.0   Back to index