Revision 1137 tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImporter.groovy

XTZImporter.groovy (revision 1137)
98 98

  
99 99
		lang = project.getLang();
100 100

  
101
		wordTag = project.getTokenizerParameter(name, defaultvalue)
102
		this.skipDoTokenizeStep = module.getParameters().getSkipTokenization()
101
		wordTag = project.getTokenizerWordElement()
102
		this.skipDoTokenizeStep = !project.getDoTokenizerStep()
103 103

  
104 104
		//prepare metadata if any
105 105
		File allMetadataFile = Metadatas.findMetadataFile(inputDirectory);
......
115 115
			Toolbox.getPreference(TBXPreferences.METADATA_TXTSEPARATOR), 1)
116 116
		}
117 117

  
118
		String cleanDirectories = module.getParameters().getKeyValueParameters().get(ImportKeys.CLEAN);
118
		String cleanDirectories = project.getCleanAfterBuild();
119 119
		
120 120
		if (!doFixSurrogates()) return;
121 121
		if (!doSplitMergeXSLStep()) return;
......
201 201

  
202 202
	public boolean doEncodeMileStonesStep() {
203 203
		filesToProcess = new File(module.getBinaryDirectory(), "tokenized").listFiles()
204
		def milestonesString = module.getParameters().getMilestonesElement().getTextContent().trim()
204
		def milestonesString = module.getProject().getTextualPlan("MileStones")
205 205
		if (milestonesString.length() == 0) return true;
206 206

  
207 207
		def milestones = milestonesString.split(",")
......
314 314
		String outSideTextTagsAndKeepContentRegex = "";
315 315
		String noteRegex = "";
316 316
		// get the element names to ignore
317
		Element textualPlanEelement = module.getParameters().getTextualPlans();
318 317

  
319
		if (textualPlanEelement != null) {
320
			Element e1 = module.getParameters().getOutSideTextTagsElement()
321
			def split  = e1.getTextContent().split(",")
318
			String e1 = module.getProject().getTextualPlan("OutSideTextTags")
319
			def split  = e1.split(",")
322 320
			for (String s : split) {
323 321
				outSideTextTagsRegex += "|"+s.trim()
324 322
			}
......
326 324
				outSideTextTagsRegex = outSideTextTagsRegex.substring(1) // remove the first "|"
327 325
			}
328 326

  
329
			Element e2 = module.getParameters().getOutSideTextTagsAndKeepContentElement()
330
			def split2  = e2.getTextContent().split(",")
327
			String e2 = module.getProject().getTextualPlan("OutSideTextTagsAndKeepContent")
328
			def split2  = e2.split(",")
331 329
			for (String s : split2) {
332 330
				outSideTextTagsAndKeepContentRegex += "|"+s.trim()
333 331
			}
......
335 333
				outSideTextTagsAndKeepContentRegex = outSideTextTagsAndKeepContentRegex.substring(1) // remove the first "|"
336 334
			}
337 335

  
338
			Element e3 = module.getParameters().getNoteElement()
339
			def split3  = e3.getTextContent().split(",")
336
			String e3 = module.getProject().getTextualPlan("Note")
337
			def split3  = e3.split(",")
340 338
			for (String s : split3) {
341 339
				noteRegex += "|"+s.trim()
342 340
			}
343 341
			if (noteRegex.trim().length() > 0) {
344 342
				noteRegex = noteRegex.substring(1) // remove the first "|"
345 343
			}
346
		}
347 344

  
348 345
		//if (wordTag != "w") {
349
		if (skipDoTokenizeStep ) {
346
		if (skipDoTokenizeStep) {
350 347
			println "No tokenization do to."
351 348
			// ConsoleProgressBar cpb = new ConsoleProgressBar(filesToProcess.size())
352 349
			for (File f : filesToProcess) {
......
377 374
					tokenizer.setNote(noteRegex)
378 375
				}
379 376

  
380
				// tokenize ! \o/
377
				// tokenize !
381 378
				if (!tokenizer.process()) {
382 379
					println("Failed to process "+f)
383 380
					outfile.delete()
......
454 451
			def resps = new HashMap<String,String[]>();
455 452
			//lance le traitement
456 453
			def builder = new Xml2Ana(file);
457
			builder.setWordTag(module.getParameters().getWordElement().getTextContent())
454
			builder.setWordTag(module.getProject().getTokenizerWordElement())
458 455
			builder.setConvertAllAtrtibutes true;
459 456
			builder.setCorrespondances(correspRef, correspType);
460 457
			builder.setHeaderInfos(respId,resps, applications, taxonomiesUtilisees, itemsURI)

Also available in: Unified diff