Exemplo n.º 1
0
Arquivo: copy.py Projeto: joyrexus/ldp
#!/usr/bin/env python 
'''
copy.py - copy utts column to utts_orig column.

'''
import sys
from datastore.sqlite import sqlite

TARGET_DIR = sys.argv[1]
db = sqlite(TARGET_DIR + '/data.db')

update_st = 'UPDATE utterances SET {0}_utts = {0}_utts_orig'
# update_st = 'UPDATE utterances SET {0}_utts_orig = {0}_utts'

for speaker in ['p', 'c']:
    db.execute(update_st.format(speaker))
    db.commit()
Exemplo n.º 2
0
from datastore.sqlite import sqlite

db = sqlite("temp.db")

column = "c_utts"
pattern = r".*\d"

select_st = 'select id, {0} from utterances where {0} regexp "{1}";'

db.execute(select_st.format(column, pattern))

for id, utt in db:
    print utt