Package gate.util

Examples of gate.util.GateRuntimeException


    String templateDirName,
    String outputDirName)
    throws SettingException, ProcessingException {
    String fn = "";
    if(!Gate.isInitialised()) {
      throw new GateRuntimeException("GATE not initialized when generateDoc is called!");
    }
    fn = gappFile.getAbsolutePath();
    String gappFileName = fn;
    String gatehomeTmp;
    gatehomeTmp = Gate.getGateHome().getAbsolutePath();
    final String gatehome = gatehomeTmp;
    String relpathTmp;
    relpathTmp = gappFile.getParentFile().getAbsolutePath();
    final String relpath = relpathTmp;
    File templateDir = new File(templateDirName);
    System.out.println("AppDoc: using template directory " + templateDir);
    Settings settings = new fmpp.setting.Settings(templateDir);
    settings.define("outFileExtension", Settings.TYPE_STRING, false, true);
    settings.load(new File(templateDir, "config.fmpp"));
    // the directory that will contain all output files
    System.out.println("AppDoc: using output directory " + outputDirName);
    settings.setWithString("outputRoot", outputDirName);
    String extension = (String) settings.get("outFileExtension");
    if (extension == null) {  // if somebody
      throw new GateRuntimeException("Parameter outfileExtension not set in the config file!");
    }
    String docFileName = gappFile.getName() + ".doc" + settings.get("outFileExtension");
    System.out.println("AppDoc: generating documentation root file: " + docFileName);

    String gappFileNameSlashes = gappFileName;
View Full Code Here


 
  for(int i = 0; i< text.length(); i++) {
    statesStore.nrInput++;
    currentChar = text.charAt(i);
    if(currentChar == 0) {
      throw new GateRuntimeException("Cannot add a gazetteer entry that contains a binary 0 character!");
    }
    nextState = statesStore.next(currentState,currentChar);
    if(nextState < 0) {
      nextState = statesStore.newSingleCharState();         
     
View Full Code Here

    Object object = null;
    try {
      object = inputobject.readObject();
      inputobject.close();
    } catch (ClassNotFoundException e) {
      throw new GateRuntimeException("Could not re-load gazstore object: class error"+e);
    }
    GazStoreTrie3 gs = null;
    if(object instanceof GazStoreTrie3) {
      gs = (GazStoreTrie3)object;
    } else {
      throw new GateRuntimeException("Could not re-load gazstore object: invalid class: "+object.getClass());
    }
    long end = System.currentTimeMillis();
    System.out.println("Cache loaded in (secs): "+((end-start)/1000.0));
    return gs;
  }
View Full Code Here

    else outputAS = theDocument.getAnnotations(outputAnnotationSet);


    AnnotationSet processAnns = null;
    if(wordAnnotationType == null || wordAnnotationType.isEmpty()) {
      throw new GateRuntimeException("Word annotation type must not be empty!");
    }
   
    if(spaceAnnotationType == null || spaceAnnotationType.isEmpty()) {
      throw new GateRuntimeException("Space annotation type must not be empty!");
    }
    Set<String> typeSet = new HashSet<String>();
    typeSet.add(wordAnnotationType);
    typeSet.add(spaceAnnotationType);
    processAnns = inputAS.get(typeSet);
View Full Code Here

    if (outputAS instanceof AnnotationSetImpl) {
      AnnotationSetImpl setasannimpl = (AnnotationSetImpl) outputAS;
      try {
        id = setasannimpl.add(new Long(from), new Long(to+1), type, fm);
      } catch (InvalidOffsetException ex) {
        throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
          + document.getContent().size() + "/" + from + "/" + to, ex);
      }
    } else {
      try {
        outputAS.add(new Long(from), new Long(to+1), type, fm);
      } catch (InvalidOffsetException ex) {
        throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
          + document.getContent().size() + "/" + from + "/" + to + " / ", ex);
      }
    }
    return id;
  }
View Full Code Here

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

        char[] chunk = oldStore.storeKeysAndStates.get(i);
        int index = store.addData(chunk);
        chunkIndices[i] = index;
      }
    } else {
      throw new GateRuntimeException(
          "Can only compact once, or from a Phase1 store!");
    }
  }
View Full Code Here

   
  }

  @Override
  public int put(int mapIndex, char key, int state) {
    throw new GateRuntimeException("put cannot be called after compaction!");
  }
View Full Code Here

    throw new GateRuntimeException("put cannot be called after compaction!");
  }

  @Override
  public void replace(int mapIndex, char key, int newState, int oldState) {
    throw new GateRuntimeException("replace cannot be called after compaction!");
  }
View Full Code Here

      return addListData(data);
    }

    int size = getListSize(index);
    if(size < 1) {
      throw new GateRuntimeException("Adding to a list, but size is <1: "+size);
    }

   
    // update the size
    char sz[] = Utils.int2TwoChars(size+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.