~grosmoteur/grosmoteur/trunk

« back to all changes in this revision

Viewing changes to lib/urls.py

  • Committer: kim
  • Date: 2014-02-22 17:13:52 UTC
  • Revision ID: kmgrds@gmail.com-20140222171352-iodi07d46m2boftw
2014

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: UTF-8 -*-
 
2
 
 
3
from sqlite3   import connect
 
4
 
 
5
 
 
6
def newGroBase(corpusFileName):
 
7
        db = connect(corpusFileName)
 
8
        cursor = db.cursor()
 
9
#       cursor.execute('''CREATE VIRTUAL TABLE information USING fts3( name, comments,  nbPages, nbSentences, nbWords, config file ) ;''')
 
10
        cursor.execute('''CREATE VIRTUAL TABLE sources USING fts3(  url, source, linkOrigin,  ts) ;''') #,link origin: page index or config
 
11
#       cursor.execute('''CREATE VIRTUAL TABLE texts USING fts3(sourceIndex, text) ;''')  # TODO: think how many of these tables  i need and when to create them
 
12
        
 
13
        db.commit()
 
14
        db.close()
 
15
        print "created", corpusFileName
 
16
        
 
17