当前位置: 首页>>代码示例>>Java>>正文


Java SerialAnalyserController类代码示例

本文整理汇总了Java中gate.creole.SerialAnalyserController的典型用法代码示例。如果您正苦于以下问题:Java SerialAnalyserController类的具体用法?Java SerialAnalyserController怎么用?Java SerialAnalyserController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SerialAnalyserController类属于gate.creole包,在下文中一共展示了SerialAnalyserController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractDataFromSource

import gate.creole.SerialAnalyserController; //导入依赖的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 SerialAnalyserController)){
    throw new UnsupportedOperationException(
              getClass().getName() + " can only be used for " +
              SerialAnalyserController.class.getName() +
              " objects!\n" + source.getClass().getName() +
              " is not a " + SerialAnalyserController.class.getName());
  }

  super.extractDataFromSource(source);

  SerialAnalyserController sac = (SerialAnalyserController)source;
  corpus = PersistenceManager.getPersistentRepresentation(sac.getCorpus());
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:20,代码来源:SerialAnalyserControllerPersistence.java

示例2: actionPerformed

import gate.creole.SerialAnalyserController; //导入依赖的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());
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:24,代码来源:NameBearerHandle.java

示例3: setTarget

import gate.creole.SerialAnalyserController; //导入依赖的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();

}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:24,代码来源:SerialControllerEditor.java

示例4: controllerExecutionFinished

import gate.creole.SerialAnalyserController; //导入依赖的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);
    }
  }
}
 
开发者ID:johann-petrak,项目名称:gateplugin-ModularPipelines,代码行数:18,代码来源:Pipeline.java

示例5: controllerExecutionAborted

import gate.creole.SerialAnalyserController; //导入依赖的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);
    }
  }    
}
 
开发者ID:johann-petrak,项目名称:gateplugin-ModularPipelines,代码行数:18,代码来源:Pipeline.java

示例6: init

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
/** Initialise this resource, and return it. */
public Resource init() throws ResourceInstantiationException {
  f.setMaximumFractionDigits(2); // format used for all decimal values
  f.setMinimumFractionDigits(2);

  // using QualityAssurancePR internally to calculate QA stats
  // but hiding this PR just in case
  FeatureMap hideParams = Factory.newFeatureMap();
  Gate.setHiddenAttribute(hideParams, true);
  assurancePR = (QualityAssurancePR)Factory.createResource(
          "gate.qa.QualityAssurancePR", Factory.newFeatureMap(), hideParams);

  // we use controller to execute assurance PR
  controller = (SerialAnalyserController)Factory.createResource(
          SerialAnalyserController.class.getName(), Factory.newFeatureMap(),
          hideParams);
  controller.add(assurancePR);
  return this;
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:20,代码来源:QAForTeamwarePR.java

示例7: createObject

import gate.creole.SerialAnalyserController; //导入依赖的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{
  SerialAnalyserController sac = (SerialAnalyserController)
                                super.createObject();
  sac.setCorpus((Corpus)PersistenceManager.getTransientRepresentation(
          corpus,resourceName,initParamOverrides));
  return sac;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:14,代码来源:SerialAnalyserControllerPersistence.java

示例8: assambleEntityExtractionPipelineEN

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
private void assambleEntityExtractionPipelineEN() {
    
    try {
        URL url = THDController.getInstance().getClass().getResource(Settings.EN_ENTITY_EXTRACTION_GRAMMAR);
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }

        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();        
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);

        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);

        FeatureMap posTaggerFeatureMap = Factory.newFeatureMap();
        ProcessingResource posTaggerPR = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", posTaggerFeatureMap);

        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        enEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.SerialAnalyserController");

        enEntityExtractionPipeline.add(tokenizerPR);
        enEntityExtractionPipeline.add(sentenceSplitterPR);
        enEntityExtractionPipeline.add(posTaggerPR);
        enEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {;
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:36,代码来源:THDWorker.java

示例9: assambleEntityExtractionPipelineEN

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
private static void assambleEntityExtractionPipelineEN(){
    try {
        URL url = thdInstance.getClass().getResource(enEntityExtractionGrammar);
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }

        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();        
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);

        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);

        FeatureMap posTaggerFeatureMap = Factory.newFeatureMap();
        ProcessingResource posTaggerPR = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", posTaggerFeatureMap);

        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        enEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.SerialAnalyserController");

        enEntityExtractionPipeline.add(tokenizerPR);
        enEntityExtractionPipeline.add(sentenceSplitterPR);
        enEntityExtractionPipeline.add(posTaggerPR);
        enEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {;
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:35,代码来源:THDInstance.java

示例10: controllerExecutionStarted

import gate.creole.SerialAnalyserController; //导入依赖的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);
  }    
}
 
开发者ID:johann-petrak,项目名称:gateplugin-ModularPipelines,代码行数:13,代码来源:Pipeline.java

示例11: buildStaticPopupItems

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
protected void buildStaticPopupItems() {
  // build the static part of the popup
  staticPopupItems = new ArrayList<JComponent>();

  if(target instanceof ProcessingResource && !(target instanceof Controller)) {
    // actions for PRs (but not Controllers)
    staticPopupItems.add(null);
    staticPopupItems.add(new XJMenuItem(new ReloadAction(), sListenerProxy));
    staticPopupItems.add(new XJMenuItem(new ApplicationWithPRAction(), sListenerProxy));

  }
  else if(target instanceof LanguageResource) {
    // Language Resources
    staticPopupItems.add(null);
    if(target instanceof Document) {
      staticPopupItems.add(new XJMenuItem(new CreateCorpusForDocAction(),
              sListenerProxy));
    }
    if(target instanceof gate.TextualDocument) {
      staticPopupItems.add(null);
      staticPopupItems.add(new DocumentExportMenu(this));
    }
    else if(target instanceof Corpus) {
      corpusFiller = new CorpusFillerComponent();
      scfInputDialog = new SingleConcatenatedFileInputDialog();
      staticPopupItems.add(new XJMenuItem(new PopulateCorpusAction(),
              sListenerProxy));
      staticPopupItems.add(new XJMenuItem(
              new PopulateCorpusFromSingleConcatenatedFileAction(),
              sListenerProxy));
      staticPopupItems.add(null);
      staticPopupItems.add(new DocumentExportMenu(this));
    }
    if(((LanguageResource)target).getDataStore() != null) {
      // this item can be used only if the resource belongs to a
      // datastore
      staticPopupItems.add(new XJMenuItem(new SaveAction(), sListenerProxy));
    }
    if(!(target instanceof AnnotationSchema)) {
      staticPopupItems
              .add(new XJMenuItem(new SaveToAction(), sListenerProxy));
    }
  }

  if(target instanceof Controller) {
    // Applications
    staticPopupItems.add(null);
    
    if (target instanceof SerialAnalyserController) {
      staticPopupItems.add(new XJMenuItem(new MakeConditionalAction(), sListenerProxy));
    }
          
    staticPopupItems.add(new XJMenuItem(new DumpToFileAction(),
            sListenerProxy));
    staticPopupItems.add(new XJMenuItem(new ExportApplicationAction(),
            sListenerProxy));
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:59,代码来源:NameBearerHandle.java

示例12: getPipeline

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
/**
 * @return the pipeline
 */
public SerialAnalyserController getPipeline() {
    return pipeline;
}
 
开发者ID:sasinda,项目名称:OntologyBasedInormationExtractor,代码行数:7,代码来源:GateAppCreator.java

示例13: setPipeline

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
/**
 * @param pipeline the pipeline to set
 */
public void setPipeline(SerialAnalyserController pipeline) {
    this.pipeline = pipeline;
}
 
开发者ID:sasinda,项目名称:OntologyBasedInormationExtractor,代码行数:7,代码来源:GateAppCreator.java

示例14: assambleEntityExtractionPipelineDE

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
private void assambleEntityExtractionPipelineDE(){
    try {
                
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
                
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
                
        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "UTF-8");
        taggerFeatureMap.put("failOnUnmappableCharacter", false);
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", Settings.DE_TAGGER_BINARY);
        taggerFeatureMap.put("updateAnnotations", true);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
                
        //JAPE Entity Extraction grammar
        URL url =  THDController.getInstance().getClass().getResource(Settings.DE_ENTITY_EXTRACTION_GRAMMAR);
        
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
                
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        deEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        deEntityExtractionPipeline.add(resetPR);
        deEntityExtractionPipeline.add(tokenizerPR);
        deEntityExtractionPipeline.add(genTag);                    
        deEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:48,代码来源:THDWorker.java

示例15: assambleEntityExtractionPipelineNL

import gate.creole.SerialAnalyserController; //导入依赖的package包/类
private void assambleEntityExtractionPipelineNL(){        
        try {        
            FeatureMap resetFeatureMap = Factory.newFeatureMap();
            ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
                    
            FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
            ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
                    
            FeatureMap taggerFeatureMap = Factory.newFeatureMap();
            taggerFeatureMap.put("debug", "false");
            taggerFeatureMap.put("encoding", "UTF-8");
            taggerFeatureMap.put("failOnUnmappableCharacter", false);
//            taggerFeatureMap.put("failOnMissingInputAnnotations", false);
            taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
            taggerFeatureMap.put("inputAnnotationType", "Token");
            taggerFeatureMap.put("inputTemplate", "${string}");
            taggerFeatureMap.put("outputAnnotationType", "Token");
            taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
            taggerFeatureMap.put("taggerBinary", Settings.NL_TAGGER_BINARY);
            taggerFeatureMap.put("updateAnnotations", true);
                    
            ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
                    
            //JAPE Entity Extraction grammar
            URL url =  THDController.getInstance().getClass().getResource(Settings.NL_ENTITY_EXTRACTION_GRAMMAR);
            File japeOrigFile = new File(url.getFile());
            java.net.URI japeURI = japeOrigFile.toURI();
            FeatureMap transducerFeatureMap = Factory.newFeatureMap();

            try {
                transducerFeatureMap.put("grammarURL", japeURI.toURL());
                transducerFeatureMap.put("encoding", "UTF-8");
            } catch (MalformedURLException e) {
            }
                    
            ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

            nlEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
            nlEntityExtractionPipeline.add(resetPR);
            nlEntityExtractionPipeline.add(tokenizerPR);
            nlEntityExtractionPipeline.add(genTag);                    
            nlEntityExtractionPipeline.add(japeCandidatesPR);
            
        } catch (ResourceInstantiationException ex) {
            Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
        }        
    }
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:48,代码来源:THDWorker.java


注:本文中的gate.creole.SerialAnalyserController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。