Spaces:
Running
Running
Update smart_fallback.py
Browse files- smart_fallback.py +5 -4
smart_fallback.py
CHANGED
|
@@ -135,7 +135,7 @@ def smart_google_queries(accession_id, metadata: dict):
|
|
| 135 |
if match:
|
| 136 |
organism = match.group(1)
|
| 137 |
queries.append(f'"{accession_id}" "{organism}" mitochondrial')
|
| 138 |
-
|
| 139 |
if author and author!="unknown" and author!="Unpublished":
|
| 140 |
try:
|
| 141 |
author_name = ".".join(author.split(' ')[0].split(".")[:-1]) # Use last name only
|
|
@@ -146,7 +146,7 @@ def smart_google_queries(accession_id, metadata: dict):
|
|
| 146 |
author_name = author
|
| 147 |
queries.append(f'"{accession_id}" "{author_name}" mitochondrial DNA')
|
| 148 |
#queries.append(f'"{author_name}" mtDNA site:researchgate.net')
|
| 149 |
-
|
| 150 |
# if institution and institution!="unknown" and institution!="Unpublished":
|
| 151 |
# try:
|
| 152 |
# short_inst = ",".join(institution.split(',')[:2]) # Take first part of institution
|
|
@@ -175,9 +175,10 @@ def smart_google_queries(accession_id, metadata: dict):
|
|
| 175 |
|
| 176 |
if year:
|
| 177 |
queries.append(f'"{accession_id}" "{year}"')
|
| 178 |
-
|
| 179 |
if title and title!='unknown' and title not in ["Unpublished","Direct Submission"]:
|
| 180 |
-
queries.append(f'"{title}"')
|
|
|
|
| 181 |
return queries
|
| 182 |
|
| 183 |
|
|
|
|
| 135 |
if match:
|
| 136 |
organism = match.group(1)
|
| 137 |
queries.append(f'"{accession_id}" "{organism}" mitochondrial')
|
| 138 |
+
print("done definition")
|
| 139 |
if author and author!="unknown" and author!="Unpublished":
|
| 140 |
try:
|
| 141 |
author_name = ".".join(author.split(' ')[0].split(".")[:-1]) # Use last name only
|
|
|
|
| 146 |
author_name = author
|
| 147 |
queries.append(f'"{accession_id}" "{author_name}" mitochondrial DNA')
|
| 148 |
#queries.append(f'"{author_name}" mtDNA site:researchgate.net')
|
| 149 |
+
print("done author")
|
| 150 |
# if institution and institution!="unknown" and institution!="Unpublished":
|
| 151 |
# try:
|
| 152 |
# short_inst = ",".join(institution.split(',')[:2]) # Take first part of institution
|
|
|
|
| 175 |
|
| 176 |
if year:
|
| 177 |
queries.append(f'"{accession_id}" "{year}"')
|
| 178 |
+
print("done institution")
|
| 179 |
if title and title!='unknown' and title not in ["Unpublished","Direct Submission"]:
|
| 180 |
+
queries.append(f'"{title}"')
|
| 181 |
+
print("done title")
|
| 182 |
return queries
|
| 183 |
|
| 184 |
|