summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/text/interpretation/Modification.java
blob: e2fd5a5ec5c5342666bdbcd2893035bb418e1750 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.text.interpretation;

import java.util.HashMap;

/**
 * A modification of a text.
 *
 * This class represents a possible rewrite of an original text. Reasons for rewrite may be due to possible
 * spelling errors in the text or to query expansion.
 *
 * @author <a href="mailto:arnebef@yahoo-inc.com">Arne Bergene Fossaa</a>
 */
public class Modification extends HashMap<String,Object>{

    /**
     *
     */
    private static final long serialVersionUID = -8522335044460396296L;


    public final static AnnotationClass MODIFICATION_CLASS = new AnnotationClass("modification");


    private String text;
    private Annotations annotations;

    public Modification(String text) {
        this.text = text;
        Span span = new Span(this);
        this.annotations = span.annotate(MODIFICATION_CLASS);
    }

    public String getText() {
        return text;
    }

    public Annotations getAnnotation() {
        return annotations;
    }

}