Skip to content

Instantly share code, notes, and snippets.

@jlandahl
Created November 8, 2013 01:31
Show Gist options
  • Save jlandahl/7364829 to your computer and use it in GitHub Desktop.
Save jlandahl/7364829 to your computer and use it in GitHub Desktop.
def titleScore(titleWords: Array[String], sentence: Array[String]) =
sentence.count(w => !stopWords.contains(w) && titleWords.contains(w)) / titleWords.size.toDouble
def foo(w: String) = !stopWords.contains(w) && titleWords.contains(w)
def titleScore(titleWords: Array[String], sentence: Array[String]) =
sentence.count(foo) / titleWords.size.toDouble
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment