Package gate.util

Examples of gate.util.GateRuntimeException


   
    for(int i = 0; i< text.length(); i++) {
      State.nrInput++;
      currentChar = text.charAt(i);
      if(currentChar == 0) {
        throw new GateRuntimeException("Cannot add a gazetteer entry that contains a binary 0 character!");
      }
      nextState = currentState.next(currentChar);
      if(nextState == null) {
        // TODO: if we get here, the current state could not find a successor
        // state for the given character. If the current state is a
View Full Code Here


        //System.out.println("Trying to get list index "+storeIndex+" curlookup "+curLookup);
        char[] chunk = lookupStore.getListData(storeIndex, curLookup);
        curLookup++;
        return new OurLookup(chunk);
      } else {
        throw new GateRuntimeException("Tried to access next() but no more lookups");
      }
    }
View Full Code Here

  @Override
  public State put(char key, State value) {
    // Now that we use replace for overwriting the state, this should never happen
    // unless our key is still 0
    if(this.key != 0) {
      throw new GateRuntimeException("SingleCharState: put of "+key+" when old key is "+this.key);
    }
    this.key = key;
    this.next = value;
    nrChars++;
    return value;
View Full Code Here

    return value;
  }

  public State replace(char key, State newState, State oldState) {
    if(key != this.key) {
      throw new GateRuntimeException("SingleCharState: Trying to replace key "+this.key+" with key "+key);
    }
    if(next != oldState) {
      throw new GateRuntimeException("SingleCharState: old states differ for replace!");
    }
    this.key = key;
    this.next = newState;
    return newState;
  }
View Full Code Here

    try {
      if (coder == null) {
        openNobleCoder();
      }
    } catch (Exception e) {
      throw (new GateRuntimeException(e));
    }

    inputAnnotSet = document.getAnnotations(getInputAS());
    document.getAnnotations(getOutputAS());
    if (inputAnnotSet == null || inputAnnotSet.isEmpty()) {
      System.err.println("Null or empty input annotations.");
    } else {
      AnnotationSet codableSpanAnnotations = inputAnnotSet.get(getInputAnnotationType());
      if (codableSpanAnnotations == null || codableSpanAnnotations.size() == 0) {
        codableSpanAnnotations = deriveCodableSpansFromDocumentLines();
      }
      if (codableSpanAnnotations == null || codableSpanAnnotations.isEmpty()) {
        throw new GateRuntimeException("NobleCoder Warning:"
            + "No codable spans found for processing!");
      }
      for (gate.Annotation codableSpanAnnotation : codableSpanAnnotations) {
        currentCodableSpanAnnotation = codableSpanAnnotation;
        processCodableSpanAnnotation();
View Full Code Here

    if(lr instanceof Document && ourCorpus.isDocumentLoaded((Document)lr)) {
      try {
        //System.err.println("Syncing document: "+lr.getName());
        ourCorpus.saveDocument((Document)lr);
      } catch (Exception ex) {
        throw new GateRuntimeException("Problem saving document "+lr.getName(),ex);
      }
    } else {
      //System.err.println("Ignoring sync for: "+lr.getName());
    }
  }
View Full Code Here

    try {
      if (coder == null) {
        openNobleCoder();
      }
    } catch (Exception e) {
      throw (new GateRuntimeException(e));
    }

    inputAnnotSet = document.getAnnotations(getInputAS());
    document.getAnnotations(getOutputAS());
    if (inputAnnotSet == null || inputAnnotSet.isEmpty()) {
      System.err.println("Null or empty input annotations.");
    } else {
      AnnotationSet codableSpanAnnotations = inputAnnotSet.get(getInputAnnotationType());
      if (codableSpanAnnotations == null || codableSpanAnnotations.size() == 0) {
        codableSpanAnnotations = deriveCodableSpansFromDocumentLines();
      }
      if (codableSpanAnnotations == null || codableSpanAnnotations.isEmpty()) {
        throw new GateRuntimeException("NobleCoder Warning:"
            + "No codable spans found for processing!");
      }
      for (gate.Annotation codableSpanAnnotation : codableSpanAnnotations) {
        currentCodableSpanAnnotation = codableSpanAnnotation;
        processCodableSpanAnnotation();
View Full Code Here

TOP

Related Classes of gate.util.GateRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.