Coding standards.
Strip out DOCTYPE declaration.

As indicated in the comments, this greatly slows down GSearch, as it
tries to download the DTD definitions from w3.org any time we load
an HOCR file... Wiping the doctype should greatly speed it up.

Ideally, a smarter entity resolver could be used, but adding it in
seems non-trivial (and requires changes to the GSearch code).
Fix a couple derps... Refactoring slightly in due to coder, and broke stuff.
Use regex instead of matching string directly.
Merge pull request #19 from adam-vessey/7.x

Strip DOCTYPE from HOCR (and code standards).
Use drupal_realpath(), to help ensure that the ftruncate() will work.

Looks like the "temporary://" stream wrapper that Drupal includes does
not support ftruncate()...  Resolving the URI to a file works, though.
Merge pull request #21 from adam-vessey/7.x

Use drupal_realpath(), to help ensure that the ftruncate() will work.