Content-based text line comparison for historical document retrieval