Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPNI script should support searches on abbreviated genus name #18

Open
nickynicolson opened this issue Aug 11, 2022 · 1 comment
Open
Labels
enhancement New feature or request ipni

Comments

@nickynicolson
Copy link
Member

If a user clips semi-structured text from a journal article into Obsidian, the scientific names may be presented with abbreviated genus names, as the context is determined from the containing paper.

The IPNI name search script could do the following:

  • Read the frontmatter, and look for a "genus_context" entry
  • If the search string starts with the first letter of the genus_context entry followed by '. ' then replace it before doing the IPNI name search.

This would ensure that paragraphs like the following could easily be searched by highlighting the species names, even if they are abbreviated (currently only the first could be searched by highlighting the existing text):

These new species are all relatively rare, but not currently of conservation concern. Solanum aspersum sp. nov. is distributed in Colombia and Ecuador, S. luculentum sp. nov. in Colombia and Venezuela, S. sanchez-vegae sp. nov. is endemic to northern Peru and S. sousae sp. nov. to southern Mexico. Solanum luculentum has the morphology of a dioecious species; this is the first report of this breeding system in the Dulcamaroid clade.

The script would receive "S. luculentum" (from document.getSelection()), check the frontmatter (app.metadataCache.getFileCache(file).frontmatter) for a genus_context entry, replace "S." with "Solanum" and proceed with the search and display of matches. If no genus context is available or if the abbreviation does not match then the search should proceed as normal.

@nickynicolson nickynicolson added enhancement New feature or request ipni labels Aug 11, 2022
@nickynicolson nickynicolson changed the title IPNI script to should support searches on abbreviated genus name IPNI script should support searches on abbreviated genus name Aug 11, 2022
@nickynicolson
Copy link
Member Author

See the crossref script (js/crossref.js) which does something similar (reading DOI from frontmatter to use as searchterm).

@nickynicolson nickynicolson transferred this issue from another repository Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ipni
Projects
None yet
Development

No branches or pull requests

1 participant