mabuseif commited on
Commit
f46ae97
·
verified ·
1 Parent(s): b2b6c73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -188,7 +188,7 @@ def format_metadata_html(url, author, year, scc_hash, username, task_name, curre
188
  return f'<a href="{full_url}" data-hash="{scc_hash}">{author} ({year}). {scc_hash}</a>'
189
 
190
  def check_for_fragment(url):
191
- return '#:~:text=' in url
192
 
193
  def parse_citation_text(citation_text):
194
  match = re.match(r'^(?:(\w[\w\s.,&et al]+)\s*\((\d{4})\)|\((\w[\w\s.,&et al]+),\s*(\d{4})\))$', citation_text.strip())
@@ -442,7 +442,7 @@ with tabs[0]:
442
  elif not re.match(r'^\d{4}$', publication_year):
443
  st.error("Please enter a valid 4-digit publication year.")
444
  elif check_for_fragment(source_url):
445
- st.error("The source URL should not contain a text fragment (e.g., #:~:text=).")
446
  else:
447
  # Check word count for Annotated Text
448
  word_count = len(annotated_text.split())
 
188
  return f'<a href="{full_url}" data-hash="{scc_hash}">{author} ({year}). {scc_hash}</a>'
189
 
190
  def check_for_fragment(url):
191
+ return '#:~:text=' in url or '?utm_source=' in url
192
 
193
  def parse_citation_text(citation_text):
194
  match = re.match(r'^(?:(\w[\w\s.,&et al]+)\s*\((\d{4})\)|\((\w[\w\s.,&et al]+),\s*(\d{4})\))$', citation_text.strip())
 
442
  elif not re.match(r'^\d{4}$', publication_year):
443
  st.error("Please enter a valid 4-digit publication year.")
444
  elif check_for_fragment(source_url):
445
+ st.error("It appears you have accessed this link through an AI assistant, such as an AI overview or generative AI writing tool. To ensure academic integrity, please return to the original source and review it carefully before incorporating it into your work. Additionally, consider exploring other relevant sources to deepen your understanding of the topic.")
446
  else:
447
  # Check word count for Annotated Text
448
  word_count = len(annotated_text.split())