The count currently uses a simple linear search. To use it for real on large quantities of HTML, the algorithm should probably be changed to use a hash table. Can be run on its own output. Output to stdout. Can be run on its own output.
Modified source is written to stdout.
Can be run on its own output. Expand entities to UTF-8 sequences. Unknown entities are not expanded. The file may be a URL as well. Uses a refer-style database of citations.