diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-10-31 03:41:37 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-10-31 03:41:37 +0100 |
| commit | 2ede97c42b203c37a8a9f98784af4f31f01961f4 (patch) | |
| tree | 70bec449d9d8af3238efb1ae995dbda922469b89 /fetch-entries.py | |
| parent | a16c3cf801b70670dffc7041d92f7ccec56a0e18 (diff) | |
merge
Diffstat (limited to 'fetch-entries.py')
| -rw-r--r-- | fetch-entries.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fetch-entries.py b/fetch-entries.py index 37cd37f9..8c50d9a1 100644 --- a/fetch-entries.py +++ b/fetch-entries.py @@ -16,22 +16,24 @@ def fetch_entries(index): label = line[0] title = line[1] entries_fn = './datasets/scholar/entries/{}.csv'.format(title) - print(entries_fn) + # print(entries_fn) if not os.path.exists(entries_fn): with open(entries_fn, 'w') as f: - t = re.sub(r'\W+', '', title) + t = re.sub(r'[^-0-9a-zA-Z ]+', '', title) + print(t) subprocess.call([ './vendor/scholar.py', '-t', '-A', t, '--csv', ], stdout=f) - time.sleep(random.randint(20, 32)) + # time.sleep(random.randint(20, 32)) def read_citation_list(index): filename = './datasets/citations.csv' - fn, ext = os.path.splitext(filename) - in_fn = fn + '-' + str(index) + ext - with open(in_fn, 'r') as f: + # fn, ext = os.path.splitext(filename) + # in_fn = fn + '-' + str(index) + ext + # with open(in_fn, 'r') as f: + with open(filename, 'r') as f: reader = csv.reader(f) lines = list(reader) keys = lines[0] |
