The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

opus2moses

SYNOPSIS

 # convert sentence aligned bitexts to factored moses input
 # (requires XML::Parser)

 opus2moses [OPTIONS] < sentence-align-file.xml

OPTIONS:

 -s srcfactors ......... specify source language factors besides surface words
 -t trgfactors ......... the same for the target language (separated by ':')
                         factors should be attributes of <w> tags!!
                         (except 'word' which is the word itself)
 -d dir ................ home directory of the OPUS subcorpus
 -n file-pattern ....... skip bitext files that match pattern (e.g. ep-00-1*)
 -i .................... inverse selection (only files matching file pattern)
 -e src-data-file ...... output file for source language data (default = src)
 -f src-data-file ...... output file for target language data (default = trg)

 -b xces-align-file .... print extracted pairs to am XCES ALIGN file
 -p sentence-pair-file . stores sentence ID pairs of the extracted pairs
 -c threshold .......... link score threshold (default attribute = certainty)
 -C link-score-attr .... name of the attribute that stores the link score
 -u src-langid ......... check source language ID (require langid markup)
 -U src-langid-conf .... confidence threshold for source langid
 -w trg-langid ......... check target language ID (require langid markup)
 -W trg-langid-conf .... confidence threshold for target langid
 -l .................... convert to lower case
 -1 .................... 1:1 links only
 -x max ................ max size of sentences (in nr of words)

 -r .................... process untokenized (raw) XML (no length filtering)

 -S .................... read sentences sequentially (requires monotonic links)
                         (some sentence pairs may be missing if this fails!)

OBSOLETE:

The following option is now obsolete because the option for reading all sentences into memory is now the default. Switch this off by using -S.

 -M .................... read all sentences into memory for an aligned document
                         before extracting linked sentences (for non-monotonic links)

LICENSE

 ---------------------------------------------------------------------------
 Copyright (c) 2004-2019 Joerg Tiedemann

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 ---------------------------------------------------------------------------

See also

This script is part of opus-tools https://github.com/Helsinki-NLP/opus-tools See also OPUS http://opus.nlpl.eu for more information about the corpus.