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

compiler.groovy (revision 1804)
88 88
			println ("Error: CWB executables not well set.")
89 89
			return false;
90 90
		}
91
		CorpusBuild corpus = project.getCorpusBuild(project.getName());
91
		CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
92 92
		if (corpus != null) {
93
			//println "CLEAN PREVIOUS CORPUS"
94
			corpus.delete(); // remove old files
93
			if (project.getDoUpdate()) {
94
				corpus.clean(); // remove old files
95
			} else {
96
				corpus.delete(); // remove old files and TXMResult children
97
			}
98
		} else {
99
			corpus = new MainCorpus(project);
100
			corpus.setID(project.getName());
101
			corpus.setName(project.getName());
95 102
		}
96
			
97
		// make new one
98
		corpus = new MainCorpus(project);
99
		corpus.setID(project.getName());
100
		corpus.setName(project.getName());
101 103
		corpus.setDescription("Built with the CQP import module");
102 104
		
103 105
		File cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");

Also available in: Unified diff