Skip to content

Commit c9ccad4

Browse files
committed
Add first attempt to convert BibTex bib to BibTex ris file
Add first attempt to convert BibTex bib to BibTex ris file
1 parent 58c2b88 commit c9ccad4

File tree

4 files changed

+188
-0
lines changed

4 files changed

+188
-0
lines changed

BibTex.ris

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TY - JOUR
2+
TI - Unknown article
3+
DO - 10.48550/arxiv.2311.05063
4+
UR - https://dx.doi.org/10.48550/arxiv.2311.05063
5+
AU -
6+
PY -
7+
VL -
8+
M3 -
9+
L1 - https://kp-pdf.s3.amazonaws.com/d0d529fe-5a23-44fc-a104-2c14b50dc5d8.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUROH2NUQSIQZIEG4%2F20250118%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250118T174255Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=cfa23f6d9dd8542dbf0bfa2412c63bf8253f9e9e28174f63a7d64c258d8160b3
10+
ER -

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# AI-Research-Project-Referencing-Program
22

3+
## Reference
4+
5+
Repo Cloned from [AI-Research-Project-Referencing-Program](https://github.com/CoderSales/AI-Research-Project-Referencing-Program) and modified.
6+
37
## Description
48

59
AI Research Project Referencing Program Attempt

lines/risL1.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
def risL1():
2+
"""
3+
encapsulate ris L1 (link other than url) program in a
4+
function
5+
"""
6+
# imports
7+
8+
import nltk
9+
import re
10+
11+
# file
12+
13+
f_name="BibTex.ris"
14+
15+
def opener(f_name):
16+
file = open(f_name, 'r', encoding="utf8")
17+
return file
18+
19+
file=opener(f_name)
20+
21+
# end prep
22+
23+
endline=''
24+
file = opener(f_name)
25+
for line in file:
26+
if (re.search('^L1 - ',line)):
27+
starter=line
28+
line=line.lstrip('L1 - ')
29+
# line=line.rstrip('},\n')
30+
31+
endline=line
32+
# print(endline)
33+
return endline
34+
# author=risL1()
35+
# print(risL1)

mainb.py

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
"""
2+
This file calls:
3+
- author
4+
- journal
5+
6+
function inside
7+
file
8+
for each
9+
"""
10+
11+
#_____________________________________
12+
13+
import count
14+
15+
# count.count()
16+
17+
# ____________________________________
18+
19+
import lines
20+
21+
from lines import author
22+
23+
author=author.author()
24+
25+
# ___________________________________
26+
27+
import lines
28+
29+
from lines import year
30+
31+
year=year.year()
32+
33+
# __________________________________
34+
35+
import lines
36+
37+
from lines import title
38+
39+
title=title.title()
40+
41+
# __________________________________
42+
43+
import lines
44+
45+
from lines import journal
46+
47+
journal=journal.journal()
48+
49+
# ___________________________________
50+
51+
import lines
52+
53+
from lines import volume
54+
55+
volume=volume.volume()
56+
57+
# __________________________________
58+
59+
import lines
60+
61+
from lines import number
62+
63+
number=number.number()
64+
65+
# __________________________________
66+
67+
import lines
68+
69+
from lines import pages
70+
71+
pages=pages.pages()
72+
73+
74+
# __________________________________
75+
76+
import lines
77+
78+
from lines import url
79+
80+
url=url.url()
81+
82+
83+
# __________________________________
84+
85+
import lines
86+
87+
from lines import doi
88+
89+
doi=doi.doi()
90+
91+
92+
# __________________________________
93+
94+
import date
95+
96+
date=date.date()
97+
98+
# __________________________________
99+
100+
import andReplacer
101+
102+
andReplacer = andReplacer.andReplacer()
103+
104+
# __________________________________
105+
106+
from lines import risL1
107+
108+
risL1 = risL1.risL1()
109+
110+
# __________________________________
111+
112+
# note on import of last or each module above:
113+
# import module (file), then do
114+
# imported_module.the_function_in_the_imported_module()
115+
# and set the name previously used for the module to be the_function_from_the_module
116+
117+
# __________________________________
118+
119+
# can use either of the following lines:
120+
121+
reference1 = "\n" + "TY - " + "" + "\n" + "TI - " + title + "\n" + "DO - " + doi + "\n" + "UR - " + url + "\n" + "AU - " + author + "\n" + "PY - " + "" + "\n" + "VL - " + volume + "\n" + "M3 - " + risL1 + "\n" + "ER - " + ""
122+
123+
# author + ' (' + year + ') ' + + ' ' + journal + ',' + ' ' + volume + '(' + number + ')' + ' ' + 'pp. ' + pages + ', ' + 'available: ' + doi + ' / ' + url + ' [accessed ' + date + '].'
124+
125+
126+
# reference = andReplacer.andReplacer()
127+
128+
# print("title =", title)
129+
# print("journal", journal)
130+
# print("\ncheckpoint\n")
131+
# print(',')
132+
# print(' ')
133+
# print("volume = ", volume)
134+
# print('(')
135+
# print(number)
136+
# print("\ncheckpoint\n")
137+
138+
139+
print(reference1)

0 commit comments

Comments
 (0)