py9 dictionary
#1
the reason why i've not written a chat/messenger program for the xbox is because although the virtual keyboard is well handy, it's slow and annoying to use from the remote.

so... i've made this nice predictive text dictionary and sms style input class for any python programmers that want to use it.

to use it:
Quote:# create a py9input class
x = py9input("en-br.dict","default text")

# send it keys as they are pressed
# * "0123456789" - numbers
# * "udlr" - navigation
# * "s" - set mode),
x.sendkeys("03825lll")

# put it's text in to a label on your screen
print py9input.gettext()

# get the actual string
print x.text()
the contents of the text box are controlled by the class, (navigation, word editing, saving words to the db, input mode changes, etc). people that hate predictive text will be pleased to hear it has the old style phone input too. i've tried to make it feel like a phone (apart from when editing a word), so feedback in that department is specially welcomed ("lemme kno wot u fink" ;-)

the only down side is the size of the databases (130,000 words = 3.6mb, creating one takes about 120mb of ram).

run demo.py for a demo, you'll need lots of ram because it'll create the database first time it's run. if you don't have the ram you can get my dictionary here


version: 0.1

download: here
latest code: here

todo:
- sentance case
- numerical only option
- save list of valid keys to database
- suggestions?
Reply
#2
hi !
i'm very surprised taht nobody answered to you !
i think it is the big need to use this kind of class inside xbmc. keyboard is so boring !!

go on in that way. it should be very intersting. just imagine all the newest scripts we could do with this class ??

i tried it but i only succeeded in making it works in a dos window. is it possible to implement it inside xbmc ?

thanks for that
see ya
Reply
#3
i think currently it's intended as a tool available to other projects that need it. i suppose you could write a wrapper xbmc.py script that automatically called this (with an appropriate gui) whenever a script requested xbmc.keyboard, and passed all the regular xbmc requests on to the built-in library.

maybe....

but mostly i think it's available for future scripts, to use bitplane's class instead of xbmc's keyboard.

or, of course, the xbmc devs could take note of it and incorporate it as an optional alternative keyboard. :-)
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#4
thanks for the responses, i was hoping people were gobsmacked rather than not interested Wink

alex is right, but adding a py9input to a current script should be easy enough - a script writer would need to convert the remote's keycodes to chars to send to the control, and set a label to the result of py9input.gettext() after each keypress. easy enough, but the real question is how many script devs have had nokias, used sms and t9 enough to want it in their programs?

i've still not got my own working xbox (don't ever give a programmer a soldering iron!Wink, so my first priority is to help alex with the emulator scripts. after that, i think i might have a go at a msn messenger script, but i've got to finish a couple of others first (subtitle downloader, web teletext viewer).

i've also been thinking about possible uses for the dictionary, other than language specific text input. most of them would need to make a blank dictionaries and open more than one at a time (you can't yet) but here's some ideas for the future:

- a dictionary of every town and city in the world, for the location input in my weather. overkill, but boastworthy.

- irc dictionaries - one for language, one for commands, plus one updated on the fly with people's nicknames and channel names.. bring on the chat/fservers/xdcc!

- a dictionary that learns all known email addresses for the email script.

- a python editor for the xbox! yey! programmer's dictionary could be created on the fly from the dir() command so it knows all possible functions, classes, globals. it would need to swap back to the current language when quotes are opened though. sounds like a challenge!

- a shell! a dictionary for commands, dictionary for current dir's file list. excessively geeky and totally uncalled for, but i want one!
Reply
#5
i wanted to make my own first python script, and at the same time i was reading your post. so i decided to make a sms style writer. maybe it will be the same as your but i promess i will not copy. my goal is to create my script alone !!!! my sms keyboard will not be a t9 one. just a push once for 1 letter
thank you for your inspiration (the idea)
see ya !
Reply
#6
another alex!? we're gonna have to give you all numbers or something!
anyway, welcome to the magical mystery tour ualex[2] - feel free to use any of my source, it's not considered cheating if you read and understand any snippets that you do use :-)
Reply
#7
thankyou for that !

see ya !
Reply

Logout Mark Read Team Forum Stats Members Help
py9 dictionary0