This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', 'a[href*="#"]', function(e) { | |
var $anchor = $(this), | |
hash = $anchor.attr('href'), | |
url = hash.substr(0, hash.indexOf('#')), | |
$hash = $(hash.substr(hash.indexOf('#'))); | |
if(url.indexOf(document.location.pathname) >= 0 && $hash.length > 0) | |
{ | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'lingua/en/readability' | |
class Haiku | |
def initialize(text) | |
@report = Lingua::EN::Readability.new(text) | |
@used_words = Array.new | |
end | |
def get_most_used_words(words) | |
top_words = Array.new | |
words.sort{|a,b| a[1]<=>b[1]}.slice(words.length/2..words.length).each do |a| |