From cc0e5d978f73a91f20fcc061c71bd40e876da403 Mon Sep 17 00:00:00 2001
From: Eric House
Date: Fri, 10 Mar 2023 10:03:18 -0800
Subject: [PATCH] add 21x21 info for German
---
xwords4/dawg/German/Makefile | 2 +-
xwords4/dawg/German/Makefile.Deutsch2022 | 45 +++++++++++++++++
xwords4/dawg/German/info.txt | 62 ++++++++++++------------
xwords4/dawg/dictstats.py | 3 +-
4 files changed, 79 insertions(+), 33 deletions(-)
create mode 100644 xwords4/dawg/German/Makefile.Deutsch2022
diff --git a/xwords4/dawg/German/Makefile b/xwords4/dawg/German/Makefile
index dda6ab36d..7bf70b868 120000
--- a/xwords4/dawg/German/Makefile
+++ b/xwords4/dawg/German/Makefile
@@ -1 +1 @@
-Makefile.sf
\ No newline at end of file
+Makefile.Deutsch2022
\ No newline at end of file
diff --git a/xwords4/dawg/German/Makefile.Deutsch2022 b/xwords4/dawg/German/Makefile.Deutsch2022
new file mode 100644
index 000000000..7f4b01b8c
--- /dev/null
+++ b/xwords4/dawg/German/Makefile.Deutsch2022
@@ -0,0 +1,45 @@
+# -*- mode: makefile; coding: utf-8; -*-
+# Copyright 2002 - 2023 by Eric House (xwords@eehouse.org). All
+# rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+XWLANG = Deutsch2022
+LANGCODE = de_DE
+ENC = UTF-8
+DICTNOTE = "Contributed by a user"
+
+TARGET_TYPE ?= WINCE
+
+include ../Makefile.langcommon
+
+SOURCEDICT ?= $(XWDICTPATH)/German/Deutsch2022.txt
+
+$(XWLANG)Main.dict.gz: $(SOURCEDICT) Makefile
+ file -z $(SOURCEDICT) | grep -q 'UTF-8 text' || exit 1
+ cat $< \
+ | sed 's,.,\U\0,g' \
+ | sed -e 's/ß/SS/g' \
+ | grep '^[AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ]*$$' \
+ | gzip -c > $@
+
+# Everything but creating of the Main.dict file is inherited from the
+# "parent" Makefile.langcommon in the parent directory.
+
+clean: clean_common
+ rm -f $(XWLANG)Main.dict.gz *.bin $(XWLANG)*.pdb $(XWLANG)*.seb
+
+help:
+ @echo 'make [SOURCEDICT=HansGerman.dict.gz|deutsch.dict.gz]'
diff --git a/xwords4/dawg/German/info.txt b/xwords4/dawg/German/info.txt
index 901a514a9..29bfa4172 100644
--- a/xwords4/dawg/German/info.txt
+++ b/xwords4/dawg/German/info.txt
@@ -47,36 +47,38 @@ LANGINFO: contain letters not found on tiles.
# German==3. Low byte is padding
XLOC_HEADER:0x8300
+COUNT_SIZES: 15 21
+
-{"_"} 0 2
-'A|a' 1 5
-'Ä|ä' 6 1
-'B|b' 3 2
-'C|c' 4 2
-'D|d' 1 4
-'E|e' 1 15
-'F|f' 4 2
-'G|g' 2 3
-'H|h' 2 4
-'I|i' 1 6
-'J|j' 6 1
-'K|k' 4 2
-'L|l' 2 3
-'M|m' 3 4
-'N|n' 1 9
-'O|o' 2 3
-'Ö|ö' 8 1
-'P|p' 4 1
-'Q|q' 10 1
-'R|r' 1 6
-'S|s' 1 7
-'T|t' 1 6
-'U|u' 1 6
-'Ü|ü' 6 1
-'V|v' 6 1
-'W|w' 3 1
-'X|x' 8 1
-'Y|y' 10 1
-'Z|z' 3 1
+{"_"} 0 2 4
+'A|a' 1 5 10
+'Ä|ä' 6 1 2
+'B|b' 3 2 4
+'C|c' 4 2 4
+'D|d' 1 4 8
+'E|e' 1 15 29
+'F|f' 4 2 4
+'G|g' 2 3 6
+'H|h' 2 4 8
+'I|i' 1 6 11
+'J|j' 6 1 2
+'K|k' 4 2 4
+'L|l' 2 3 6
+'M|m' 3 4 8
+'N|n' 1 9 17
+'O|o' 2 3 6
+'Ö|ö' 8 1 2
+'P|p' 4 1 2
+'Q|q' 10 1 2
+'R|r' 1 6 11
+'S|s' 1 7 14
+'T|t' 1 6 12
+'U|u' 1 6 12
+'Ü|ü' 6 1 2
+'V|v' 6 1 2
+'W|w' 3 1 2
+'X|x' 8 1 2
+'Y|y' 10 1 2
+'Z|z' 3 1 2
# should ignore all after the above
diff --git a/xwords4/dawg/dictstats.py b/xwords4/dawg/dictstats.py
index dc35ef261..15a8c31be 100755
--- a/xwords4/dawg/dictstats.py
+++ b/xwords4/dawg/dictstats.py
@@ -54,13 +54,12 @@ def main():
line = line.strip()
length = len(line)
- # if not length in wordSizeCounts: wordSizeCounts[length] = 0
wordSizeCounts[length] += 1
wordCount += 1
for letter in line:
ii = ord(letter)
- assert ii > 32 or ii < 4 or ii == 0, 'letter {} out of range'.format(ii)
+ assert ii > 32 or ii < 4 or ii == 0, 'letter {} in word {} out of range'.format(ii, line)
if not letter in letters: letters[letter] = Letter(letter)
letters[letter].increment()
letterCount += 1