the-algorithm/home-mixer/server/src/main/scala/com/twitter/home_mixer/functional_component/decorator/HomeQueryTypePredicates.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

19 lines
773 B
Scala

package com.twitter.home_mixer.functional_component.decorator
import com.twitter.home_mixer.model.HomeFeatures._
import com.twitter.product_mixer.core.feature.featuremap.FeatureMap
object HomeQueryTypePredicates {
private[this] val QueryPredicates: Seq[(String, FeatureMap => Boolean)] = Seq(
("request", _ => true),
("get_initial", _.getOrElse(GetInitialFeature, false)),
("get_newer", _.getOrElse(GetNewerFeature, false)),
("get_older", _.getOrElse(GetOlderFeature, false)),
("pull_to_refresh", _.getOrElse(PullToRefreshFeature, false)),
("request_context_launch", _.getOrElse(IsLaunchRequestFeature, false)),
("request_context_foreground", _.getOrElse(IsForegroundRequestFeature, false))
)
val PredicateMap = QueryPredicates.toMap
}