tmx
Classes and functions to make and handle Translation Memory eXchange files.
add_filename_id(filename)
Add the tmx filename as an prop element in the header.
Source code in corpustools/tmx.py
42 43 44 45 46 47 48 | |
main()
Parallelise files.
Source code in corpustools/tmx.py
137 138 139 140 141 142 | |
make_tmx(file1_name, file1_lang, file2_lang, sentence_pairs)
Make tmx file based on the output of the aligner.
Source code in corpustools/tmx.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
make_tmx_header(filename, lang)
Make a tmx header based on the lang variable.
Source code in corpustools/tmx.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
make_tu(line1, file1_lang, line2, file2_lang)
Make a tmx tu element based on line1 and line2 as input.
Source code in corpustools/tmx.py
32 33 34 35 36 37 38 39 | |
make_tuv(line, lang)
Make a tuv element given an input line and a lang variable.
Source code in corpustools/tmx.py
85 86 87 88 89 90 91 92 93 | |
parse_options()
Parse the commandline options.
Returns:
| Type | Description |
|---|---|
Namespace
|
the parsed commandline arguments |
Source code in corpustools/tmx.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
tmx2html(filename)
Turn a tmx file into an html file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
name of a tmx file |
required |
Source code in corpustools/tmx.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |