blob: 15de2d28865a48d5cb3d7a80d87694d9eda9c37b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.ranking.features;
import com.google.common.annotations.Beta;
import com.yahoo.searchlib.rankingexpression.evaluation.Value;
import java.util.Collections;
import java.util.Map;
/**
* A set of (immutable) computed features
*
* @author bratseth
*/
@Beta
public class Features {
private Map<String, Value> features;
/** Creates a set of features by assigning ownership of map of features to this */
Features(Map<String, Value> features) {
this.features = Collections.unmodifiableMap(features);
}
/** Returns the Value of a feature, or null if it is not present in this */
public Value get(String featureName) {
return features.get(featureName);
}
}
|