3 # Dieses kleine Scriptlein prüft für alle Dateien unter ./layouts/ die
4 # Gesamtstrafpunktzahl des beinhalteten Layouts und listet deren Namen
6 # Es ist nicht Fehlertolerant, läuft nur unter unixartigen Systemen und
7 # produziert eine nur begrenzt aussagefähige Rangfolge.
9 # Da die Bewertungsfunktion für die Optimierung von Neo 3 geschrieben
10 # wurde, kann sie nur in Grenzen zum Vergleich anderer Layouts
11 # verwendet werden. Eine entsprechende Erweiterung nützt der
12 # Entwicklung von Neo 3 nicht und wird deshalb wahrscheinlich nie
22 while test -n "$arg0"; do
23 if test "$arg0" = "-h"; then
25 echo " -h display Help and exit"
26 echo " -m test layouts for missing characters" # don't rely on this
27 echo " -p sort by tot. penalty per letter (default)"
28 echo " -t sort by total penalty"
29 echo " -k sort by key position cost"
30 echo " -f sort by fingerrepeats in 2-gramme"
31 echo " -d sort by disbalance of fingers"
32 echo " -r sort by finger repeats between top and bottom"
33 echo " -3 sort by trigrams without handswitching"
34 echo " -j sort by row jumps (rows²/dist)²"
35 echo " -i sort by hand disbalance"
36 echo " -s sort by badly positioned shortcut keys"
37 echo " -u sort by no handswitching after unbalancing"
38 echo " -a sort by movement pattern"
39 echo " -o use old values instead of computing new ones"
43 elif test "$arg0" = "-m"; then
46 c
="a b c d e f g h i j k l m n o p q r s t u v w x y z ä ö ü ß , \."
47 for a
in layouts
/* ; do
50 if test -z "$(head -3 "$a" | grep "$b")"; then
51 missing
="$missing ${b#\\}"
54 if test -n "$missing"; then
55 echo "$a:$missing missing"
58 elif test "$arg0" = "-p"; then
60 kriterium
="tot. penalty per letter"
61 suchzeile
="x100 total penalty per letter"
62 elif test "$arg0" = "-t"; then
64 kriterium
="total penalty"
65 suchzeile
="x10 billion total penalty compared to notime-noeffort"
66 elif test "$arg0" = "-k"; then
68 kriterium
="keyposition"
69 suchzeile
="mean key position cost in file 1gramme.txt ( [0-9]*.[0-9]* )"
70 elif test "$arg0" = "-f"; then
72 kriterium
="fingerrepeats"
73 suchzeile
="% finger repeats in file 2gramme.txt ( [0-9]*.[0-9]* )"
74 elif test "$arg0" = "-d"; then
76 kriterium
="disbalance of fingers"
77 suchzeile
="million keystrokes disbalance of the fingers ( [0-9]*.[0-9]* )"
78 elif test "$arg0" = "-r"; then
80 kriterium
="finger repeats between top and bottom"
81 suchzeile
="% finger repeats top to bottom or vice versa ( [0-9]*.[0-9]* )"
82 elif test "$arg0" = "-3"; then
84 kriterium
="trigrams without handswitching"
85 suchzeile
="% of trigrams have no handswitching (after direction change counted x 1 ) ( [0-9]*.[0-9]* )"
86 elif test "$arg0" = "-j"; then
88 kriterium
="row jumps (rows²/dist)²"
89 suchzeile
="billion (rows²\/dist)² to cross ( [0-9]*.[0-9]* )"
90 elif test "$arg0" = "-i"; then
92 kriterium
="hand disbalance"
93 suchzeile
="hand disbalance. Left: [0-9]*.[0-9]* %, Right: [0-9]*.[0-9]* % ( [0-9]*.[0-9]* )"
94 elif test "$arg0" = "-s"; then
96 kriterium
="badly positioned shortcut keys"
97 suchzeile
="badly positioned shortcut keys (weighted)."
98 elif test "$arg0" = "-u"; then
100 kriterium
="no handswitching after unbalancing"
101 suchzeile
="no handswitching after unbalancing key (weighted)."
102 elif test "$arg0" = "-a"; then
104 kriterium
="movement pattern"
105 suchzeile
="movement pattern cost (weighted)."
106 elif test "$arg0" = "-v"; then
108 elif test "$arg0" = "-o"; then
111 echo "unknown option: ‘$arg0’"
120 if test -n "$sort"; then
122 for a
in layouts
/* ; do
123 if test -n "$oldvalues"; then
124 ergebnis
="$(cat "$a")"
126 ergebnis
="$(./check_neo.py -v --check-string "`cat "$a"`")"
127 if ! test "$ergebnis" = "$(cat "$a")"; then
128 echo "$ergebnis" > "$a"
131 echo "${a##*/}:" >> "$tmp"
132 echo "$ergebnis" >> "$tmp"
133 if test -n "$verbose"; then
139 echo "Ranking of $kriterium:\n"
141 suchzeile
="s/:$// ; t a ; s/^# // ; t b; d ; :b s/$suchzeile// ; t c; d; :c G; s/\\n//; p; d; :a h; d"
143 sed "$suchzeile" "$tmp" |
sort -g
147 ³ä missing because of M4L
148 ⁴. missing because of M4L
149 missing letters are getting overall penalty" # dont blame me for my english ;-)