Repository navigation
Expand file tree
/
Copy pathcreatepackages.py
More file actions
executable file
·609 lines (481 loc) · 23 KB
/
Copy pathcreatepackages.py
File metadata and controls
executable file
·609 lines (481 loc) · 23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
82
83
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
218
219
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, re, string, codecs, datetime, os, locale, urllib, argparse, cgi, locale, shutil
scriptVersion = "3.0"
scriptName = "dict.cc Dictionary Generator for MacOS"
#
# Global variable for storing the command line arguments
arguments = ''
#
# statistics -- displayed during make
statistics = {'indexkeys': 0, 'entries': 0, 'variants': 0, 'elements': 0}
#
# initialize an empty dictionary
dictionary = {}
creationDate = str(datetime.date.today())
def thousandsseparator (number):
return re.sub(r'(\d{3})(?=\d)', r'\1.', str(number)[::-1])[::-1]
#
#
# Main fuction.
# Handles parameter parsing and appropriate execution of the various steps in the tool chain
#
def main(argv):
global scriptVersion, scriptName
print("")
print(scriptName)
print(" Version " + scriptVersion)
print(" licensed under the GLP")
print(" https://www.bernhardcaspar.de/dictcc")
print(" https://github.com/bernhardc/dictcc-macos-dictionary")
print("")
reload(sys)
sys.setdefaultencoding('utf8')
parser = argparse.ArgumentParser(description=scriptName)
parser.add_argument('-d', '--debug', action='store_true', dest='debug', default=False, help='Enables debug output')
parser.add_argument('-x', '--subset', action='store_true', dest='generatesubset', default=False, help='Creates much smaller packages with a random subset of words')
parser.add_argument('-e', '--encoding', action='store', dest='encoding', default='utf_8', help='Character encoding of input file (default UTF8)')
parser.add_argument('-v', '--version', action='store', dest='osxversion', default='10.6', help='MacOS minimum target version for Dictionary SDK (default: 10.6)')
parser.add_argument('filename', type=str, action='store', default="DE-EN.txt", help='dict.cc word list to create dictionary from (e.g. "de-en.txt")')
parser.add_argument('languagepair', type=str, action='store', default="DE-EN", help='Two-letter language codes of the dictionary language pair (e.g. "de-en")')
parser.add_argument('dictionaryname', type=str, action='store', default="Deutsch-Englisch by dict.cc", help='Name of the dictionary (e.g. "Deutsch-Englisch (dict.cc)")')
global arguments
try:
arguments = parser.parse_args()
except:
print("")
print("Show help:")
print(" python createpackages.py --help")
print("")
print("Example usage:")
print(" python createpackages.py -d de-en.sample.txt de-en \"Deutsch-Englisch Sample (dict.cc)\"")
print("")
return
arguments.codename = string.replace(string.lower(arguments.languagepair), '-', '')
arguments.languages = arguments.languagepair.lower().split('-')
# DE-IT -> dtit.dict.cc -> Will work for online lookups
if(string.lower(arguments.languagepair)=="de-en"):
arguments.urlprefix = ""
else:
arguments.urlprefix = arguments.codename
# Fix encoding of long title (e.g. make Deutsch FranzÖsisch work)
arguments.dictionarynameencoded = arguments.dictionaryname
arguments.dictionarynameshort = arguments.languagepair.upper() + ' (dict.cc)'
# enable printing of unicode strings without using .encode() millions of times
print("Switching sys.stdout to utf-8...")
sys.stdout = codecs.getwriter("utf-8")(sys.stdout);
arguments.buildfolder = "build"
arguments.stagefolder = arguments.buildfolder + "/stage"
arguments.distfolder = "dist"
arguments.tempfile = arguments.buildfolder + '/dictionary.xml'
if os.path.exists(arguments.buildfolder):
shutil.rmtree(arguments.buildfolder)
os.makedirs(arguments.buildfolder)
if not os.path.exists(arguments.stagefolder):
os.makedirs(arguments.stagefolder)
if not os.path.exists(arguments.distfolder):
os.makedirs(arguments.distfolder)
if(arguments.debug):
print "Debug: ", arguments.debug
print "Subset: ", arguments.generatesubset
print "Filename: ", arguments.filename
print "Codename: ", arguments.codename
print "URLPrefix: ", arguments.urlprefix
print "Language Pair: ", arguments.languagepair
print "Dictionary Name: ", arguments.dictionaryname
print "Short Name: ", arguments.dictionarynameshort
print "Encoding: ", arguments.encoding
readVocabulary(arguments.filename)
generateXML(arguments.tempfile)
createPlist()
createDictionary()
createPackage()
def createPackage():
global arguments
print("Creating installation package")
packageName = arguments.dictionaryname + ".pkg"
command = string.join(["pkgbuild --root", arguments.stagefolder, "--identifier", "com.macosdictcc."+arguments.codename, "--version", scriptVersion, "--install-location /Library/Dictionaries", "\"" + arguments.distfolder + "/" + packageName + "\""], " ")
os.system(command)
print ""
print ""
print "Successfully generated dictionary installation package: "
print ""
print " " + arguments.distfolder + "/" + packageName
print ""
def updateInPreferences():
global statistics, arguments
s = '<strong>' + arguments.dictionarynameencoded + '</strong><br />'
s += '<p>This dictionary is based on the vocabulary database from http://dict.cc/.<br />'
s += 'It was generated on ' + datetime.date.today().strftime('%A, %B %d %Y') + ' and contains ' + str(thousandsseparator(statistics['entries'])) + ' entries.</p>'
s += '<p>The copyright for the vocabulary database is held by Paul Hemetsberger and the dict.cc community. Philipp Brauner (lipflip.org) converted the database into a format suitable for OS X and wrote a series of tools to do so. Parts of his work were inspired by Wolfgang Reszel (tekl.de) and his Beolingus plugin. Additional work was done by Bernhard Caspar. The source code for the dictionary generation tool is available at https://github.com/bernhardc/dictcc-macos-dictionary</p>'
s += '<p>For more information visit</p>'
s += '<p>https://www.bernhardcaspar.de/dictcc</p>'
if(arguments.debug):
print s
return s
def createPlist():
global arguments
print("Creating plist")
output = codecs.open(arguments.buildfolder + "/dictcc.plist","w","utf-8")
output.write(u'''<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>German</string>
<key>CFBundleIdentifier</key>
<string>com.apple.dictionary.dictcc%s</string>
<key>CFBundleName</key>
<string>%s</string>
<key>CFBundleVersion</key>
<string>%s</string>
<key>CFBundleShortVersionString</key>
<string>%s</string>
<key>DCSDictionaryCopyright</key>
<string>%s</string>
<key>DCSDictionaryManufacturerName</key>
<string>Paul Hemetsberger, dict.cc / Philipp Brauner, lipflip.org / Wolfgang Reszel, www.tekl.de / Bernhard Caspar, https://www.bernhardcaspar.de/dictcc</string>
<key>DCSDictionaryLanguages</key>
<array>
<dict>
<key>DCSDictionaryIndexLanguage</key>
<string>%s</string>
<key>DCSDictionaryDescriptionLanguage</key>
<string>de</string>
</dict>
<dict>
<key>DCSDictionaryIndexLanguage</key>
<string>%s</string>
<key>DCSDictionaryDescriptionLanguage</key>
<string>de</string>
</dict>
</array>
<key>DCSDictionaryFrontMatterReferenceID</key>
<string>front_back_matter</string>
</dict>
</plist>
''' % (arguments.codename, arguments.dictionarynameshort, str(datetime.date.today()), str(datetime.date.today()), '<![CDATA['+updateInPreferences()+']]>', arguments.languages[0], arguments.languages[1] ) )
def createDictionary():
global arguments1
print "Calling external script to create dictionary"
# -v 10.5 -> bigger packages
# -v 10.6 -> smaller packages
# arguments.osxversion
command = string.join(["/Developer/Extras/Dictionary\ Development\ Kit/bin/build_dict.sh", "-v "+arguments.osxversion, '"'+arguments.dictionaryname+'"', arguments.tempfile, "dictcc.css", arguments.buildfolder + "/dictcc.plist"], " ")
# print "% "+ command
os.system(command)
shutil.move("objects/" + arguments.dictionaryname + ".dictionary", arguments.stagefolder)
shutil.move("objects", arguments.buildfolder)
#
# styles meta information of dictionary entries (e.g. "{colloq.}")
def style(text):
nestedCurlyBrackets = re.compile('\{([^}]+)\{([^}]+)\}')
if not nestedCurlyBrackets.search(text):
text = re.sub('(\{[^}]+\})', r' <i>\1</i>',text)
nestedRoundBrackets = re.compile('\(([^)]+)\(([^)]+)\)')
if not nestedRoundBrackets.search(text):
text = re.sub('(\([^)]+\))', r' <span class="a">\1</span>',text)
nestedSquareBrackets = re.compile('\[([^]]+)\[([^]]+)\]')
if not nestedSquareBrackets.search(text):
text = re.sub('(\[[^]]+\])', r' <span class="b">\1</span>',text)
return text
#
# calculates an index-key and adds the entry to the dictionary
# multiple translations and annotated terms are stored in one entry
# INDEX: term
# term: [trans1, trans2, tras3]
# term (umgs.) : [trans4]
def addEntry(word, definition, entryType):
global dictionary;
# normalization
# prepare index string // remove all kinds of additional descriptions
index = word
if index.startswith("to "): index = index[3:] # strip (to)
index = re.sub('(\([^)]+\))', r'',index)
index = re.sub('(\{[^}]+\})', r'',index)
index = re.sub('(\[[^]]+\])', r'',index)
index = re.sub(' ', r' ', index) # remove
index = index.strip() # .lower()
index = index.lower()
if index.endswith("-"): index = index[:-1]
definitionx = definition
if entryType!='': definitionx = definition + '(' + entryType + ')'
# nothing left to be used as an index (e.g. entries like sayings)
if len(index)<1:
raise NameError
#dictionary[index][entries] ->
#dictionary[index][entryType][entries]
# get entry from dictionary
if dictionary.has_key(index):
entry = dictionary[index]
else:
entry = {} # not found? create new entry
#if entry.has_key(entryType):
# subentry = entry[entryType]
# else:
# subentry = {}
# add translation to entry
if entry.has_key(word):
entry[word].append(definitionx)
else:
entry[word]=[definitionx]
#entry[entryType] = subentry
# store entry in dictionary
dictionary[index] = entry;
#
# reads a data file and add terms to dictionary
def readVocabulary(filename):
lines=0
comments=0
errors=0
try:
input = codecs.open(filename, "r", arguments.encoding)
except IOError:
print '*** File "' + filename + '" not found or other error.'
return False
else:
print 'Processing "'+filename+'"'
for line in input:
lines=lines+1
if(arguments.generatesubset):
if(lines>3000):
break
# trow away comments or empty lines
if (line[0]=="#") or (len(line)<=2):
comments=comments+1
continue
# throw away my email address
if (re.search('lipflip', line) or re.search('herun7erg', line)):
if arguments.debug:
print " Found fingerprint: " + line
continue
# HTML escape some incompatible characters
line = line.replace("<","«")
line = line.replace(">","»")
line = line.replace("&","&")
# remove some non-printable "gremlin" characters
line = line.replace("\a","")
line = line.replace("\b","")
line = line.replace("\f","")
line = line.replace("\r","")
# split entry into english and german part
data = line.split("\t", 2);
if len(data)<2:
errors = errors+1
if arguments.debug:
print "Error: "+line
continue
left = data[0].strip();
right = data[1].strip();
entryType = "";
if len(data)>=3:
entryType = data[2].strip();
# fix quotes
# left = re.sub('"([^"]+)"',r'„\1“'.decode("utf-8"), left) # dt. anführungsstriche
# right = re.sub('"([^"]+)"',r'“\1”'.decode("utf-8"), right) # engl. anführungsstriche
left = left.replace('"', "")
right = right.replace('"', "")
# if (left1!=left) or (right1!=right):
# print "PANIC! " + line
# raise NameError
# ok... add to dictionary
try:
addEntry(left, right, entryType);
except:
dsfsf=5
#if arguments.debug:
# print "addEntry('%s', '%s', '%s') failed!" % (left, right, entryType)
#errors = errors+1
try:
addEntry(right, left, entryType);
except:
dsfsf=5
#if arguments.debug:
# print "addEntry('%s', '%s', '%s') failed!" % (right, left, entryType)
#errors = errors+1
input.close
print("")
print(" Read %s lines with %s comments. Errors: %s" % ( lines, comments, errors) )
print(" %s unique pages in dictionary (probably)." % len(dictionary))
return True
#
# generate a search query url for the current entry
# TODO - convert title to a valid url
# spaces -> "+"
# überholen -> s=%FCberholen
def generateSearchQuery(title):
global arguments
# encodedTitle = urllib.quote_plus(title.encode('cp1252'))
return "http://"+arguments.urlprefix+".dict.cc?s="+title
#
# generate a set of keys in the index
# to download -> { to download, download } etc.
def generateIndexEntries(entry):
def fix(text):
text = re.sub(' ', r' ', text) # remove dublicate spaces
text = text.strip()
if (len(text) > 99):
text = text[:99]
return text
# create empty set and add several keys
indexKeys = []
variants = []
# make a copy...
text = entry
# remove additional descriptions
text = re.sub('(\{[^}]+\})', r'',text)
text = re.sub('(\[[^]]+\])', r'',text)
# remove info "(ganz) gewöhnlich" => "gewöhnlich"
reducedText = re.sub('(\([^)]+\))', r'',text)
variants.append(reducedText)
# if something was changed add alternative: "(info) blupp -> info blupp" (without braces)
if (reducedText != text):
extendedText = re.sub('\(([^)]+)\)', r'\g<1>', text)
variants.append ( extendedText )
startWords = [
# English
'to', 'to be', 'to be a', 'to do sb.', 'to do a',
# French
'se',
# German - I am sure there are still some prepositions missing though.
'etw.', 'Etw.', 'auf', 'auf etw.', 'auf jdn./etw.', 'auf jdn.', 'mit', 'mit etw.', 'mit jdm./etw.', 'mit jdm.', 'von', 'vor', 'vor etw.', 'auf jdm./etw.', 'auf jdn.', 'jdm./etw.', 'jd.', 'jds.', 'jdm. etw.', 'jdm.', 'jdn.', 'jds./etw.', 'jd./etw.', 'jdn./etw.', 'die', 'der', 'den', 'das', 'eine', 'einen', 'ein', 'sich mit etw.', 'sich mit jdm.', 'sich', 'sich etw.', 'sich jdn.', 'sich jdm.', 'sich jdm./etw.', 'sich mit', 'sich mit etw.', 'sich mit jdm.', 'sich mit jdm./etw', 'von etw.', 'von jdm./etw.', 'vor jdm./etw.', 'zu', 'zu etw.', 'zu jdm./etw.', 'zu jdm.', 'über', 'über etw.'
]
# loop through variants and add normalized keys
for variant in variants:
fixedVariant = fix(variant)
indexKeys.append(fixedVariant)
for startWord in startWords:
if variant.startswith(startWord + ' '):
coreWord = fix(variant[(len(startWord)+1):])
if coreWord:
indexKeys.append(coreWord) # download -> download, to download
strippedVariant = fixedVariant
for startWord in startWords:
strippedVariant = strippedVariant.replace(startWord + ' ', '');
strippedVariant = fix(strippedVariant)
if not (strippedVariant == fixedVariant):
indexKeys.append(strippedVariant)
return indexKeys
#
# renders an entry to XML
# ID: unique number
# index: dictionary entry
def renderEntry(ID, index):
global dictionary
global statistics
entry = dictionary[index]
# unique entry id
ID = str(ID)
# duh. that's a bit to simple
# TODO
title = index;
# generate a set of index keys for this entry
indexKeys = []
for term in entry.keys():
indexKeys.extend(generateIndexEntries(term))
# throw out dublicate entries
indexKeys = set(indexKeys)
#print 'Index keys generated for "'+title+'":'
#for indexKey in indexKeys:
# print ' ' + indexKey
#
# CREATE HTML ENTRY
#
# start with title
s = '<d:entry id="' + ID + '" d:title="' + title +'" >\n'
statistics['entries']+=1
# add generated inddexKeys
for indexKey in indexKeys:
statistics['indexkeys']+=1
s+= '<d:index d:value="' + indexKey +'"/>'
# loop through several spellings
for term in entry.keys():
statistics['variants']+=1
sub ='<h1>'+style(term)+'</h1>'
sub+="<ul>"
for element in entry[term]:
statistics['elements']+=1
sub+="<li>"+style(element)+"</li>"
sub+="</ul>"
s+=sub
# add a footer
s+='<div class="f">'
# URL for online query
s+='<a href="'+generateSearchQuery(title)+'">dict.cc</a>'
s+=' | <a href="x-dictionary:r:front_back_matter">Info</a>'
s+='</div>'
s+='</d:entry>\n\n'
return s
# Generate XML output
def generateXML(filename):
print "Generating XML output"
global statistics, arguments, dictionary, arguments, scriptVersion, scriptName
# prepare output
if (arguments.debug):
print " Filename: " + filename
output = codecs.open(filename,"w","utf-8")
# XML Header
output.write(u'''<?xml version="1.0" encoding="UTF-8"?>
<d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">\n''')
# process each dictionary term
count = 0
for term in dictionary.keys():
count = count + 1
output.write(renderEntry(count, term))
# front matter
#<d:index d:value="Vorwort (dict.cc-plugin)"/>
#<d:index d:value="Lizenz (dict.cc-plugin)"/>
#<d:index d:value="Copyright (dict.cc-plugin)"/>
#<d:index d:value="dict.cc"/>
#<d:index d:value="update (dict.cc-Plugin)"/>
# u = unicode('abcü', 'iso-8859-1')
# encodeddictionaryname = "%s".encode('iso-8859-1') % u
output.write(u'''
<d:entry id="front_back_matter" d:title="Info">
<h1>dict.cc Wörterbuch %s</h1>
<p>Dieses Wörterbuch stammt aus dem von Paul Hemetsberger angebotenen Online-Wörterbuch <a href="http://www.dict.cc">www.dict.cc</a>, das seinerseits auf der Wortliste von <a href="http://dict.tu-chemnitz.de/">dict.tu-chemnitz.de</a>, sowie der Mitarbeit zahlreicher Benutzerinnen und Benutzer von dict.cc basiert.</p>
<p>Dieses Wörterbuch wurde von <a href="https://www.bernhardcaspar.de/dictcc">Bernhard Caspar</a> erstellt. Die Erzeugung basiert auf den
Werkzeugen zur Erstellung eines Plugins für Dictionary.App/Lexikon von <a href="http://lipflip.org/articles/dictcc-dictionary-plugin">Philipp Brauner</a>, welche durch die Integration eines ähnlichen Tools von <a href="http://www.tekl.de/">Wolfgang Reszel</a> erheblich verbessert wurden.</p>
<p>Dieses Wörterbuch wurde am %s erstellt und enthält %s Einträge.</p>
<p>Weitere aktuelle Informationen finden Sie hier:<br /><a href="https://www.bernhardcaspar.de/dictcc">https://www.bernhardcaspar.de/dictcc</a>.</p>
<p> <br/> </p>
<h1>Erstellt mit:</h1>
<p>%s %s</p>
<p><a href="https://github.com/bernhardc/dictcc-macos-dictionary">https://github.com/bernhardc/dictcc-macos-dictionary</a></p>
<p> <br/> </p>
<p><h1>Lizenz:</h1>
Nutzungsbedingungen der Übersetzungsdaten von dict.cc<br />
Stand vom 11. Februar 2005<br />
Die Bezeichnung "die Daten" steht für die Inhalte der Datenbank, die auf den Seiten und in den Dateien auf www.dict.cc zur Verfügung gestellt wird, sowie für Auszüge daraus.<br />
<br />
PERSÖNLICHER GEBRAUCH<br />
Die Nutzung der Daten für den persönlichen Gebrauch ist gestattet, solange die Daten nicht weitergegeben oder veröffentlicht werden.<br />
<br />
VERWENDUNG IN COMPUTERPROGRAMMEN<br />
Die Verwendung der Daten in Computerprogrammen ist erlaubt, wenn folgende Bedingungen eingehalten werden:<br />
Programme, die Daten von dict.cc verwenden, müssen der GPL unterliegen.<br />
Das heißt unter anderem, dass der Quellcode des Programms der Allgemeinheit zur Weiterverwendung zur Verfügung gestellt werden muss.<br />
Die Übersetzungsdaten selbst dürfen nicht mit dem Programm mitgeliefert werden, sondern der Benutzer muss aufgefordert werden, die benötigte Datei für den eigenen Gebrauch direkt von dict.cc herunterzuladen. Dadurch wird gewährleistet, dass jeder Nutzer der Daten diese Lizenzbestimmungen gesehen und akzeptiert hat.<br />
Das Programm darf nicht dazu bestimmt oder geeignet sein, die Daten im Internet zu veröffentlichen, auch nicht auszugsweise.<br />
<br />
SONSTIGE VERWENDUNG<br />
Weitere Arten der Verwendung der Daten, insbesondere die Verwendung auf Webseiten, auch auszugsweise, bedürfen einer ausdrücklichen schriftlichen Genehmigung des Betreibers von <a href="http://dict.cc/">dict.cc</a>, Ing. Paul Hemetsberger.<br />
Die Verwendung der Daten im Zusammenhang mit Suchmaschinen-Optimierungstaktiken oder Spamming in jeglicher Form ist strengstens untersagt.<br />
<br />
WEITERE BESTIMMUNGEN<br />
Sämtliche Aspekte bezüglich der Übersetzungsdaten von dict.cc, die in diesen Bestimmungen nicht eindeutig behandelt sind, bedürfen einer schriftlichen Klärung vor einer eventuellen Verwendung. Bei Verstößen gegen diese Bedingungen behält sich der Betreiber von dict.cc rechtliche Schritte vor. Der Gerichtsstand ist Wien. Es gilt materielles österreichisches Recht.<br /></p>
</d:entry>
''' % (arguments.dictionarynameencoded, datetime.date.today().strftime('%d.%m.%Y'), thousandsseparator(str(statistics['entries'])), scriptName, scriptVersion ) )
if(arguments.debug):
print(" Closing dictionary xml...")
# Finish up
output.write(u'''</d:dictionary>\n''');
output.close
print (" Wrote %s entries to '%s'" % (count, filename) )
if(arguments.debug):
print (" Entries : %s" % (statistics['entries']));
print (" Index keys: %s" % (statistics['indexkeys']));
print (" Variants : %s" % (statistics['variants']));
print (" Elements : %s" % (statistics['elements']));
if __name__ == "__main__":
main(sys.argv[1:])