Joerg Tiedemann > uplug-main > uplug-readalign

Download:
uplug-main-0.3.8.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

uplug-readalign - read sentence alignment in XCES align format

SYNOPSIS ^

 # read sentence alignments and print aligned sentences
 uplug-readalign align-file.xml

 # print alignments with alignment certainty > LinkThr=0
 uplug-readalign -c 0 align-file.xml

 # print alignments with max 2 source sentences and 3 target sentences
 uplug-readalign -S 2 -T 3 align-file.xml

 # print aligned sentences marked as 'de' (source) and 'en' (target)
 # (this only works if sentences are marked with languages:
 #  for example, in the German XML file: <s lang="de">...</s>)
 uplug-readalign -s de -t en align-file.xml

 # wrap aligned sentences in simple HTML
 uplug-readalign -h align-file.xml

 # print max 10 alignments
 uplug-readalign -m 10 align-file.xml

 # specify home directory of aligned XML files
 uplug-readalign -d /path/to/xml/files align-file.xml

 # print XCES align format of all 1:1 sentence alignments
 uplug-readalign -S 1 -T 1 -l align-file.xml

USAGE ^

 uplug-readalign [OPTIONS] align-file.xml

OPTIONS ^

 -c <thr> ........... set a link threshold <thr>
 -d <dir> ........... set home directory for aligned XML documents
 -h ................. print simple HTML
 -l ................. print links (filter mode)
 -m <max> ........... print max <max> alignments
 -s <LangID> ........ require source sentences to match <LangID>
 -t <LangID> ........ require target sentences to match <LangID>
 -S <max> ........... maximum number of source sentence in alignments
 -T <max> ........... maximum number of target sentence in alignments

DESCRIPTION ^

uplug-readalign is a simple script to read sentence alignments stored in XCES align format and prints the aligned sentences to STDOUT. It requires monolingual alignments (ascending order, no crossing links) of sentences in linked XML files. Linked XML files are specified in the toDoc and <fromDoc> attributes (see below).

 <cesAlign version="1.0">
  <linkGrp targType="s" toDoc="source1.xml" fromDoc="target1.xml">
    <link certainty="0.88" xtargets="s1.1 s1.2;s1.1" id="SL1" />
    ....
  <linkGrp targType="s" toDoc="source2.xml" fromDoc="target2.xml">
    <link certainty="0.88" xtargets="s1.1;s1.1" id="SL1" />

Several parameters can be set to filter the alignments and to print only certain types of alignments.

uplug-readalign can also be used to filter the XCES alignment files and to print the remaining links in the same XCES align format. Use the -l flag to enable this mode.

See also ^

More information on Uplug: Look at Uplug::Config

More downloads: https://bitbucket.org/tiedemann/uplug

syntax highlighting: