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

edu.jhu.hlt.concrete.validation.ValidatableSentence Maven / Gradle / Ivy

There is a newer version: 4.15.0
Show newest version
/*
 * 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