The Following User Says Thank You to MohammadAG For This Useful Post: | ||
![]() |
2010-05-05
, 16:21
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#112
|
![]() |
2010-05-05
, 16:37
|
|
Posts: 3,159 |
Thanked: 2,023 times |
Joined on Feb 2008
@ Finland
|
#113
|
The Following User Says Thank You to ossipena For This Useful Post: | ||
![]() |
2010-05-05
, 17:44
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#114
|
![]() |
2010-05-05
, 18:28
|
|
Posts: 485 |
Thanked: 708 times |
Joined on Feb 2010
@ Galiza
|
#115
|
![]() |
2010-05-05
, 18:38
|
Posts: 82 |
Thanked: 214 times |
Joined on Jan 2010
@ Cape town
|
#116
|
#!/usr/bin/env python ''' A dodgy-hack-and-slash T9 implementation in Python ''' import sys words = [line.strip() for line in open("/usr/share/dict/words", "rb").readlines()] mapping = {1:[".",",",":",";","!","?"], 2: ["a","b","c"], 3:["d", "e", "f"], 4:["g","h","i"], 5:["j","k","l"], 6:["m","n","o"], 7:["p","q","r","s"], 8:["t","u","v"], 9:["w","x","y","z"]} my_input = [int(num) for num in sys.argv[1]] words = [word for word in words if len(word) == len(my_input)] # this is probably the most naive way of doing things. i don't even want # to know how bad it is :) count = 0 for digit in my_input: possible_letters = mapping[digit] new_words = [] for word in words: try: if word[count] in possible_letters: new_words.append(word) except: continue words = new_words count += 1 print words
The Following 7 Users Say Thank You to cb22 For This Useful Post: | ||
![]() |
2010-05-05
, 19:09
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#118
|
![]() |
2010-05-06
, 04:19
|
|
Posts: 97 |
Thanked: 8 times |
Joined on Dec 2009
|
#119
|
The Following User Says Thank You to blwthompson For This Useful Post: | ||
![]() |
2010-05-06
, 05:16
|
|
Posts: 3,159 |
Thanked: 2,023 times |
Joined on Feb 2008
@ Finland
|
#120
|
First of all, thanks for this wonderful app. Well, thinking about Conversations integration, if this is not possible, what about opening vertsms when tap "New SMS" Conversations button while the phone is in portrait mode? is this hack possible, monitoring accelerometer or whatever? (sorry, no idea about programmin at all)
And other suggestion: what about set the fonts in white and box in black, in the style of Conversations and Phone apps? That would be great!
![]() |
Tags |
portrait sms, python |
|
Patch (removed the old one since it used the name button for the about dialog): http://pastebin.com/raw.php?i=c7N8f4wU