コード例 #1
0
def SQLConnect():
    #try to connect to the sqlite database.
    # if database does not exit. Make one.
    db_path = os.path.join(umls_tables, "umls.db")
    if not os.path.isfile(db_path):
        print "\n\tdb doesn't exist (creating one now)\n"
        create_sqliteDB.create_db()

    db = sqlite3.connect(db_path)
    return db.cursor()
コード例 #2
0
ファイル: interface_umls.py プロジェクト: wboag/CliNER
def SQLConnect():
    #try to connect to the sqlite database.
    # if database does not exit. Make one.
    db_path = os.path.join(umls_tables, "umls.db")
    if not os.path.isfile(db_path):
        print "\n\tdb doesn't exist (creating one now)\n"
        create_sqliteDB.create_db()

    db = sqlite3.connect( db_path )
    return db.cursor()
コード例 #3
0
ファイル: interface_umls.py プロジェクト: aussina/CliNER
def SQLConnect():
    #try to connect to the sqlite database.
    db_path = os.path.join( os.environ['CLINER_DIR'], "umls_tables/umls.db")
    if( os.path.isfile( db_path ) ):
        print "\ndb exists"
    else:
        # Database does not exit. Make one.
        print "\ndb doesn't exist"
        create_sqliteDB.create_db()

    db = sqlite3.connect( db_path )
    return db.cursor()
コード例 #4
0
def SQLConnect():
    #try to connect to the sqlite database.
    db_path = os.path.join(os.environ['CLINER_DIR'], "umls_tables/umls.db")
    if (os.path.isfile(db_path)):
        print "\ndb exists"
    else:
        # Database does not exit. Make one.
        print "\ndb doesn't exist"
        create_sqliteDB.create_db()

    db = sqlite3.connect(db_path)
    return db.cursor()