package org.algorithm.core.cnn.entity;

import org.algorithm.core.cnn.entity.Lemma;

/**
 * @Author: bijl
 * @Date: 2019/1/22 12:23
 * @Decription:
 */
public class LemmaInfo {
    private Integer length;
    private Integer offset;
    private String property;
    private String text;

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    /**
     * 转Lemma
     * @return
     */
    public Lemma toLemma(){
        Lemma lemma = new Lemma();
        lemma.setLen(this.length);
        lemma.setProperty(this.property);
        lemma.setText(this.text);
        lemma.setPosition(this.offset + "," + (this.offset + this.length - 1));
        return lemma;
    }

}
