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

org.nlp2rdf.validator.NIFBeanNumbersValidator Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
package org.nlp2rdf.validator;


import org.nlp2rdf.bean.NIFBean;
import org.nlp2rdf.bean.NIFType;

import java.util.List;

public class NIFBeanNumbersValidator implements NIFMessagesException {

    public static void checkIfEndIndexIsGreaterThanBeginIndex(List beans) {

        beans.forEach(bean -> {

            if (NIFType.ENTITY.equals(bean.getNifType())) {
                assert bean.getEndIndex() > bean.getBeginIndex() : String.format(NIF_DATA_VALUE_MUST_BE_GREATER,
                        NIF_DATA_BEGIN_INDEX, NIF_DATA_END_INDEX, bean.getMention());
            }
        });

    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy