compare_tmx_goldstandard
Compare prestable tmx files to files produced by the parallelizer.
TmxComparator
A class to compare two tmx-files
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
get_diff_as_text()
Return a stringlist containing the diff lines
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
61 62 63 64 65 66 67 68 69 |
|
get_lang_diff_as_text(lang)
Return a stringlist containing the diff lines
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
71 72 73 74 75 76 77 78 79 80 81 |
|
get_lines_in_wantedfile()
Return the number of lines in the reference doc
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
40 41 42 |
|
get_number_of_differing_lines()
Find how many lines differ between to tmx documents.
Given a unified_diff, find out how many lines in the reference doc differs from the doc to be tested. A return value of -1 means that the docs are equal
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
TmxGoldstandardTester
A class to test the alignment pipeline against the tmx goldstandard
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
__init__(testresult_filename, dateformat_addition=None)
Set the name where the testresults should be written
Find all goldstandard tmx files
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
87 88 89 90 91 92 93 94 95 96 97 |
|
align_files(testrun, want_tmx_file, paralang, aligner)
Align files
Compare the tmx's of the result of this parallellization and the tmx of the goldstandard file Write the result to a file Write the diffs of these to tmx's to a separate file
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
compute_xmlfilename(want_tmx_file)
Compute the name of the xmlfile which should be aligned
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
175 176 177 178 179 180 181 182 |
|
dateformat()
Get the date and time, 20111209-1234. Used in a testrun element
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
107 108 109 110 111 |
|
find_goldstandard_tmx_files()
Find the goldstandard tmx files, return them as a list
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
206 207 208 209 210 211 212 213 214 215 216 217 |
|
get_number_of_diff_lines()
Get the number of diff lines.
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
103 104 105 |
|
run_test()
Make a testrun element.
This element contain the result of the test.
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
set_number_of_diff_lines(diff_lines)
Increase the total number of difflines in this test run
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
99 100 101 |
|
write_diff_files(comparator, parallelizer, filename)
Write diffs to a jspwiki file
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
TmxTestDataWriter
A class that writes tmx test data to a file
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
|
make_file_element(name, gspairs, diffpairs)
Make the element file, set the attributes
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
236 237 238 239 240 241 242 243 |
|
make_paragstesting_element()
Make the paragstesting element
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
255 256 257 258 259 |
|
make_testrun_element(datetime)
Make the testrun element, set the attribute
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
248 249 250 251 252 253 |
|
write_paragstesting_data()
Write the paragstesting data to a file
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
264 265 266 267 268 269 270 |
|
parse_options()
Parse the command line.
Expected input is one or more tmx goldstandard files.
Source code in /home/anders/projects/CorpusTools/corpustools/compare_tmx_goldstandard.py
273 274 275 276 277 278 279 280 281 282 283 284 |
|