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

def tabsqlitedb::tabsqlitedb::_set_add_phrase_sqlstr (   self  )  [private]

Create the sqlstr for add phrase according to self._mlen.

Definition at line 394 of file tabsqlitedb.py.

00394                                     :
        '''Create the sqlstr for add phrase according to self._mlen.'''
        sqlstr = 'INSERT INTO %s.phrases ( mlen, clen, '
        sql_suffix = 'VALUES ( ?, ?, '
        mmlen = range(self._mlen)
        sqlstr += ''.join ( map(lambda x: 'm%d, ' %x , mmlen) )
        sql_suffix += ''.join ( map (lambda x: '?, ' , mmlen) )
        if self._is_chinese:
            sqlstr += 'category, '
            sql_suffix += '?, '
        sqlstr += 'phrase, freq, user_freq) '
        sql_suffix += '?, ?, ? );'
        sqlstr += sql_suffix
        self._add_phrase_sqlstr = sqlstr

    def add_phrase (self, aphrase, database = 'main',commit=True):


Generated by  Doxygen 1.6.0   Back to index