Skip to content

Commit

Permalink
Added a new column 'text_raw' to corpus table
Browse files Browse the repository at this point in the history
Just set to default value NULL
  • Loading branch information
chengkun-wu committed Dec 31, 2013
1 parent 39f4040 commit d388f65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

*.pyc

myconfig.ini

thyroid_cancer_pubmed_2013-12-09.txt
4 changes: 2 additions & 2 deletions PyPubmedText.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def insert2DB(artMap, db, dbTables):
article = artMap[pmid]


insert_sql = 'REPLACE into ' + dbTables['CORPUS_TEXT_TABLE'] + """ (id_ext, text_title, text_body, xml, text_abstract, authors, date, article_type, mesh_terms, journal, affiliation) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,%s)"""
insert_sql = 'REPLACE into ' + dbTables['CORPUS_TEXT_TABLE'] + """ (id_ext, text_title, text_body, xml, text_abstract, authors, date, article_type, mesh_terms, journal, affiliation, text_raw) values(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,%s, NULL)"""

try:
dbCur.execute(insert_sql, (article.id_ext, article.text_title, article.text_body, article.xml, article.text_abstract, article.authors, article.date, article.pubType, article.mesh_terms, article.journal, article.affiliation))
Expand Down Expand Up @@ -354,7 +354,7 @@ def rebuildCorpus(corpus, db, dbTables, email):
print 'You need to have a valid DB connection first!'
return
else:
print 'Now rebuilding the thyroid cancer corpus'
print 'Now rebuilding thet thyroid cancer corpus'

dbCur = db.cursor()

Expand Down

0 comments on commit d388f65

Please sign in to comment.