Merged master and tesseract versions of HocReader.scala.