vim_pandoc/citeproc.py

Initial work on the pandoc-citeproc based bibliography collator.

Can currently be used to search within multiple bibliographies, with the
arguments passed as an OR'ed query:

    ./citeproc.py kant kripke
Merge in work from bibliography_refactor_old

Primarily adding functions written in the (now abandoned) branch bibliography_refactor.

Stuff added:
* (New) Class CSLItem
	- __init__
		+ Takes CSL formatted dict.
	- citekey method
	- as_array(variable name) method.
		+ returns variable as array of strings. Not sure why I thought this was
		  a good idea...
		+ Currently unfunctional.
	- match(query) method.
		+ returns a 'match' value for a regexp query. Potentially will be rewritten
		  later to accept strings and remove the CiteprocQuery class.
		+ 'match' value is currently integer, but may be float in future.
	- matches(query) method.
		+ False if match(query) zero. True otherwise.
	- formatted method.
		+ returns a formatted name/date/title string. Currently placeholder only.

* (New) Class CiteprocQuery
	- __init__
		+ takes string, splits at whitespace, compiles into regexps.
	- match(entry)
		+ takes CSLItem, and checks for match with each regexp. Returns a float
		  between 0 and 1 corresponding to number of matches.
	- matches(entry)
		+ returns true if there is a match.

* class CiteprocSource:
	- __init__
		+ rewritten to cope with malformed bibliographies. Doesn't yet raise
		  an error though.
		+ creates self.data, an array of CSLItems.
	- __iter__
		+ iterates over self.data

* class SourceCollator:
	- find_bibfiles(filename, sources, local_bib_extensions)
		+ wholesale rewrite/copy from bibliography_refactor.
		+ returns list of paths for bibliography files.
		+ all variables are optional.
	- collate()
		+ rewritten to work with new functions &c.