Recently I was given two very long lists of scientific publications. One as a BibTeX file and another as a table in an HTML file. Some of the publications in the BibTeX file were missing in the HTML table and the task was to find out which ones these were. An additional challenge was, that both lists were created manually by different people and therefore author names, titles, etc. did not match character by character. Words with special characters, eg. 'Jörg', would be spelled as 'J\"org' in BibTeX and 'Jörg' in the HTML table.
A simple script that helps with this tedious problem, can be downloaded here. The script reads the .bib and the .html file and compares the title field of every BibTeX entry with every row in the HTML table. The package difflib is used to perform "approximate (sub)string matching". By some string comparison metric, it calculates a value from 0.0 (no match at all) to 1.0 (identical string is contained as a substring).
Finally the script generates a report, that contains all the publications, which are most probably missing.
This blog is supposed to be a collection of random, unrelated, little ideas, thoughts, and discoveries, which I assume to be helpful to a negligible part of the world's population and wish to share out of pure altruism. If posts appear really weird, maybe you have the wrong kind of humor. Many of the posts are science/technology related. If you are opposed to that, stop reading here! Comments, criticism, corrections, amendments, questions are always welcome.
Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts
2013-12-06
Matching Bibtex and HTML
2011-08-23
Mnemosyne Print Flash Cards on Dead Wood
Do you know Mnemosyne? It's an excellent tool for learning flash cards. The only problem is that the computer is an evil distraction machine. So you might decide one day, that you want you print your flashcards to learn them the old school way, which means double sided printing questions and answers out on paper.
Unfortunately Mnemosyne does not have the ability to print flash cards with the question on the front and the answer on the back in double sided print. However flash cards can be exported to xml which can be converted to printable html with the following script. The Python script is a bit shaky and you might have to adapt it for your own needs, but it did the job for me.
Unfortunately Mnemosyne does not have the ability to print flash cards with the question on the front and the answer on the back in double sided print. However flash cards can be exported to xml which can be converted to printable html with the following script. The Python script is a bit shaky and you might have to adapt it for your own needs, but it did the job for me.
Subscribe to:
Posts (Atom)