Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.60 KB | None | 0 0
  1.           // Find and remove the common prefix of security description and trailer, so the trailer only contains meaningful information
  2.           // TODO this is too clever, simplify!
  3.           val secWords = whitespace.split(secDesc).toList.map(Some(_))
  4.           val trailer = trans.getTrailer
  5.           val trailerWords = whitespace.split(trailer).toList.map(Some(_))
  6.           val zipped = secWords.zipAll(trailerWords, None, None)
  7.           val newTrailerWords: List[String] = zipped.dropWhile {
  8.             case (Some(sw), Some(tw)) => sw == tw
  9.             case _ => false
  10.           }.flatMap(_._2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement