
edu.jhu.hlt.concrete.validation.ValidatableSentence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of concrete-validation Show documentation
Show all versions of concrete-validation Show documentation
Validation library for use with Concrete-Java
/*
* Copyright 2012-2015 Johns Hopkins University HLTCOE. All rights reserved.
* This software is released under the 2-clause BSD license.
* See LICENSE in the project root directory.
*/
package edu.jhu.hlt.concrete.validation;
import edu.jhu.hlt.concrete.Communication;
import edu.jhu.hlt.concrete.Sentence;
/**
* @author max
*
*/
public class ValidatableSentence extends AbstractAnnotation {
/**
*
*/
public ValidatableSentence(Sentence st) {
super(st);
}
/*
* (non-Javadoc)
*
* @see edu.jhu.hlt.concrete.validation.AbstractAnnotation#isValidWithComm(edu.jhu.hlt.concrete.Communication)
*/
@Override
protected boolean isValidWithComm(Communication c) {
return this.printStatus("TextSpan must be set", this.annotation.isSetTextSpan())
&& new ValidatableTextSpan(this.annotation.getTextSpan()).validate(c);
}
/*
* (non-Javadoc)
*
* @see edu.jhu.hlt.concrete.validation.AbstractAnnotation#isValid()
*/
@Override
public boolean isValid() {
return this.validateUUID(this.annotation.getUuid())
// TODO: Change hard coded TextSpan to consider AudioSpan if it exists.
&& this.printStatus("TextSpan must be set", this.annotation.isSetTextSpan());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy