Extract arXiv ID from text
(self, text: str)
| 788 | return [] |
| 789 | |
| 790 | def _extract_arxiv_id(self, text: str) -> Optional[str]: |
| 791 | """Extract arXiv ID from text""" |
| 792 | # Match both old (e.g., 1706.03762) and new (e.g., arxiv:1706.03762) formats |
| 793 | arxiv_patterns = [ |
| 794 | r'arxiv[:\s]*(\d{4}\.\d{4,5})', # New format |
| 795 | r'\b(\d{4}\.\d{4,5})\b', # Standalone ID |
| 796 | r'arXiv:(\d{4}\.\d{4,5})', # With arXiv prefix |
| 797 | ] |
| 798 | |
| 799 | for pattern in arxiv_patterns: |
| 800 | match = re.search(pattern, text, re.IGNORECASE) |
| 801 | if match: |
| 802 | return match.group(1) |
| 803 | return None |
| 804 | |
| 805 | def _extract_arxiv_id_from_url(self, url: str) -> Optional[str]: |
| 806 | """Extract arXiv ID from arXiv URL""" |
no outgoing calls