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


Java PersistenceManager.loadObjectFromFile方法代码示例

本文整理汇总了Java中gate.util.persistence.PersistenceManager.loadObjectFromFile方法的典型用法代码示例。如果您正苦于以下问题:Java PersistenceManager.loadObjectFromFile方法的具体用法?Java PersistenceManager.loadObjectFromFile怎么用?Java PersistenceManager.loadObjectFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gate.util.persistence.PersistenceManager的用法示例。


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

示例1: GateRESCALProcessing

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
public GateRESCALProcessing(String gateAppPath, String baseFolder,
                            boolean createContentSlice, boolean useStemming) throws GateException, IOException {
  matchingData = new WonMatchingData();
  this.baseFolder = baseFolder;
  this.createContentSlice = createContentSlice;
  this.useStemming = useStemming;

  // init Gate
  logger.info("Initialising Gate");
  Gate.init();

  // load Gate application
  logger.info("Loading Gate application: {}", gateAppPath);
  gateApplication = (CorpusController)
    PersistenceManager.loadObjectFromFile(new File(gateAppPath));
}
 
开发者ID:researchstudio-sat,项目名称:wonpreprocessing,代码行数:17,代码来源:GateRESCALProcessing.java

示例2: initializeAnnie

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
public void initializeAnnie() throws GateException, MalformedURLException, IOException {
    Gate.setGateHome(new File(GATE_HOME));
    Gate.setPluginsHome(new File(GATE_PLUGIN_HOME));
    Gate.setSiteConfigFile(new File(CONFIG_FILE));

    Gate.init();

    log("GATE initialised");
    
    // Load ANNIE plugin
    File pluginsHome = Gate.getPluginsHome();
    File anniePlugin = new File(pluginsHome, "ANNIE");
    File annieGapp = new File(anniePlugin, "ANNIE_with_defaults.gapp");
    annieController = (CorpusController) PersistenceManager.loadObjectFromFile(annieGapp);
    log("ANNIE loaded successfully");
}
 
开发者ID:wandora-team,项目名称:wandora,代码行数:17,代码来源:AnnieExtractor.java

示例3: loadApp

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
@BeforeClass 
public static void loadApp() throws MalformedURLException, IOException, GateException  {
  if (!Gate.isInitialised()) {
    Gate.init();
  }    

  Properties sysProps = System.getProperties();
  String appName = sysProps.getProperty("munpex.en.app.name");
  munpexApp = (CorpusController) PersistenceManager.loadObjectFromFile(
       new File(appName));
}
 
开发者ID:SemanticSoftwareLab,项目名称:ScholarLens,代码行数:12,代码来源:MuNPExTest_EN.java

示例4: main

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
/**
 * This is testing code used during development.
 * TODO: delete it!
 */
public static void main(String[] args){
  try {
    Gate.init();
    MainFrame.getInstance().setVisible(true);
    Gate.getCreoleRegister().registerDirectories(new File(".").toURI().toURL());
    File session = Gate.getUserSessionFile();
    if(session == null) session = new File(System.getProperty("user.home") + 
            ".gate.session");
    if(session.exists()) PersistenceManager.loadObjectFromFile(session);
  } catch(Exception e) {
    e.printStackTrace();
  }
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:18,代码来源:Transducer.java

示例5: initPlugins

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
@Override
public void initPlugins() {
    File annieGapp = new File(Gate.getGateHome(), "recruiterVision.gapp");
    try {
        corpusController = (CorpusController) PersistenceManager.loadObjectFromFile(annieGapp);
    } catch (PersistenceException | IOException | ResourceInstantiationException e) {
        e.printStackTrace();
    }
    logger.info("Annie and plugins inited");
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:11,代码来源:GateServiceImpl.java

示例6: initPersistentGateResources

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
/**
 * Method which init application from GATE application stored on the local drive
 */
private void initPersistentGateResources() {
    try {
        Corpus corpus = Factory.newCorpus("New Corpus");
        corpusController = (CorpusController) PersistenceManager.loadObjectFromFile(new File("application.xgapp"));
        corpusController.setCorpus(corpus);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:KHP-Informatics,项目名称:ADRApp,代码行数:13,代码来源:ContextFeaturesTaggerTest.java

示例7: loadApp

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
@BeforeClass 
public static void loadApp() throws MalformedURLException, IOException, GateException  {
  if (!Gate.isInitialised()) {
    Gate.init();
  }    

  Properties sysProps = System.getProperties();
  String appName = sysProps.getProperty("reextraction.app.name");
  rhetectorApp = (CorpusController) PersistenceManager.loadObjectFromFile(
       new File(appName));
}
 
开发者ID:SemanticSoftwareLab,项目名称:TextMining-Rhetector,代码行数:12,代码来源:REExtractionTest.java

示例8: initAnnie

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
/**
 * Initialise the ANNIE system. This creates a "corpus pipeline"
 * application that can be used to run sets of documents through
 * the extraction system.
 */
public void initAnnie() throws GateException, IOException {
  Out.prln("Initialising ANNIE...");

  // load the ANNIE application from the saved state in plugins/ANNIE
  File pluginsHome = Gate.getPluginsHome();
  File anniePlugin = new File(pluginsHome, "ANNIE");
  File annieGapp = new File(anniePlugin, "ANNIE_with_defaults.gapp");
  annieController =
    (CorpusController) PersistenceManager.loadObjectFromFile(annieGapp);

  Out.prln("...ANNIE loaded");
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:18,代码来源:StandAloneAnnie.java

示例9: initializeAnnie

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
public CorpusController initializeAnnie() throws GateException, IOException {

        File pluginsHome = Gate.getPluginsHome();
        File annieGapp = new File(pluginsHome + "/ANNIE", "ANNIE_with_defaults.gapp");

        return (CorpusController) PersistenceManager.loadObjectFromFile(annieGapp);
    }
 
开发者ID:naditina,项目名称:gate-semano,代码行数:8,代码来源:JAPEAnnotator.java

示例10: checkPersistence

import gate.util.persistence.PersistenceManager; //导入方法依赖的package包/类
public void checkPersistence(File xgappFile, ResourceReference rr1, String expected) throws Exception {
  Resource resource = null, restored = null;
  
  try {
          
    FeatureMap params = Factory.newFeatureMap();      
    params.put("param", rr1);
    resource = Factory.createResource(TestResource.class.getName(),params);      
          
    PersistenceManager.saveObjectToFile(resource, xgappFile);
          
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(xgappFile);
    
    Element entry = doc.getRootElement().getChild("application").getChild("initParams").getChild("localMap").getChild("entry");
    
    assertEquals("couldn't find the paramameter entry", "param",entry.getChildText("string"));
    
    Element value = entry.getChild("gate.util.persistence.PersistenceManager-RRPersistence");
    
    assertNotNull("We couldn't find the RRPersistence wrapper",value);
    
    assertEquals("The URI was not as expected",expected, value.getChildText("uriString"));
    
    restored = (Resource)PersistenceManager.loadObjectFromFile(xgappFile);
    
    ResourceReference rr2 = (ResourceReference)restored.getParameterValue("param");
    
    assertEquals(rr1, rr2);
    
  } finally {
    if (xgappFile != null) xgappFile.deleteOnExit();
    
    if(resource != null) {
      Factory.deleteResource(resource);
    }
    
    if(restored != null) {
      Factory.deleteResource(restored);
    } 
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:43,代码来源:TestResourceReference.java


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