mjpost / bibsearch

Download, manage, and search a BibTeX database.
Other
63 stars 5 forks source link

User friendly extensions #6

Closed davvil closed 6 years ago

davvil commented 6 years ago

Two extensions to make usage more user friendly. Search by default outputs a human-readable format:

$ /usr/local/opt/python3/bin/python3 ./bibsearch.py search matt post joshua
W11-2160: Jonathan Weese, Juri Ganitkevitch, Chris Callison-Burch,
  Matt Post and Adam Lopez "Joshua 3.0: Syntax-based Machine
  Translation with the Thrax Grammar Extractor", 2011

W12-3134: Juri Ganitkevitch, Yuan Cao, Jonathan Weese, Matt Post and
  Chris Callison-Burch "Joshua 4.0: Packing, PRO, and Paraphrases",
  2012

W13-2226: Matt Post, Juri Ganitkevitch, Luke Orland, Jonathan Weese,
  Yuan Cao and Chris Callison-Burch "Joshua 5.0: Sparser, Better,
  Faster, Server", 2013

(You can still get the bibtex entries with the -b flag). From this list the bibtex keys can already be copied and used in an article, e.g.

In the interesting papers \cite{W17-4770}, \cite{W07-0705} and \cite{W13-2226}
it is shown that $1=1$.

Once the .aux file is generated after the first LaTeX run, the bibfile can be automatically generated.

$ /usr/local/opt/python3/bin/python3 ./bibsearch.py tex tex/aaa.tex
@inproceedings{W17-4770,
  author       = {Popovi{\'{c}}, Maja},
  title        = {chrF++: words helping character n-grams},
  booktitle    = {Proceedings of the Second Conference on Machine
    Translation},
  year         = 2017,
  publisher    = {Association for Computational Linguistics},
  pages        = {612--618},
  location     = {Copenhagen, Denmark},
  url          = {http://aclweb.org/anthology/W17-4770},
}

@inproceedings{W07-0705,
  author       = {Vilar, David and Peter, Jan-Thorsten and Ney,
    Hermann},
  title        = {Can We Translate Letters?},
  booktitle    = {Proceedings of the Second Workshop on Statistical
    Machine Translation},
  year         = 2007,
  publisher    = {Association for Computational Linguistics},
  pages        = {33--39},
  location     = {Prague, Czech Republic},
  url          = {http://www.aclweb.org/anthology/W07-0705},
}

@inproceedings{W13-2226,
  author       = {Post, Matt and Ganitkevitch, Juri and Orland, Luke
    and Weese, Jonathan and Cao, Yuan and Callison-Burch, Chris},
  title        = {Joshua 5.0: Sparser, Better, Faster, Server},
  booktitle    = {Proceedings of the Eighth Workshop on Statistical
    Machine Translation},
  year         = 2013,
  publisher    = {Association for Computational Linguistics},
  pages        = {206--212},
  location     = {Sofia, Bulgaria},
  url          = {http://www.aclweb.org/anthology/W13-2226},
}

Or automatically create the corresponding file (path taken from the .aux file).

$ /usr/local/opt/python3/bin/python3 ./bibsearch.py tex tex/aaa.tex -b
INFO:root:Writing bib file tex/bibliography.bib.

In addition, duplicate checking when adding entries has been reactivated, and len and iteration (i.e. the print command) have been implemented for the sqlite3 backend. This could have been a separate PR, but I have the feeling I'm spamming enough as it is.