diff options
Diffstat (limited to 'container-search/src/main/java/com/yahoo/text/interpretation/Modification.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/text/interpretation/Modification.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/text/interpretation/Modification.java b/container-search/src/main/java/com/yahoo/text/interpretation/Modification.java new file mode 100644 index 00000000000..ab92b6de961 --- /dev/null +++ b/container-search/src/main/java/com/yahoo/text/interpretation/Modification.java @@ -0,0 +1,43 @@ +// Copyright 2016 Yahoo Inc. 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; + } + +} + |