aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/intent/model/IntentNode.java
blob: 6f0677cfadabd3e6fbafdd09d28307c56ab270c1 (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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.intent.model;

/**
 * An intent in an intent model tree. The intent node score is the <i>probability</i> of this intent
 * given the parent interpretation.
 *
 * @author bratseth
 */
public class IntentNode extends ParentNode<SourceNode> {

    private Intent intent;

    public IntentNode(Intent intent,double probabilityScore) {
        super(probabilityScore);
        this.intent=intent;
    }

    /** Returns the intent of this node, this is never null */
    public Intent getIntent() { return intent; }

    public void setIntent(Intent intent) { this.intent=intent; }

    /** Returns intent:probability */
    @Override
    public String toString() {
        return intent + ":" + getScore();
    }

}