Package gate.util

Examples of gate.util.GateRuntimeException


   */
  public char[] getListData(int index, int element) {
    // get the first block which must exist
    int size = getListSize(index);
    if(size <= 0) {
      throw new GateRuntimeException("getting list data but size is <=0: "+size);
    }
    assert(element<size);
    if(element >= size) {
      throw new GateRuntimeException("getting list data but element>=size: "+element+"/"+size);
    }
   
    if(size == 1 && element != 0) {
      throw new GateRuntimeException("getting list data but size=1 and element!=0: "+element);
    }
    if(element == 0) {
      return getDataWithout(index, 4);
    }
    // if we need an element >0,
View Full Code Here


   
    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

  public void put(int state, char key, int to_state) {
    char[] chunk = dataStore.getFixedLengthData(state, 5);
    if(getIsSingleCharState(chunk)) {
      char chr = chunk[4];
      if(chr != 0) {
        throw new GateRuntimeException("Trying to put into a non-empty single char state");
      }
      chunk[4] = key;
      setNextStateIntoChars(chunk, to_state);
      dataStore.replaceFixedLengthData(state, chunk);
    } else {
View Full Code Here

    char[] chunk = dataStore.getFixedLengthData(state, 5);
    char ret = 0;
    if(getIsSingleCharState(chunk)) {
      return chunk[4];
    } else {
      throw new GateRuntimeException("Not a single char state");
    }
  }
View Full Code Here

    char[] chunk = dataStore.getFixedLengthData(state, 5);
    if(getIsSingleCharState(chunk)) {
      chunk[4] = chr;
      dataStore.replaceFixedLengthData(state, chunk);
    } else {
      throw new GateRuntimeException("Not a single char state");
    }
  }
View Full Code Here

  public int getCharMapIndex(int state) {
    char[] chunk = dataStore.getFixedLengthData(state, 5);
    if(getIsCharMapState(chunk)) {
      return getCharMapFromChars(chunk);
    } else {
      throw new GateRuntimeException("Not a char map state");
    }   
  }
View Full Code Here

       inputAnnotationSet.equals("")) inputAS = theDocument.getAnnotations();
    else inputAS = theDocument.getAnnotations(inputAnnotationSet);

    AnnotationSet processAnns = null;
    if(wordAnnotationType == null || wordAnnotationType.isEmpty()) {
      throw new GateRuntimeException("Word annotation type must not be empty!");
    }
    processAnns = inputAS.get(wordAnnotationType);
   
    AnnotationSet containingAnns = null;
    if(containingAnnotationType == null || containingAnnotationType.isEmpty()) {
View Full Code Here

      gazStore.addLookupListFeatures(fm, lookup);
      gazStore.addLookupEntryFeatures(fm, lookup);
      try {
        outputAS.add(new Long(from), new Long(to), type, fm);
      } catch (InvalidOffsetException ex) {
        throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
          + document.getContent().size() + "/" + from + "/" + to + " / ", ex);
      }
    }
  }
View Full Code Here

    char[] chunk = dataStore.getFixedLengthData(state, 5);
    if(getIsCharMapState(chunk)) {
      setCharMapIntoChars(chunk, mapIndex);
      dataStore.replaceFixedLengthData(state, chunk);
    } else {
      throw new GateRuntimeException("Not a char map state");
    }   
  }
View Full Code Here

  @Override
  public void replace(int mapIndex, char key, int newState, int oldState) {
    char[] entries = storeKeysAndStates.get(mapIndex);
    int index = binarySearchInEntries(entries, key);
    if(index<0) {
      throw new GateRuntimeException("CharMapState: should have key but not found: "+key);
    }
    if(entries[index] != oldState) {
      throw new GateRuntimeException("CharMapState: old states differ!");
    }
    char[] c2 = Utils.int2TwoChars(newState);
    entries[index+1] = c2[0];
    entries[index+2] = c2[1];
  }
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.