(line: str)
| 1950 | |
| 1951 | |
| 1952 | def is_plausible_pdf_title_line(line: str) -> bool: |
| 1953 | normalized = clean_pdf_line(line) |
| 1954 | lower = normalized.lower() |
| 1955 | if len(normalized) < 20 or len(normalized.split()) < 4: |
| 1956 | return False |
| 1957 | if normalized.count(",") >= 3: |
| 1958 | return False |
| 1959 | if any(token in lower for token in ["doi.org/", "http://", "https://", "www.", "check for updates"]): |
| 1960 | return False |
| 1961 | if lower in {"abstract", "article", "preprint"}: |
| 1962 | return False |
| 1963 | if lower.startswith("npj |") or lower.startswith("arxiv:") or lower.startswith("submitted to"): |
| 1964 | return False |
| 1965 | if " doi:" in lower or lower.startswith("doi:"): |
| 1966 | return False |
| 1967 | return True |
| 1968 | |
| 1969 | |
| 1970 | def first_page_title_candidate(first_page_text: str) -> str: |
no test coverage detected