Esempio n. 1
0
 public Dataset getDataset() throws ConfigurationException, DaoException {
   if (createFakeGoldStandard) {
     if (fakeGoldStandard == null) {
       Corpus c =
           env.getConfigurator()
               .get(Corpus.class, "plain", "language", env.getDefaultLanguage().getLangCode());
       try {
         if (!c.exists()) c.create();
         FakeDatasetCreator creator = new FakeDatasetCreator(c);
         fakeGoldStandard = creator.generate(500);
       } catch (IOException e) {
         throw new DaoException(e);
       }
     }
     return fakeGoldStandard;
   } else {
     DatasetDao dao = env.getConfigurator().get(DatasetDao.class);
     List<Dataset> datasets = new ArrayList<Dataset>();
     for (String name : datasetNames) {
       datasets.addAll(
           dao.getDatasetOrGroup(
               language, name)); // throws a DaoException if language is incorrect.
     }
     return new Dataset(datasets); // merge all datasets together into one.
   }
 }