the-algorithm/src/scala/com/twitter/simclusters_v2/score/Score.scala
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
2023-03-31 17:36:31 -05:00

23 lines
465 B
Scala

package com.twitter.simclusters_v2.score
import com.twitter.simclusters_v2.thriftscala.{Score => ThriftScore}
/**
* A uniform value type for all kinds of Calculation Score.
**/
case class Score(score: Double) {
implicit lazy val toThrift: ThriftScore = {
ThriftScore(score)
}
}
object Score {
/**
* Only support Double Type Thrift score
*/
implicit val fromThriftScore: ThriftScore => Score = { thriftScore => Score(thriftScore.score) }
}