Mercurial > ppgen
comparison ppgen.py @ 1:00ed7df30fe4
Checking for 8k entries now. Comment improvements.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Mon, 22 Feb 2016 16:14:24 +0100 |
parents | 7558ecd1cbf1 |
children | a099246680ae |
comparison
equal
deleted
inserted
replaced
0:7558ecd1cbf1 | 1:00ed7df30fe4 |
---|---|
12 * Python v>=3.2 | 12 * Python v>=3.2 |
13 * a dictionary, Ding's trans-de-en by default. | 13 * a dictionary, Ding's trans-de-en by default. |
14 E.g. on a Debian/Ubuntu system in package "trans-de-en". | 14 E.g. on a Debian/Ubuntu system in package "trans-de-en". |
15 or from http://ftp.tu-chemnitz.de/pub/Local/urz/ding/de-en/ | 15 or from http://ftp.tu-chemnitz.de/pub/Local/urz/ding/de-en/ |
16 | 16 |
17 Uses a hardcodes filepath and selected language. | 17 Uses a hardcoded filepath and language. |
18 Search for **customize** below to change it. | 18 Search for **customize** below to change it. |
19 | 19 |
20 Copyright 2016 by Intevation GmbH. | 20 Copyright 2016 by Intevation GmbH. |
21 Author: 2016-01-21 Bernhard E. Reiter <bernhard@intevation.de> | 21 Author: Bernhard E. Reiter <bernhard@intevation.de> |
22 | 22 |
23 This file is Free Software under the Apache 2.0 license and thus | 23 This file is Free Software under the Apache 2.0 license and thus |
24 comes without any warranty (to extend permissible under applicable law). | 24 comes without any warranty (to extend permissible under applicable law). |
25 """ | 25 """ |
26 | 26 |
51 # for i in d: | 51 # for i in d: |
52 # f.write("{}\n".format(i)) | 52 # f.write("{}\n".format(i)) |
53 | 53 |
54 # Print some stats on the dictionary to be used | 54 # Print some stats on the dictionary to be used |
55 dl = len(d) | 55 dl = len(d) |
56 print("Found {:d} dictionary entries".format(dl)) | 56 print("Found {:d} dictionary entries.".format(dl)) |
57 if dl < 2000: | 57 if dl < 8000: |
58 print("!Your dictionary is below 2k entries, that is quite small!") | 58 print("!Your dictionary is below 8k entries, that is quite small!") |
59 tainted = True | 59 tainted = True |
60 | 60 |
61 print("|= Number of words |= possibilities |") | 61 print("|= Number of words |= possibilities |") |
62 for i in range(1,5): | 62 for i in range(1,5): |
63 print("| {:2d} | 2^{:4.1f} |".format( | 63 print("| {:2d} | 2^{:4.1f} |".format( |