Skip to content

Instantly share code, notes, and snippets.

@jmazzi
Created June 25, 2014 19:47
Show Gist options
  • Save jmazzi/befd50fad91ae9b589db to your computer and use it in GitHub Desktop.
Save jmazzi/befd50fad91ae9b589db to your computer and use it in GitHub Desktop.
non_boundary = boundary(this_query_char) do |index,score|
if index && score
this_score = index + 1
this_score + score
end
end
if non_boundary
boundary = boundary(/\b#{this_query_char}/) do |index, score|
if index && score
score + 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment