Commit 3203f457 authored by 高雅喆's avatar 高雅喆

change build file

parent 8aabb5af
...@@ -26,8 +26,7 @@ libraryDependencies ++= Seq( ...@@ -26,8 +26,7 @@ libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.5" % "test", "org.scalatest" %% "scalatest" % "3.0.5" % "test",
"com.github.nscala-time" %% "nscala-time" % "2.18.0", "com.github.nscala-time" %% "nscala-time" % "2.18.0",
"com.github.scopt" %% "scopt" % "3.7.0", "com.github.scopt" %% "scopt" % "3.7.0",
"com.google.guava" % "guava" % "19.0", "com.google.guava" % "guava" % "19.0"
"com.github.fommil.netlib" % "all" % "1.1.2"
) )
lazy val root = (project in file(".")).settings(commonSettings: _*) lazy val root = (project in file(".")).settings(commonSettings: _*)
......
...@@ -180,7 +180,7 @@ object Main { ...@@ -180,7 +180,7 @@ object Main {
val result = remapSecond.groupBy(_._1).map { val result = remapSecond.groupBy(_._1).map {
case (word1, similarWords) => case (word1, similarWords) =>
// sort by score desc. and take top 10 entries // sort by score desc. and take top 10 entries
val similar = similarWords.toSeq.sortBy(-1 * _._3).take(10).map(_._2).mkString(",") val similar = similarWords.toSeq.sortBy(-1 * _._3).filter(_._2.startsWith("diary")).take(10).map(_._2).mkString(",")
(word1,s"$similar") (word1,s"$similar")
} }
// print out the results for the first 10 words // print out the results for the first 10 words
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment