feat: add suggest command and harden citation resolution#41
Open
HzaCode wants to merge 1 commit into
Open
Conversation
732ce67 to
1a4ac0e
Compare
Add the candidate-only `suggest` command plus a batch of correctness fixes, and scope Google Scholar to `suggest` only. Features: - `onecite suggest`: return candidate matches for plain-text references without producing authoritative BibTeX. `process` now resolves only strong identifiers (DOI/PMID/arXiv/ISBN/URL) and points plain text to `suggest`. - Stable JSON/NDJSON envelopes for process/suggest, plus `doctor`, `benchmark`, and `templates` commands; CrossRef polite-pool headers; reuse of input BibTeX citation keys. Fixes: - DOI-backed BibTeX keeps canonical CrossRef/DataCite fields instead of the original entry's values (original still fills gaps; key preserved). - CrossRef 404 always falls back to DataCite (was limited to ~11 hardcoded prefixes). - `suggest` thesis routing uses whole-word matching (no longer fires on "synthesis"/"hypothesis"/"parenthesis"). - GitHub clone URLs ending in `.git` resolve to the correct repository. - Plain-text entry ids stay contiguous; removed a dead PLOS branch. Changes: - Google Scholar is now an opt-in, best-effort fallback on `suggest` only; removed `--google-scholar` from `process` and the `use_google_scholar` parameter from `process_references()` (both were no-ops there). Documented as not guaranteed reproducible. Tests: 191 passed, 1 skipped; flake8 clean on onecite + tests.
1a4ac0e to
cbea632
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
suggestcommand: returns candidate matches forplain-text references without producing authoritative BibTeX.
processnowresolves only strong identifiers (DOI/PMID/arXiv/ISBN/URL) and points plain
text to
suggest.process/suggest, plusdoctor,benchmark, andtemplatescommands; CrossRef polite-pool headers; reuse ofinput BibTeX citation keys.
suggestonly — an opt-in, best-effort fallback(off by default, may be CAPTCHA-blocked, not guaranteed reproducible).
Removed
--google-scholarfromprocessand theuse_google_scholarparameter from
process_references()(both were no-ops there).Fixes
original entry's values (original still fills gaps; citation key preserved).
prefixes).
suggestthesis routing uses whole-word matching (no longer fires on"synthesis"/"hypothesis"/"parenthesis").
.gitresolve to the correct repository.dead PLOS article-id branch in the text parser.
Test plan
pytest: 191 passed, 1 skipped, 6 deselected (live-marked).flake8 onecite tests: clean.onecite process --helpno longer shows--google-scholar;onecite suggest --helpstill does.