summaryrefslogtreecommitdiffstats
path: root/scripts/create_index.py
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2009-10-05 11:54:20 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2009-10-05 11:54:20 +0800
commit81070b09ca9a8bec2ab76006aa049f460904e23a (patch)
treea01abcd4766aa6fbb825851a67cfda71804063cb /scripts/create_index.py
parentd866b6b936220d6f3f95a24a0d3c762186134ba6 (diff)
downloadibus-libpinyin-81070b09ca9a8bec2ab76006aa049f460904e23a.tar.gz
ibus-libpinyin-81070b09ca9a8bec2ab76006aa049f460904e23a.tar.xz
ibus-libpinyin-81070b09ca9a8bec2ab76006aa049f460904e23a.zip
Move all scripts to $top_srcdir/scripts
Diffstat (limited to 'scripts/create_index.py')
-rw-r--r--scripts/create_index.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/create_index.py b/scripts/create_index.py
new file mode 100644
index 0000000..823e616
--- /dev/null
+++ b/scripts/create_index.py
@@ -0,0 +1,21 @@
+import sqlite3
+
+con2 = sqlite3.connect("py-new.db")
+con2.execute ("PRAGMA synchronous = NORMAL;")
+con2.execute ("PRAGMA temp_store = MEMORY;")
+
+
+con2.execute("CREATE INDEX index_0_0 ON py_phrase_0(s0, y0)")
+print "py_phrase_%d done" % 0
+
+con2.execute("CREATE INDEX index_1_0 ON py_phrase_1(s0, y0, s1, y1)")
+con2.execute("CREATE INDEX index_1_1 ON py_phrase_1(s0, s1, y1)")
+print "py_phrase_%d done" % 1
+
+for i in xrange(2, 16):
+ con2.execute("CREATE INDEX index_%d_0 ON py_phrase_%d(s0, y0, s1, y1, s2, y2)" % (i, i))
+ con2.execute("CREATE INDEX index_%d_1 ON py_phrase_%d(s0, s1, s2, y2)" % (i, i))
+ print "py_phrase_%d done" % i
+
+# con2.execute("vacuum")
+con2.commit()