Revision 3051 tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/Annotate.groovy

Annotate.groovy (revision 3051)
403 403
			//					println "convert "+f+" latin1 >> UTF-8"
404 404
			//				new EncodingConverter(f, "ISO-8859-1", "UTF-8")
405 405
			//			}
406
			
407
			
408
			
409
			initTTOutfileInfos(binDir, modelfile, modelfilename);
410
			
411
			File annotfile = new File(binDir, "annotations/"+outfile.getName()+"-STOFF.xml");
412
			if (!writeStandoffFile(outfile, annotfile)) {
413
				println("Failed to build standoff file of "+outfile);
414
			}
415
			if (cancelNow) return;
406 416
		}
407 417
		println("")
408 418
		
......
410 420
			return false;
411 421
		}
412 422
		
413
		//BUILD STAND-OFF FILES
414
		if (modelfile == null) {
415
			println "no model applied"
416
			return false;
417
		}
418
		
419
		initTTOutfileInfos(binDir, modelfile, modelfilename);
420
		files = new File(binDir, "treetagger").listFiles(IOUtils.HIDDENFILE_FILTER)// now contains the result files of TT
421
		println "Building stdoff files ("+files.size()+") from dir:"+new File(binDir, "treetagger")+" to "+new File(binDir, "annotations");
422
		if (files == null || files.size() == 0) {
423
			return false;
424
		}
425
		cpb = new ConsoleProgressBar(files.size())
426
		for (File ttrezfile : files) {
427
			cpb.tick()
428
			File annotfile = new File(binDir, "annotations/"+ttrezfile.getName()+"-STOFF.xml");
429
			if (!writeStandoffFile(ttrezfile, annotfile)) {
430
				println("Failed to build standoff file of "+ttrezfile);
431
			}
432
		}
433
		println("")
434
		
435
		if (cancelNow) return;
436
		
437 423
		//INJECT ANNOTATIONS
438 424
		List<File> interpfiles = new File(binDir, "annotations").listFiles(IOUtils.HIDDENFILE_FILTER);
439 425
		List<File> txmfiles = txmDir.listFiles(IOUtils.HIDDENFILE_FILTER);

Also available in: Unified diff