From 7315d72589874b3fcc1cc92ca9f815a33bbe3737 Mon Sep 17 00:00:00 2001 From: DGrothe-PhD Date: Sat, 28 Oct 2023 16:13:14 +0200 Subject: [PATCH] add t9 examples --- T9KeyboardApp/AddTextButton.cs | 9 +--- T9KeyboardApp/Form1.Designer.cs | 16 +++++++ T9KeyboardApp/Form1.cs | 7 +++ T9KeyboardApp/T9.json | 79 +++++++++++++++++++++++++++++++++ T9KeyboardApp/numify.py | 35 +++++++++++++++ 5 files changed, 138 insertions(+), 8 deletions(-) create mode 100644 T9KeyboardApp/T9.json create mode 100644 T9KeyboardApp/numify.py diff --git a/T9KeyboardApp/AddTextButton.cs b/T9KeyboardApp/AddTextButton.cs index b35243b..eca5e1a 100644 --- a/T9KeyboardApp/AddTextButton.cs +++ b/T9KeyboardApp/AddTextButton.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -namespace T9KeyboardApp +namespace T9KeyboardApp { public class AddTextButton : Button { diff --git a/T9KeyboardApp/Form1.Designer.cs b/T9KeyboardApp/Form1.Designer.cs index 99797c7..86c7fcc 100644 --- a/T9KeyboardApp/Form1.Designer.cs +++ b/T9KeyboardApp/Form1.Designer.cs @@ -55,6 +55,7 @@ private void InitializeComponent() btnAnrede = new Button(); btnHello = new Button(); btnGruss = new Button(); + btnAWDS = new Button(); SuspendLayout(); // // textBox1 @@ -402,6 +403,19 @@ private void InitializeComponent() btnGruss.UseVisualStyleBackColor = false; btnGruss.Click += BtnGruss_Click; // + // btnAWDS + // + btnAWDS.BackColor = Color.NavajoWhite; + btnAWDS.FlatAppearance.BorderColor = Color.Gray; + btnAWDS.FlatAppearance.BorderSize = 2; + btnAWDS.Location = new Point(972, 493); + btnAWDS.Name = "btnAWDS"; + btnAWDS.Size = new Size(78, 38); + btnAWDS.TabIndex = 28; + btnAWDS.Text = "AWDS!"; + btnAWDS.UseVisualStyleBackColor = false; + btnAWDS.Click += BtnAWDS_Click; + // // Form1 // AccessibleDescription = "T9 Tastatur. Geben Sie Text mit der Nummerntastatur ein, ungefähr wie auf alten Handys."; @@ -409,6 +423,7 @@ private void InitializeComponent() AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(1230, 629); + Controls.Add(btnAWDS); Controls.Add(btnGruss); Controls.Add(btnHello); Controls.Add(btnAnrede); @@ -471,6 +486,7 @@ private void InitializeComponent() private Button btnAnrede; private Button btnHello; private Button btnGruss; + private Button btnAWDS; } } diff --git a/T9KeyboardApp/Form1.cs b/T9KeyboardApp/Form1.cs index 0953ba8..584156a 100644 --- a/T9KeyboardApp/Form1.cs +++ b/T9KeyboardApp/Form1.cs @@ -236,5 +236,12 @@ private void BtnGruss_Click(object sender, EventArgs e) textBox1.Select(); } + private void BtnAWDS_Click(object sender, EventArgs e) + { + textBox1.Text += Environment.NewLine + Environment.NewLine + + "Auf Wiedersehen!" + Environment.NewLine + + Environment.NewLine; + textBox1.Select(); + } } } diff --git a/T9KeyboardApp/T9.json b/T9KeyboardApp/T9.json new file mode 100644 index 0000000..ff5eb95 --- /dev/null +++ b/T9KeyboardApp/T9.json @@ -0,0 +1,79 @@ +{ + "38" : [ "du" ], + "863" : [ "und" ], + "648" : [ "mit" ], + "428" : [ "hat" ], + "283" : [ "auf" ], + "446" : [ "hin" ], + "6424" : [ "mich" ], + "543278" : [ "liebst" ], + "724289" : [ "Schatz" ], + "94333773436" : [ "Wiedersehen" ], + "424" : [ "ich" ], + "37" : [ "er", "es"], + "743" : [ "sie" ], + "947" : [ "wir" ], + "447" : [ "ihr" ], + "3424" : [ "dich" ], + "7424" : [ "sich" ], + "867" : [ "uns" ], + "3824" : [ "euch" ], + "4223" : [ "habe" ], + "4228" : [ "habt" ], + "4278" : [ "hast" ], + "42236" : [ "haben" ], + "434228" : [ "gehabt" ], + "42883" : [ "hatte" ], + "428836" : [ "hatten" ], + "4288378" : [ "hattest" ], + "246" : [ "bin" ], + "2478" : [ "bist" ], + "478" : [ "ist" ], + "7463" : [ "sind" ], + "7343" : [ "seid" ], + "428838" : [ "hattet" ], + "927" : [ "war" ], + "92778" : [ "warst" ], + "9278" : [ "wart" ], + "92736" : [ "waren" ], + "4393736" : [ "gewesen" ], + "937336" : [ "werden" ], + "9473" : [ "wird" ], + "93733" : [ "werde" ], + "94778" : [ "wirst" ], + "937338" : [ "werdet" ], + "3773" : [ "esse" ], + "4778" : [ "isst" ], + "37736" : [ "essen" ], + "3778" : [ "esst" ], + "43437736" : [ "gegessen" ], + "886" : [ "tun" ], + "8878" : [ "tust" ], + "883" : [ "tue" ], + "888" : [ "tut" ], + "43826" : [ "getan" ], + "437244258" : [ "geschickt" ], + "72442536" : [ "schicken" ], + "72442578" : [ "schickst" ], + "7244253" : [ "schicke" ], + "7244258" : [ "schickt" ], + "72442583" : [ "schickte" ], + "53736" : [ "lesen" ], + "527" : [ "las" ], + "4353736" : [ "gelesen" ], + "5437" : [ "lies" ], + "54378" : [ "liest" ], + "327" : [ "das" ], + "337" : [ "der" ], + "343" : [ "die" ], + "346" : [ "ein" ], + "3463" : [ "eine" ], + "8435" : [ "viel" ], + "84353" : [ "viele" ], + "93644" : [ "wenig" ], + "936443" : [ "wenige" ], + "634783" : [ "meiste" ], + "6347836" : [ "meisten" ], + "2553" : [ "alle" ], + "25537" : [ "alles" ] +} \ No newline at end of file diff --git a/T9KeyboardApp/numify.py b/T9KeyboardApp/numify.py new file mode 100644 index 0000000..4b96ffc --- /dev/null +++ b/T9KeyboardApp/numify.py @@ -0,0 +1,35 @@ +def ifromchar(q): + c = q.lower() + if c < 'd': + return 2 + elif c < 'g': + return 3 + elif c < 'j': + return 4 + elif c < 'm': + return 5 + elif c < 'p': + return 6 + elif c < 't': + return 7 + elif c < 'w': + return 8 + else: + return 9 + +def numify(text): + result = "" + for x in text: + if x.isalpha(): + result += str(ifromchar(x)) + else: + result += x + return result + +def jsonify(text): + word = text.split() + for w in word: + print(f'"{numify(w)}" : [ "{w}" ],') + +# numify("Auf Wiedersehen!") +# '283 94333773436!' \ No newline at end of file