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

citation_to_bibkey API function #21

Open
xrotwang opened this issue Feb 18, 2020 · 3 comments
Open

citation_to_bibkey API function #21

xrotwang opened this issue Feb 18, 2020 · 3 comments
Assignees

Comments

@xrotwang
Copy link
Contributor

Implement a function

citation_to_bibkey("Safar & Webster 2014:9", bibfiles, iso, languoids) = "h:SafarWebster:Endangered-Sign"

The languoids argument would be a selection of languoids to consider. For
the use case I am thinking of, building the full index is probably
overkill. I am thinking just read the bibfiles, specified, select on the
languoids argument, and search linearly through that selection. One could
also consider an "searchin" argument where you give a string "Quechuan",
iso "eng" or languoid "blaa1234" and the search is through all languoids
in the subtree identified by the string.

@xrotwang xrotwang self-assigned this Feb 18, 2020
@xrotwang
Copy link
Contributor Author

See glottolog/glottolog#472

@xrotwang
Copy link
Contributor Author

@d97hah The only problem I have with that kind of functionality is the following: How to you treat ambiguity? Do you just return the first hit? Is not finding any an error? citation_to_bibkey sounds as if there should be exactly one hit - because a citation is supposed to identify a source unambiguously. Maybe we should start with that?

Alternatively we could go for iter_bibkeys and just yield hits, so the caller can decide if the first is good enough?

@d97hah
Copy link

d97hah commented Feb 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants