minivan/middleman-spellcheck — pull request #10 by olds22 (2014-10-20 18:29:58+00:00)
Title: fixed inconsistent word count issue (Github issue #7)

I had the same problems as issue #7, with correctly spelled words being reported misspelled.

I found that sometimes Nokogiri's doc.text included some blank words in the array (ex: ["", "Title", "Text"]). When the text was joined to be parsed by aspell, it would ignore the blank words, leading to an inconsistent array size when sending the new_result to be mapped onto the original word list. So, now the code joins the word list right away, then re-splits it before zipping it up with the results, which ensures that both the results array and the new word list array are the same size.

Hopefully that explains everything. If you know a better or faster way to ensure the consistency, feel free to modify my suggestions.