All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dmg.pmml.TextIndexNormalization Maven / Gradle / Ivy

There is a newer version: 1.6.5
Show newest version

package org.dmg.pmml;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.dmg.pmml.adapters.IntegerAdapter;
import org.jpmml.model.MissingElementException;
import org.jpmml.model.annotations.ValueConstructor;

@XmlRootElement(name = "TextIndexNormalization", namespace = "http://www.dmg.org/PMML-4_4")
@XmlType(name = "", propOrder = {
    "extensions",
    "tableLocator",
    "inlineTable"
})
@org.jpmml.model.annotations.Added((org.dmg.pmml.Version.PMML_4_2))
@JsonRootName("TextIndexNormalization")
@JsonPropertyOrder({
    "inField",
    "outField",
    "regexField",
    "recursive",
    "caseSensitive",
    "maxLevenshteinDistance",
    "wordSeparatorCharacterRE",
    "wordRE",
    "tokenize",
    "extensions",
    "tableLocator",
    "inlineTable"
})
public class TextIndexNormalization
    extends org.dmg.pmml.PMMLObject
    implements HasExtensions , HasTable
{

    @XmlAttribute(name = "inField")
    @JsonProperty("inField")
    private String inField;
    @XmlAttribute(name = "outField")
    @JsonProperty("outField")
    private String outField;
    @XmlAttribute(name = "regexField")
    @JsonProperty("regexField")
    private String regexField;
    @XmlAttribute(name = "recursive")
    @JsonProperty("recursive")
    private Boolean recursive;
    @XmlAttribute(name = "isCaseSensitive")
    @JsonProperty("isCaseSensitive")
    private Boolean caseSensitive;
    @XmlAttribute(name = "maxLevenshteinDistance")
    @XmlJavaTypeAdapter(IntegerAdapter.class)
    @JsonProperty("maxLevenshteinDistance")
    private Integer maxLevenshteinDistance;
    @XmlAttribute(name = "wordSeparatorCharacterRE")
    @JsonProperty("wordSeparatorCharacterRE")
    private String wordSeparatorCharacterRE;
    @XmlAttribute(name = "x-wordRE")
    @org.jpmml.model.annotations.Added((org.dmg.pmml.Version.XPMML))
    @JsonProperty("x-wordRE")
    private String wordRE;
    @XmlAttribute(name = "tokenize")
    @JsonProperty("tokenize")
    private Boolean tokenize;
    @XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_4")
    @JsonProperty("Extension")
    private List extensions;
    @XmlElement(name = "TableLocator", namespace = "http://www.dmg.org/PMML-4_4")
    @JsonProperty("TableLocator")
    private TableLocator tableLocator;
    @XmlElement(name = "InlineTable", namespace = "http://www.dmg.org/PMML-4_4")
    @JsonProperty("InlineTable")
    private InlineTable inlineTable;
    private final static Boolean DEFAULT_RECURSIVE = false;
    private final static long serialVersionUID = 67371270L;

    public TextIndexNormalization() {
    }

    @ValueConstructor
    public TextIndexNormalization(
        @org.jpmml.model.annotations.Property("inlineTable")
        InlineTable inlineTable) {
        this.inlineTable = inlineTable;
    }

    public String getInField() {
        if (inField == null) {
            return "string";
        } else {
            return inField;
        }
    }

    public TextIndexNormalization setInField(
        @org.jpmml.model.annotations.Property("inField")
        String inField) {
        this.inField = inField;
        return this;
    }

    public String getOutField() {
        if (outField == null) {
            return "stem";
        } else {
            return outField;
        }
    }

    public TextIndexNormalization setOutField(
        @org.jpmml.model.annotations.Property("outField")
        String outField) {
        this.outField = outField;
        return this;
    }

    public String getRegexField() {
        if (regexField == null) {
            return "regex";
        } else {
            return regexField;
        }
    }

    public TextIndexNormalization setRegexField(
        @org.jpmml.model.annotations.Property("regexField")
        String regexField) {
        this.regexField = regexField;
        return this;
    }

    public boolean isRecursive() {
        if (recursive == null) {
            return DEFAULT_RECURSIVE;
        } else {
            return recursive;
        }
    }

    public TextIndexNormalization setRecursive(
        @org.jpmml.model.annotations.Property("recursive")
        Boolean recursive) {
        this.recursive = recursive;
        return this;
    }

    public Boolean isCaseSensitive() {
        return caseSensitive;
    }

    public TextIndexNormalization setCaseSensitive(
        @org.jpmml.model.annotations.Property("caseSensitive")
        Boolean caseSensitive) {
        this.caseSensitive = caseSensitive;
        return this;
    }

    public Integer getMaxLevenshteinDistance() {
        return maxLevenshteinDistance;
    }

    public TextIndexNormalization setMaxLevenshteinDistance(
        @org.jpmml.model.annotations.Property("maxLevenshteinDistance")
        Integer maxLevenshteinDistance) {
        this.maxLevenshteinDistance = maxLevenshteinDistance;
        return this;
    }

    public String getWordSeparatorCharacterRE() {
        return wordSeparatorCharacterRE;
    }

    public TextIndexNormalization setWordSeparatorCharacterRE(
        @org.jpmml.model.annotations.Property("wordSeparatorCharacterRE")
        String wordSeparatorCharacterRE) {
        this.wordSeparatorCharacterRE = wordSeparatorCharacterRE;
        return this;
    }

    public String getWordRE() {
        return wordRE;
    }

    public TextIndexNormalization setWordRE(
        @org.jpmml.model.annotations.Property("wordRE")
        String wordRE) {
        this.wordRE = wordRE;
        return this;
    }

    public Boolean isTokenize() {
        return tokenize;
    }

    public TextIndexNormalization setTokenize(
        @org.jpmml.model.annotations.Property("tokenize")
        Boolean tokenize) {
        this.tokenize = tokenize;
        return this;
    }

    @Override
    public boolean hasExtensions() {
        return ((this.extensions!= null)&&(!this.extensions.isEmpty()));
    }

    @Override
    public List getExtensions() {
        if (extensions == null) {
            extensions = new ArrayList();
        }
        return this.extensions;
    }

    @Override
    public TextIndexNormalization addExtensions(Extension... extensions) {
        getExtensions().addAll(Arrays.asList(extensions));
        return this;
    }

    @Override
    public TableLocator getTableLocator() {
        return tableLocator;
    }

    @Override
    public TextIndexNormalization setTableLocator(
        @org.jpmml.model.annotations.Property("tableLocator")
        TableLocator tableLocator) {
        this.tableLocator = tableLocator;
        return this;
    }

    public InlineTable requireInlineTable() {
        if (this.inlineTable == null) {
            throw new MissingElementException(this, PMMLElements.TEXTINDEXNORMALIZATION_INLINETABLE);
        }
        return this.inlineTable;
    }

    @Override
    public InlineTable getInlineTable() {
        return inlineTable;
    }

    @Override
    public TextIndexNormalization setInlineTable(
        @org.jpmml.model.annotations.Property("inlineTable")
        InlineTable inlineTable) {
        this.inlineTable = inlineTable;
        return this;
    }

    @Override
    public VisitorAction accept(Visitor visitor) {
        VisitorAction status = visitor.visit(this);
        if (status == VisitorAction.CONTINUE) {
            visitor.pushParent(this);
            if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
                status = org.dmg.pmml.PMMLObject.traverse(visitor, getExtensions());
            }
            if (status == VisitorAction.CONTINUE) {
                status = org.dmg.pmml.PMMLObject.traverse(visitor, getTableLocator(), getInlineTable());
            }
            visitor.popParent();
        }
        if (status == VisitorAction.TERMINATE) {
            return VisitorAction.TERMINATE;
        }
        return VisitorAction.CONTINUE;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy