Revision 1804 tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/compiler.groovy

compiler.groovy (revision 1804)
160 160
			println ("Error: CWB executables not well set.")
161 161
			return false;
162 162
		}
163
		CorpusBuild corpus = project.getCorpusBuild(project.getName());
163
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
164 164
		if (corpus != null) {
165
			//println "CLEAN PREVIOUS CORPUS"
166
			corpus.delete(); // remove old files
165
			if (project.getDoUpdate()) {
166
				corpus.clean(); // remove old files
167
			} else {
168
				corpus.delete(); // remove old files and TXMResult children
169
			}
170
		} else {
171
			corpus = new MainCorpus(project);
172
			corpus.setID(project.getName());
173
			corpus.setName(project.getName());
167 174
		}
168
			
169
		// make new one
170
		corpus = new MainCorpus(project);
171
		corpus.setID(project.getName());
172
		corpus.setName(project.getName());
173 175
		corpus.setDescription("Built with the Hyperbase import module");
174 176
		
175 177
		File cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");

Also available in: Unified diff