Commit d8d27f26 authored by PkSM3's avatar PkSM3

[UPDATE] csv parser and date-max+1

parent 1348a4af
......@@ -391,7 +391,12 @@ def newpaginatorJSON(request , corpus_id):
resdict = {}
resdict["id"] = doc.id
resdict["date"] = realdate
resdict["name"] = doc.name
resdict["name"] = ""
if doc.name and doc.name!="":
resdict["name"] = doc.name
else:
resdict["name"] = doc.hyperdata["doi"]
filtered_docs.append( resdict )
except Exception as e:
print ("pag2 error01 detail:",e)
......
......@@ -4,6 +4,9 @@ from .FileParser import FileParser
from ..NgramsExtractors import *
from datetime import datetime
from io import BytesIO
import csv
import sys
csv.field_size_limit(sys.maxsize)
class CSVParser(FileParser):
......@@ -14,7 +17,7 @@ class CSVParser(FileParser):
import csv
f = open(file , "r")
reader = csv.reader(f)
reader = csv.reader(f , delimiter='\t')
counter = 0
for row in reader:
......@@ -36,6 +39,7 @@ class CSVParser(FileParser):
pub["publication_year"] = "2014"
pub["publication_month"] = "01"
pub["publication_day"] = "01"
pub["language_iso3"] = "eng"
pub["authors"] = [ authors ]
hyperdata_list.append(pub)
......
......@@ -84,6 +84,7 @@ function Final_UpdateTable( action ) {
var dataini = TheBuffer[0].toISOString().split("T")[0]
var datafin = TheBuffer[1].toISOString().split("T")[0]
pr("show me the pubs of the selected period")
console.log( TheBuffer )
pr("\tfrom ["+dataini+"] to ["+datafin+"]")
TimeRange = []
......@@ -295,8 +296,7 @@ function Main_test( Data , SearchFilter ) {
latest = t1;
TheBuffer = [new Date(t0[0],(t0[1]-1),t0[2]), new Date(t1[0],(t1[1]-1),t1[2])];
TheBuffer = [new Date(t0[0],(t0[1]-1),t0[2]), new Date(t1[0],(t1[1]-1),t1[2]+1)];
var arrayd3 = []
for(var e in Data) {
......
......@@ -406,7 +406,7 @@ function Main_test( data , initial) {
.title(function (d) {
var value = d.value.avg ? d.value.avg : d.value;
if (isNaN(value)) value = 0;
return value+" ngrams with "+FirstScore+"="+Number(d.key);
return value+" journals with "+Number(d.key)+" publications";
})
.xAxis();
LineChart.yAxis().ticks(5)
......
......@@ -408,6 +408,7 @@ $("#Save_All").click(function(){
},
success: function(data){
console.log(data)
location.reload()
},
error: function(result) {
console.log("Data not found in #Save_All");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment