Logo Search packages:      
Sourcecode: ibus-pinyin version File versions

def pysqlitedb::PYSQLiteDB::commit_phrases (   self,
  records 
)

this function adjusts frequence of phrase in user database.

Definition at line 325 of file pysqlitedb.py.

00325                                       :
        """this function adjusts frequence of phrase in user database."""

        for record in records:
            if record [USER_FREQ] != None:
                sql = "UPDATE user_db.py_phrase SET user_freq = user_freq + 1 WHERE ylen = ? AND y0 = ? AND phrase = ?;"
                self.db.execute (sql, (record[YLEN], record[Y0], record[PHRASE]))
            else:
                sql = """INSERT INTO user_db.py_phrase (ylen, y0, y1, y2, y3, yx, s0, s1, s2, s3, phrase, freq, user_freq)
                    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1);"""
                self.db.execute (sql, record[:12])
        self.flush ()
        self.select_cache.clear ()

    def commit_phrase (self, record):


Generated by  Doxygen 1.6.0   Back to index