odyssey
odyssey copied to clipboard
Gunning Fog returns zero
Odyssey.analyze_all(text)
Executes and returns good results for Flesh-Kincaid GL but zero for the Gunning Fog index, whatever is supplied as text
.
Odyssey.flesch_kincaid_gl(text)
Again, works as expected, but:
Odyssey.gunning_fog(text)
Errors with:
/opt/homebrew/lib/ruby/gems/3.2.0/gems/odyssey-0.3.2/lib/odyssey/engine.rb:189:in
merge_scores_with_sentences': undefined method
length' for 0:Integer (NoMethodError)for i in 0..@score_by_sentence.length-1 ^^^^^^^
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/odyssey-0.3.2/lib/odyssey/engine.rb:181:in
get_stats' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/odyssey-0.3.2/lib/odyssey.rb:14:in
analyze' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/odyssey-0.3.2/lib/odyssey.rb:47:inmethod_missing' from /Users/npr/test-fog-workflow/lib/fkgl.rb:11:in
block in initialize' from /Users/npr/test-fog-workflow/lib/fkgl.rb:9:inmap' from /Users/npr/test-fog-workflow/lib/fkgl.rb:9:in
initialize' from bin/readability:22:innew' from bin/readability:22:in
index' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.3.0/lib/thor/command.rb:28:inrun' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in
invoke_command' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.3.0/lib/thor.rb:527:indispatch' from /opt/homebrew/lib/ruby/gems/3.2.0/gems/thor-1.3.0/lib/thor/base.rb:584:in
start' from bin/readability:27:in `'
There seems to be some discrepancy in the way the Gunning Fog is described, sometimes 'Gunning Fog' and sometimes 'Gunning Fog Score', but trying both gives zero in:
Odyssey.analyze(text,'Gunning Fog')