Reply
Thread Tools
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#111
Originally Posted by qwerty12 View Post
I'm no Python person either (I deal in dodgily-written C and Vala) but there's no need to pass label to backspace_tap_and_hold
Also, I'd remove the "for i in range..." statement - no need to have it running multiple times
That worked

Patch (removed the old one since it used the name button for the about dialog): http://pastebin.com/raw.php?i=c7N8f4wU

 

The Following User Says Thank You to MohammadAG For This Useful Post:
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#112
Merging your changes to my branch Mohammad with credit of course.

Now I don't have to make that damned menu! Plus it will now be possible (in my branch anyways) to use a config file or this menu to change user preferences.

BTW, technically my name should removed from the copyright statement, since ossi is the sole copyright holder.

[edit]
Deleted for loop. Don't see why the menu items need to be created 6 times
__________________
aspidites | blog | aspidites@inbox.com

Last edited by aspidites; 2010-05-05 at 16:27.
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#113
good that the menu is already there. I concider merging at least some stuff after I get backspace working (good that clear all is a menu option so backspace can delete 1-2 chars per second when hold) and adding message to conversations when sent. the latter probably takes pretty much time but I have so lousy memory that I want the messages to be saved
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 

The Following User Says Thank You to ossipena For This Useful Post:
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#114
Began implementing a settings dialog. My branch also reads config files (global first, then user), which currently recognizes timeout which sets how long you have to waite before pressing a key sequentially goes to the next character and also horizontal/vertical padding between keys can be set now.
__________________
aspidites | blog | aspidites@inbox.com
 

The Following 3 Users Say Thank You to aspidites For This Useful Post:
Hariainm's Avatar
Posts: 485 | Thanked: 708 times | Joined on Feb 2010 @ Galiza
#115
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!

Last edited by Hariainm; 2010-05-05 at 18:30.
 
Posts: 82 | Thanked: 214 times | Joined on Jan 2010 @ Cape town
#116
I decided to see how easy it would be to write a basic T9 implementation in Python (key word, basic). The answer seems to be very:

Code:
#!/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
It appears to work quite nicely, reading in the words database takes a little bit of time on my Netbook, let alone on the N900. It would probably make sense to convert it to something more sensible (SQLite database, perhaps?)

Anyhow, if you run this on the command line as t9.py <nums> it will return a list of words that can possibly be written using <nums>, so for example, t9.py 62442 will display ['magic'] . t9.py 43 will show ['he', 'id', 'if']

It would be quite nice to make this into a proper library. I was toying with some ideas in my head, like using a bayesian filter to determine the best next word, if multiple are available, based on context, etc, etc. But that's just bells and whistles. I'm going to play around with hacking this into vertsms, and see how far I get
 

The Following 7 Users Say Thank You to cb22 For This Useful Post:
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#117
Currently looking at gtk.Clipboard to add Cut/Copy/Paste to the menu
 

The Following 2 Users Say Thank You to MohammadAG For This Useful Post:
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#118
Got them working but there's one small problem, it seems the text dialog doesn't allow highlighting (except by using shift and the arrows), and I have no idea how to implement that.
 
blwthompson's Avatar
Posts: 97 | Thanked: 8 times | Joined on Dec 2009
#119
VertSMS=AMAZING! Is it at all possbiel to integrate it with Conversations, so like when you rotate without keyboard open then it automatically opens VertSMS. Also If you have the VKB on and try to use this it automatically opens the VKB you have to close that before you can type the message with the Buttons you've supplied. Or turn it off
 

The Following User Says Thank You to blwthompson For This Useful Post:
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#120
Originally Posted by Hariainm View Post
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!
tapping new sms seems to send something to dbus so that is probably possible.

now I only have to figure out how to get a rid from decimals with time.time(). after that I should have correctly formatted string to put into rtcom database. so at least experimental saving of message to conversations is near.
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 

The Following 2 Users Say Thank You to ossipena For This Useful Post:
Reply

Tags
portrait sms, python


 
Forum Jump


All times are GMT. The time now is 05:16.