Skip to content

Commit

Permalink
Solved issue #27
Browse files Browse the repository at this point in the history
  • Loading branch information
massimoaria committed Jan 3, 2019
1 parent e6c2ecd commit b2cc57f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/bib2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ bib2df<-function(D, dbsource="isi"){
preprocessing <- function(D){

## normalize bibtex data
ind=which(regexpr("\\@",D)==1)
D=trim(D)

#D=gsub("\\.\\s+",";",D) ## for references
D=gsub("\\s+", " ",D)
D=gsub("\\{\\[\\}","\\[",D)
Expand All @@ -123,12 +123,13 @@ preprocessing <- function(D){
D=gsub("\\}\\}","\\}",D)

D=gsub(" = ","=",D)
ind=which(regexpr("\\@",D)==1)
#ind=which(regexpr("\\@",D)==1)
D1=D
D1[ind]=gsub("\\@","manuscript={",D[ind])
D[ind] <- gsub("\\@","manuscript=",D[ind])
D1=D1[which(regexpr("=\\{",D1)>-1)]
Tag<-unique(gsub("(=\\{).*","\\1",D1))
D=gsub("@","",D)

txt=list(D=tolower(D),DD=D,Tag=tolower(Tag))
return(txt)
Expand Down
1 change: 1 addition & 0 deletions R/isi2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ isi2df<-function(D){

for (i in 1:nP){
if (i%%100==0 | i==nP) cat("Articles extracted ",i,"\n")
print(i)
iStart=Papers[i]
if (i==nP){iStop=length(D)} else {iStop=Papers[i+1]-1}
Seq=seq(iStart,iStop)
Expand Down

0 comments on commit b2cc57f

Please sign in to comment.