本文整理匯總了Java中gate.creole.ConditionalSerialAnalyserController類的典型用法代碼示例。如果您正苦於以下問題:Java ConditionalSerialAnalyserController類的具體用法?Java ConditionalSerialAnalyserController怎麽用?Java ConditionalSerialAnalyserController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConditionalSerialAnalyserController類屬於gate.creole包,在下文中一共展示了ConditionalSerialAnalyserController類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: extractDataFromSource
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
/**
* Populates this Persistence with the data that needs to be stored from the
* original source object.
*/
@Override
public void extractDataFromSource(Object source)throws PersistenceException{
if(! (source instanceof ConditionalSerialAnalyserController)){
throw new UnsupportedOperationException(
getClass().getName() + " can only be used for " +
ConditionalSerialAnalyserController.class.getName() +
" objects!\n" + source.getClass().getName() +
" is not a " + ConditionalSerialAnalyserController.class.getName());
}
super.extractDataFromSource(source);
ConditionalSerialAnalyserController sac = (ConditionalSerialAnalyserController)source;
corpus = PersistenceManager.getPersistentRepresentation(sac.getCorpus());
}
示例2: actionPerformed
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent e) {
SerialAnalyserController existingController =
(SerialAnalyserController)target;
try {
ConditionalSerialAnalyserController newController =
(ConditionalSerialAnalyserController)Factory
.createResource("gate.creole.ConditionalSerialAnalyserController");
newController.getFeatures().putAll(existingController.getFeatures());
newController.setName(existingController.getName());
Iterator<?> it = existingController.getPRs().iterator();
while(it.hasNext()) {
newController.add((ProcessingResource)it.next());
}
List<ProcessingResource> empty = Collections.emptyList();
existingController.setPRs(empty);
Factory.deleteResource(existingController);
} catch(Exception ex) {
JOptionPane.showMessageDialog(getLargeView(),
"Error!\n" + ex.toString(), "GATE", JOptionPane.ERROR_MESSAGE);
ex.printStackTrace(Err.getPrintWriter());
}
}
示例3: setTarget
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
public void setTarget(Object target){
if(!(target instanceof SerialController))
throw new IllegalArgumentException(
"gate.gui.ApplicationViewer can only be used for serial controllers\n" +
target.getClass().toString() +
" is not a gate.creole.SerialController!");
if(controller != null) controller.removeControllerListener(this);
this.controller = (SerialController)target;
controller.addControllerListener(this);
corpusControllerMode = controller instanceof CorpusController;
analyserMode = controller instanceof SerialAnalyserController ||
controller instanceof ConditionalSerialAnalyserController;
conditionalMode = controller instanceof ConditionalController;
initLocalData();
initGuiComponents();
initListeners();
loadedPRsTableModel.fireTableDataChanged();
memberPRsTableModel.fireTableDataChanged();
}
示例4: controllerExecutionFinished
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
public void controllerExecutionFinished(Controller c)
throws ExecutionException {
if(controller instanceof ControllerAwarePR) {
if(controller instanceof ConditionalSerialAnalyserController) {
((ConditionalSerialAnalyserController)controller).setCorpus(corpus);
} else if(controller instanceof SerialAnalyserController) {
((SerialAnalyserController)controller).setCorpus(corpus);
}
((ControllerAwarePR)controller).controllerExecutionFinished(c);
if(controller instanceof ConditionalSerialAnalyserController) {
((ConditionalSerialAnalyserController)controller).setCorpus(null);
} else if(controller instanceof SerialAnalyserController) {
((SerialAnalyserController)controller).setCorpus(null);
}
}
}
示例5: controllerExecutionAborted
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
public void controllerExecutionAborted(Controller c, Throwable t)
throws ExecutionException {
if(controller instanceof ControllerAwarePR) {
if(controller instanceof ConditionalSerialAnalyserController) {
((ConditionalSerialAnalyserController)controller).setCorpus(corpus);
} else if(controller instanceof SerialAnalyserController) {
((SerialAnalyserController)controller).setCorpus(corpus);
}
((ControllerAwarePR)controller).controllerExecutionAborted(c, t);
if(controller instanceof ConditionalSerialAnalyserController) {
((ConditionalSerialAnalyserController)controller).setCorpus(null);
} else if(controller instanceof SerialAnalyserController) {
((SerialAnalyserController)controller).setCorpus(null);
}
}
}
示例6: createObject
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
/**
* Creates a new object from the data contained. This new object is supposed
* to be a copy for the original object used as source for data extraction.
*/
@Override
public Object createObject()throws PersistenceException,
ResourceInstantiationException{
ConditionalSerialAnalyserController sac = (ConditionalSerialAnalyserController)
super.createObject();
sac.setCorpus((Corpus)PersistenceManager.getTransientRepresentation(
corpus,resourceName,initParamOverrides));
return sac;
}
示例7: buildActions
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
protected List<Action> buildActions(NameBearerHandle nbh) {
List<Action> actions = new ArrayList<Action>();
if(nbh.getTarget() instanceof ConditionalSerialAnalyserController &&
!(nbh.getTarget() instanceof ParametrizedCorpusController)) {
action = new MakeParametrizedCorpusControllerAction((ConditionalSerialAnalyserController)nbh.getTarget());
actions.add(action);
}
return actions;
}
示例8: controllerExecutionStarted
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
public void controllerExecutionStarted(Controller c)
throws ExecutionException {
if(controller instanceof ControllerAwarePR) {
if(controller instanceof ConditionalSerialAnalyserController) {
((ConditionalSerialAnalyserController)controller).setCorpus(corpus);
} else if(controller instanceof SerialAnalyserController) {
((SerialAnalyserController)controller).setCorpus(corpus);
}
((ControllerAwarePR)controller).controllerExecutionStarted(c);
}
}
示例9: MakeParametrizedCorpusControllerAction
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
public MakeParametrizedCorpusControllerAction(ConditionalSerialAnalyserController nb) {
super("Convert to Parametrized Corpus Controller");
putValue(SHORT_DESCRIPTION, "Convert to Parametrized Corpus Controller");
target = nb;
}
示例10: actionPerformed
import gate.creole.ConditionalSerialAnalyserController; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent e) {
ConditionalSerialAnalyserController existingController = target;
try {
FeatureMap parms;
// TODO: prompt for config file
// get the register
CreoleRegister reg = Gate.getCreoleRegister();
// now try to get the entry for our own Parametrized corpus controller
String resourceClass = "at.ofai.gate.modularpipelines.ParametrizedCorpusController";
ResourceData rd = reg.get(resourceClass);
if(rd == null) {
JOptionPane.showMessageDialog(MainFrame.getInstance(),
"Error: could not find our own ParametrizedCorpusControllerClass!\n" , "GATE", JOptionPane.ERROR_MESSAGE);
} else {
NewResourceDialog nrd = new NewResourceDialog(MainFrame.getInstance(), "Resource parameters", true);
boolean ok = nrd.show(rd,"Convert to a Parametrized Corpus Controller");
if(ok) {
parms = nrd.getSelectedParameters();
String newName = nrd.getResourceName();
ParametrizedCorpusController newController =
(ParametrizedCorpusController)Factory
.createResource(resourceClass,parms);
newController.getFeatures().putAll(existingController.getFeatures());
newController.setName(existingController.getName());
Iterator<?> itp = existingController.getPRs().iterator();
while(itp.hasNext()) {
newController.add((ProcessingResource)itp.next());
}
List<RunningStrategy> runstrats = existingController.getRunningStrategies();
newController.setRunningStrategies(runstrats);
List<ProcessingResource> emptyPrs = Collections.emptyList();
existingController.setPRs(emptyPrs);
List<RunningStrategy> emptyStrats = Collections.emptyList();
existingController.setRunningStrategies(emptyStrats);
Factory.deleteResource(existingController);
if(newName != null && !newName.isEmpty()) {
newController.setName(newName);
}
}
}
} catch(Exception ex) {
JOptionPane.showMessageDialog(MainFrame.getInstance(),
"Error!\n" + ex.toString(), "GATE", JOptionPane.ERROR_MESSAGE);
ex.printStackTrace(Err.getPrintWriter());
}
}