|
 |
|
08-24-2004, 02:27 AM
|
#16
|
|
Raw Wave
Join Date: Aug 2003
Location: Essex, England
Posts: 2,224
|
Dominik,
I will be making it fully customisable using an ini file, so once I've done that I shall send it back to you (so you can do some work on T9 stuff if you want  )
Garry
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
08-24-2004, 01:35 PM
|
#17
|
|
Newbie
Join Date: Aug 2004
Location: Reading, UK
Posts: 38
|
Yeah, and i think that would be easier to do in basic than trees are. Though i havent used vb for quite some time
|
|
|
08-26-2004, 09:05 AM
|
#18
|
|
Variable Bitrate
Join Date: Jun 2004
Location: Sydney, Australia
Posts: 273
|
Predictive text works!
just sorting out some details before i release the program (its currently using an MSSQL Database, but this might be hard to distribute). The way it works is quite simple really; its the Database which does most of the work - Each word is actually broken up into the letters it comprises of.
For example: the words hello & World are stored as
Word| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
----------------------------------------
hello | 4 | 3 | 5 | 5 | 6 |NULL|NULL|NULL|
World| 9 | 6 | 7 | 5 | 3 |NULL|NULL|NULL|
So when i press 4, i do an SQL Query for all words that have 4 as the first keypress. Then when i press 3, i search for all words that have 4 as the first letter and 3 as the second letter. Speed is not an issue on the MSSQL database, but i need to try an Access DB
(Part of my program also loads words from a Text file, inserting records into the DB with the letters mapped out)
Will post program in the next few days...
|
|
|
08-26-2004, 09:33 AM
|
#19
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Posts: 2,960
|
You could make this thing not require cutting and pasting and have it enter directly into any textbox or convert any number presses or combination of number presses into letters for every running program by creating a global windows hook. See http://msdn.microsoft.com/library/de...dowshookex.asp You could use the numlock or scrolllock status to determine when numbers should be converted to letters and when they should simply pass through as numbers. With the hook, you would just change the data as it is recieved from the keyboard before it ever gets to the application. I wrote an application before that converted any keyboard key you pressed into a single phrase, I'll post it later if I can find it. It's in C though. I know you can do a application wide hook in VB, not sure about a global one though.
|
|
|
08-26-2004, 09:43 AM
|
#20
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Posts: 2,960
|
Quote: Originally Posted by Dominik
just sorting out some details before i release the program (its currently using an MSSQL Database, but this might be hard to distribute)
Why are you even using a database? You have a relatively small dataset, the whole english language takes up the same space as a good size bitmap would. You could simply load the whole dictionary into memory from a text file or something, it shoudl only consume a few megs at most and be far faster then the overhead of a database. When loading it in, you simply convert the alphabetic form into the numeric form and store it along with it.
|
|
|
08-26-2004, 09:48 AM
|
#21
|
|
Variable Bitrate
Join Date: Jun 2004
Location: Sydney, Australia
Posts: 273
|
That would be awesome... But would take a bit to write that... Might be enough motivation to rewrite the app in C++ though.
That might be a future project though.. Or maybe Garry will take your advice and integrate it into AIMEE??
|
|
|
08-26-2004, 09:59 AM
|
#22
|
|
Raw Wave
Join Date: Aug 2003
Location: Essex, England
Posts: 2,224
|
I've already got the basics of the application in AIMEE, no cutting and pasting, it goes into whichever specific text box you want. For GPS applications (which is where it will really be useful), I am going to use AIMEE for entering destination, rather than using whatever application you're using (providing it provides an SDK to allow me to get the list of streets/cities.
It currently will work if the numlock is on, and if it's not, then those keys will (when I code it in to the rest of the application) be able to be used to control AIMEE. Therefore, you can have complete control over AIMEE and entering text
Garry
|
|
|
08-26-2004, 10:50 AM
|
#23
|
|
Newbie
Join Date: Aug 2004
Location: Reading, UK
Posts: 38
|
I finish resit exams on tuesday and I'll have a go with my tree structure idea, it'll give me something to do and if it works well all the better!
I'll have a go in C# and I'll try to write a VB module once I've got it working for you dominic but my vb is a bit rusty I'm afraid so it might take a while longer
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
08-26-2004, 05:54 PM
|
#24
|
|
Raw Wave
Join Date: Aug 2003
Location: Essex, England
Posts: 2,224
|
OK, I got a 44mb JET DB built with 354,982 words in it, using Dominik's theory with 15 characters, (parsed the text file in about 500 seconds on my P4 3.2GHz laptop), gonna now try to incorporate it into this source code and will report findings
Garry
|
|
|
08-26-2004, 06:52 PM
|
#25
|
|
Variable Bitrate
Join Date: Jun 2004
Location: Sydney, Australia
Posts: 273
|
Woah! 354,000 words! I have 158,000 and there are alot of junk words in that. I need to trim it down to common words only (otherwise it is tedious going through all the redundant words...)
I'm gonna try interfacing into MS Office's Spell Checker when importing words, so that the DB only gets real words for starters (i have stuff like aaaaaaab etc).
Also, since you seem to be doing it fine on your own; i had to cater for the scenario that the word is longer than the number of letters i had available in my DB (could be a custom word with 30 letters!). In that case i find all words that match the number combinations; and then prune the list as each subsequent letter is added.
I'll continue with my app though (even though i'm sure yours will kick ***!); coz it could be useful for others who dont use AIMEE, or cant wait
|
|
|
08-26-2004, 07:01 PM
|
#26
|
|
Variable Bitrate
Join Date: Jun 2004
Location: Sydney, Australia
Posts: 273
|
god _of_cpu, that might be viable (word list only takes up 1.3mb), but its the time that it would take to load it into memory that would hurt
Usually this app will only be called when it is needed, so it needs to start up quickly. In AIMEE this might be feasible though...
Lastly i'm not sure if this would make a difference, but i have indexed the words table to make searches quicker. Not sure if it would be slower searching sequentially through an array in memory (how else would you store it in memory?)
|
|
|
08-26-2004, 07:10 PM
|
#27
|
|
Variable Bitrate
Join Date: Jun 2004
Location: San Antonio
Posts: 233
|
|
|
|
08-26-2004, 08:15 PM
|
#28
|
|
Raw Wave
Join Date: Aug 2003
Location: Essex, England
Posts: 2,224
|
cheerio,
I found that site, and downloaded the database they have...it's missing so many common things like "i" and "a" and "hi" and "hit" (and those are just the ones i tried).
All I need is a good word list, and the code i've got is working BRILLIANTLY. If a word is more than 15 characters, due to the english language it's a damn good chance that you'll find it by the time you reach 15 characters, or if not then there will only be 1-2 more options
On my laptop, it takes about a second to query and return the necessary rows from the 355k row database.
The biggest hurdle here is having a good word list to start with
Garry
|
|
|
08-26-2004, 08:35 PM
|
#29
|
|
Raw Wave
Join Date: Aug 2003
Location: Essex, England
Posts: 2,224
|
Just been looking for the past 20 mins and i've not found any decent dictionary yet, i'm calling it a night (it's 1:35am here), if anyone has a half decent dictionary file, let me know where, and I'll give it a try tomorrow, and report back
Garry
|
|
|
08-26-2004, 08:58 PM
|
#30
|
|
Variable Bitrate
Join Date: Jun 2004
Location: San Antonio
Posts: 233
|
Quote: Originally Posted by Confused
cheerio,
I found that site, and downloaded the database they have...it's missing so many common things like "i" and "a" and "hi" and "hit" (and those are just the ones i tried).
All I need is a good word list, and the code i've got is working BRILLIANTLY. If a word is more than 15 characters, due to the english language it's a damn good chance that you'll find it by the time you reach 15 characters, or if not then there will only be 1-2 more options
On my laptop, it takes about a second to query and return the necessary rows from the 355k row database.
The biggest hurdle here is having a good word list to start with
Garry
ok maby i dunno what your talking about. This is t-9 predictive text. Meaning you press 1 key, 1 time, for each letter. why would you need 'i' and 'a'. I ASSUME T-9 goes by grammar to predict the next word, well not really grammar, buf if the word before it is some sort of word it can determine what kind the next word will be. understand?
http://www.t9.com/learn.html
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:27 PM.
| |