toadhats / readability-webtask

a simple practice webtask, attempts to compute readability of 'body text' of a given page
0 stars 0 forks source link

sentence counter is not working #1

Closed toadhats closed 8 years ago

toadhats commented 8 years ago

It always returns 2 and so far i haven't been able to figure out why. The most likely culprit is the regex, but 1. I've tried different formulas and encountered the same bug, and 2. I've been using formulas that other people have said worked for them... so maybe the problem lies elsewhere.

toadhats commented 8 years ago

Simple mistake, the regex needed /g to catch every match, not just the first one. Belief that regex is nearly always to blame reinforced. It works now, but it's giving lower readability scores than the existing online service I tried benchmarking against. Still needs refinement.