com.basistech.rosette.dm.jackson.AnnotatedTextMixin Maven / Gradle / Ivy
/*
* Copyright 2014 Basis Technology Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.basistech.rosette.dm.jackson;
import com.basistech.rosette.dm.BaseAttribute;
import com.basistech.rosette.dm.BaseNounPhrase;
import com.basistech.rosette.dm.CategorizerResult;
import com.basistech.rosette.dm.Dependency;
import com.basistech.rosette.dm.Embeddings;
import com.basistech.rosette.dm.Entity;
import com.basistech.rosette.dm.Keyphrase;
import com.basistech.rosette.dm.LanguageDetection;
import com.basistech.rosette.dm.ListAttribute;
import com.basistech.rosette.dm.RelationshipMention;
import com.basistech.rosette.dm.ScriptRegion;
import com.basistech.rosette.dm.Sentence;
import com.basistech.rosette.dm.Token;
import com.basistech.rosette.dm.Concept;
import com.basistech.rosette.dm.TranslatedData;
import com.basistech.rosette.dm.TranslatedTokens;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonAppend;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.util.List;
import java.util.Map;
/**
* {@link com.basistech.rosette.dm.AnnotatedText}.
*/
@JsonAppend(prepend = true, props = { @JsonAppend.Prop(value = VersionProperty.class, name = "version")})
@JsonInclude(JsonInclude.Include.NON_NULL)
@SuppressWarnings("deprecated")
public abstract class AnnotatedTextMixin {
@JsonCreator
AnnotatedTextMixin(@JsonProperty("data") CharSequence data,
@JsonProperty("attributes") Map attributes,
@JsonProperty("documentMetadata") Map> documentMetadata,
/* work around https://github.com/FasterXML/jackson-databind/issues/1118,
* and also quickly check for ADMs from 'the future'. */
@JsonProperty("version")
@JsonDeserialize(using = VersionCheckDeserializer.class)
String version) {
//
}
@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeIdResolver(DmTypeIdResolver.class)
public abstract Map getAttributes();
/* prevent Jackson from serializing a complex object here. */
@JsonSerialize(using = ToStringSerializer.class)
public abstract CharSequence getData();
@JsonIgnore
public abstract ListAttribute getTokens();
@JsonIgnore
public abstract ListAttribute getTranslatedData();
@JsonIgnore
public abstract ListAttribute getTranslatedTokens();
@SuppressWarnings("deprecation")
@JsonIgnore
public abstract ListAttribute getEntityMentions();
@SuppressWarnings("deprecation")
@JsonIgnore
public abstract ListAttribute getResolvedEntities();
@JsonIgnore
public abstract ListAttribute getRelationshipMentions();
@JsonIgnore
public abstract ListAttribute getScriptRegions();
@JsonIgnore
public abstract ListAttribute getSentences();
@JsonIgnore
public abstract ListAttribute getBaseNounPhrases();
@JsonIgnore
public abstract ListAttribute getLanguageDetectionRegions();
@JsonIgnore
public abstract LanguageDetection getWholeTextLanguageDetection();
@JsonIgnore
public abstract ListAttribute getCategorizerResults();
@JsonIgnore
public abstract ListAttribute getSentimentResults();
@JsonIgnore
public abstract ListAttribute getTopicResults();
@JsonIgnore
public abstract ListAttribute getEntities();
@JsonIgnore
public abstract ListAttribute getDependencies();
@JsonIgnore
public abstract Embeddings getEmbeddings();
@JsonIgnore
public abstract ListAttribute getConcepts();
@JsonIgnore
public abstract ListAttribute getKeyphrases();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy