Skip to content

Commit 5dd6855

Browse files
committed
added an optional parameter to set an output textclass for ticcl (--outputclass)
1 parent 2ca48e6 commit 5dd6855

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ticcl.nf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ params.extension = "folia.xml"
1818
params.inputtype = "folia"
1919
params.outputdir = "ticcl_output"
2020
params.inputclass = "current"
21+
params.outputclass = "current"
2122
params.lexicon = ""
2223
params.artifrq = 10000000
2324
params.alphabet = ""
@@ -44,6 +45,7 @@ if (params.containsKey('help')) {
4445
log.info " --language LANGUAGE Language"
4546
log.info " --extension STR Extension of FoLiA documents in input directory (default: folia.xml, must always end in xml)!"
4647
log.info " --inputclass CLASS FoLiA text class to use for input, defaults to 'current' for FoLiA input; must be set to 'OCR' for FoLiA documents produced by ocr.nf"
48+
log.info " --outputclass CLASS FoLiA text class to use for output, defaults to 'current' for FoLiA output, but may not be equal to the class used for --inputclass"
4749
log.info " --inputtype STR Input type can be either 'folia' (default), 'text', or 'pdf' (i.e. pdf with text; no OCR)"
4850
log.info " --virtualenv PATH Path to Virtual Environment to load (usually path to LaMachine)"
4951
log.info " --artifrq INT Default value for missing frequencies in the validated lexicon (default: 10000000)"
@@ -516,6 +518,7 @@ if (!params.containsKey('nofoliacorrect')) {
516518
file unknownfreqlist from unknownfreqlist
517519
val extension from params.extension
518520
val inputclass from inputclass
521+
val outputclass from outputclass
519522
val virtualenv from params.virtualenv
520523

521524
output:
@@ -534,7 +537,7 @@ if (!params.containsKey('nofoliacorrect')) {
534537
mkdir outputdir
535538
536539
537-
FoLiA-correct --inputclass "${inputclass}" --outputclass current --nums 10 -e ${extension} -O outputdir/ --unk "${unknownfreqlist}" --punct "${punctuationmap}" --rank "${rankedlist}" -t ${task.cpus} . || exit 1
540+
FoLiA-correct --inputclass "${inputclass}" --outputclass "${outputclass}" --nums 10 -e ${extension} -O outputdir/ --unk "${unknownfreqlist}" --punct "${punctuationmap}" --rank "${rankedlist}" -t ${task.cpus} . || exit 1
538541
539542
cd outputdir
540543
ls

0 commit comments

Comments
 (0)