public void setBinaryGrammarURL(URL binaryGrammarURL) { try { this.setBinaryGrammarURL(new ResourceReference(binaryGrammarURL)); } catch(URISyntaxException e) { throw new RuntimeException("Error converting URL to ResourceReference",e); } }
/** * Loads the specified JAPE grammar into GATE and then serializes it * into the specified file. This file can then be used to create * a new transducer instance via the <code>binaryGrammarURL</code> * init time parameter. */ public static void compile(URL jape, File ser) throws Exception { Transducer transducer = new Transducer(); transducer.setGrammarURL(new ResourceReference(jape)); transducer.setEncoding(defaultEncoding); transducer.init(); FileOutputStream out = new FileOutputStream(ser); ObjectOutputStream s = new ObjectOutputStream(out); transducer.serialize(s); s.flush(); s.close(); out.close(); }
/** * The ontology parameter is not used for this PR and therefore hidden. * * @param ontology */ @HiddenCreoleParameter @Override public void setOntology(gate.creole.ontology.Ontology ontology) { super.setOntology(ontology); }
public Resource init() throws ResourceInstantiationException { try { fireProgressChanged(0); initCustomConstraints(); throw new ResourceInstantiationException(message, e); } finally { fireProcessFinished(); actionContext = initActionContext(); batch.setActionContext(actionContext); batch.addProgressListener(new IntervalProgressListener(0, 100));
@Deprecated public void setGrammarURL(URL grammar) { try { this.setGrammarURL(new ResourceReference(grammar)); } catch(URISyntaxException e) { throw new RuntimeException("Error converting URL to ResourceReference",e); } }
@Override public void controllerExecutionStarted(Controller c) throws ExecutionException { actionContext.setController(c); actionContext.setCorpus(corpus); actionContext.setPRFeatures(features); actionContext.setPRName(this.getName()); actionContext.setPR(this); actionContext.setDebuggingEnabled(enableDebugging); batch.runControllerExecutionStartedBlock(actionContext,c,ontology); }
/** * The grammarURL parameter provides the ANNIE VerbGroups.jape file as a default * for this PR. * * @param newGrammarURL */ @CreoleParameter( comment = "The URL to the grammar file.", suffixes = "jape", defaultValue = "resources/VP/VerbGroups.jape" ) @Override public void setGrammarURL(ResourceReference newGrammarURL) { super.setGrammarURL(newGrammarURL); }
/** * The grammarURL parameter provides the ANNIE main.jape file as a default * for this PR. * * @param newGrammarURL */ @CreoleParameter( comment = "The URL to the grammar file.", suffixes = "jape", defaultValue = "resources/NE/main.jape" ) @Override public void setGrammarURL(ResourceReference newGrammarURL) { super.setGrammarURL(newGrammarURL); }
@HiddenCreoleParameter @Override public void setBinaryGrammarURL(ResourceReference grammar) { super.setBinaryGrammarURL(grammar); }
@HiddenCreoleParameter @Override public void setOntology(Ontology o) { super.setOntology(o); }
/** * The binaryGrammarURL parameter is not used for this PR and therefore hidden. * * @param url */ @HiddenCreoleParameter @Override public void setBinaryGrammarURL(ResourceReference url) { super.setBinaryGrammarURL(url); }