2004-07-12, 09:03
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:
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?
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 classthe 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" ;-)
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 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?