jazzido/tabula-extractor — pull request #5 by jeremybmerrill (2013-05-21 21:02:10+00:00)
Title: insert spaces for TextElement distances slightly less than width_of_space

I found part of the problem with spaces not being inserted that I'd had in tabula-extractor. Some distances between text_elements in `should_add_space?` are reporting themselves as a little less than width_of_space when (from a human perspective) there ought to be a space.

this could be

1. a pdfbox bug,
2. a conceptual problem we have where the width_of_space changes in the document
3. kerning
4. something else entirely

e.g. I'm getting distances in the frx test document (in the table-detection branch) of 1.6399999999999864 with width_of_space 1.668
so a space isn't inserted because 1.64 < 1.668

this PR fixes the problem by inserting a space when the distance is between 95% of width_of_space and width_of_space plus the threshold. 95% wasn't reached scientifically, but gives perfect results empirically.