Change if refactored to match
This commit is contained in:
parent
573fab9526
commit
376f35f08f
|
@ -102,8 +102,9 @@ object KnownForSources {
|
||||||
TypedPipe
|
TypedPipe
|
||||||
.from(TextLine(textFile))
|
.from(TextLine(textFile))
|
||||||
.flatMap { str =>
|
.flatMap { str =>
|
||||||
if (str.startsWith("#")) {none}
|
str match {
|
||||||
try {
|
case s"#$_" => none
|
||||||
|
case _ => try {
|
||||||
val tokens = str.trim.split("\\s+")
|
val tokens = str.trim.split("\\s+")
|
||||||
val userId = tokens(0).toLong
|
val userId = tokens(0).toLong
|
||||||
(1 until tokens.length).foldRight(Array.newBuilder[(Int, Float)])((i, r) => {
|
(1 until tokens.length).foldRight(Array.newBuilder[(Int, Float)])((i, r) => {
|
||||||
|
@ -127,6 +128,7 @@ object KnownForSources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def stringifyKnownFor(
|
def stringifyKnownFor(
|
||||||
input: TypedPipe[(Long, Array[(Int, Float)])]
|
input: TypedPipe[(Long, Array[(Int, Float)])]
|
||||||
|
|
Loading…
Reference in New Issue