Skip to content

Keyword search - #3

Open
gaoDean wants to merge 8 commits into
aligrudi:masterfrom
gaoDean:keyword_search
Open

Keyword search #3
gaoDean wants to merge 8 commits into
aligrudi:masterfrom
gaoDean:keyword_search

Conversation

@gaoDean

@gaoDean gaoDean commented Jul 15, 2022

Copy link
Copy Markdown

I didn't want to remember the exact label for each reference in my database, so this patch allows you to enter some keywords as the argument to the citation, and get your reference. The result is score based, so it returns the reference with the highest score.

Cons: .ct has to be on a separate line, because all keywords after .ct are used. (This means you can have spaces in your references and citations).

This patch is best used with the 'title as label' patch, as the score-based matching allows you to match just a few words.

The search works by for each keyword, getting each token of the label of the reference in the database, comparing it to the keyword and adding it to a scores array the size of all the references. Returns the highest scoring reference.

Also, prints to stderr if multiple references with the same score are found, very rare tho unless you did like one keyword. Files before this patch should also be compatible but haven't been tested.
I also haven't tested.[ and .] citations, as I don't use them.

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

Successfully merging this pull request may close these issues.

1 participant