Skip to content

Commit 90a204c

Browse files
Vedant DiwanjiVedant Diwanji
authored andcommitted
Minor Update to regex
1 parent 4d3fd6e commit 90a204c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,12 @@ def classify(scores, threshold):
168168
## Returns a list of bibtex citations
169169
def extract_bibtex(readme_text):
170170
print("Extracting bibtex citation from readme")
171-
regex = r'\@[a-zA-z]+\{[.\n\S\s]+?author[.\n\S\s]+?title[.\n\S\s]+?\n\}'
171+
regex = r'\@[a-zA-z]+\{[.\n\S\s]+?[author|title][.\n\S\s]+?[author|title][.\n\S\s]+?\n\}'
172172
excerpts = readme_text
173173
citations = re.findall(regex,excerpts)
174174
print("Extracting bibtex citation from readme completed.")
175+
print(citations)
176+
print(len(citations))
175177
return citations
176178

177179
## Function takes metadata, readme text predictions, bibtex citations and path to the output file

0 commit comments

Comments
 (0)