DescriptionSwype has been updated to make amends for the problems it had the last runaround. The algorithm is now faster and can easily handle larger libraries (the library in this update has 10k words).
I've added comments throughout the code to make everything more understandable. You can easily port this over into your own programs, so long as you're careful with copying over all the functions and the global variables too. This also includes a custom keyboard function—which itself is fairly flexible—because the default keyboard will not work for this.
This may be the only update I give for this, unless I get some JN brainblast sort-o-thing to help me figure out how to introduce the touch-vector observation/analyzation necessary for higher right-return accuracy. InstructionsUse your finger or stylus to Swype across the keyboard.
31 Comment(s)snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsI would suggest against calling this "Swype" since that's a copyrighted name.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesPerhaps you're right. GamerCymreigBeginner ProgrammerI'm just starting out! I'm still trying to grasp the basics.Programming StrengthVideo GamesI like to play video games!HobbiesPokemon Is Awesome!I love Pokemon!Express YourselfCool work! I wonder if someone would do it in another language or maybe built-in a game.spaceturtlesVideo GamesI like to play video games!HobbiesAvatar BlockI didn't change my avatar for 30 days.WebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthJust translate the keyboard's dictionary for another language. You can also impliment it in a game by replacing the INPUT call(s) with calls to this keyboard program.snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsIt would be really interesting if this worked with the built-in keyboard, which is theoretically possible.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!Hobbies*theoretically not possible. Try swiping across that keyboard, perhaps run a little while loop and observe the keyboard output. The keyboard likes to find button repeats and it acts pretty weird because of that. 12Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfYou could use TOUCH, and just treat the keyboard as a background "image"
though at that point I'm not sure what the benefits would be...MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesYeah, that was thought of as well. I had actually wrote some code that automatically mapped out the dimensions of each key by wiggling the stylus across each key horizontally and vertically, observing when the return was either the key or an empty string. The result was an output of data containing each rectangular key's boarder.
It was a fun gimmick, but I think I'm going to try to take this idea somewhere else, so I wrote my own keyboard to supplement. amihartThis is pretty cool concept. I don't know if the library is just small or if it's just buggy but half the words I try don't work. The other half work pretty well though.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesThanks! It might just be buggy. My current working version is pretty stable with 10k words. The most prominent troubles I'm coming across are misreadings. Often "quote" vs "quite", "people" vs "pierre", that kind of thing. SwanBotHalloween 2017 Contest Runner UpI placed 2nd in the SmileBASIC Source Halloween 2017 Contest!Programming ContestIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthFirst YearMy account is over 1 year oldWebsiteI was saddened to see no iteration of the word "cake" in there.
Get me the word cake and I'll thumbs up.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesMy current working version (not yet updated) has cake and cakes. SwanBotHalloween 2017 Contest Runner UpI placed 2nd in the SmileBASIC Source Halloween 2017 Contest!Programming ContestIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthFirst YearMy account is over 1 year oldWebsiteYayMZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesI've made some serious progress with the speed issue with larger libraries. I can't see it being an issue in the future.
I may post an updated version sooner or later. Let's see if I can implement some more features first. spaceturtlesVideo GamesI like to play video games!HobbiesAvatar BlockI didn't change my avatar for 30 days.WebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthNice. I wonder if I can combine this with an SB IDE.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesShhhhh...
I may or may not already be developing thatMidnightDeep SleepHiddenWebsiteI love SwypeGuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthReally neat. I made my own, longer list of words(10,000) and tried it. It was much slower. Anyway, neat concept.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesMuch slower you say? I think I can fix that.
Edit: is your 10k list SORTed?GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAlphabetically, yes.GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthWait, I misunderstood. I honestly don't know what SORT does lol.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesThat may be a factor. I can't see why it would be so slow, because in the initial phase of the algorithm, it trims down your list to a tiny fraction containing phrases with only the beginning and end characters. From 10,000, you'd only expect at most a hundred such entries (if consistency prevails). It really shouldn't be that bad. I'll give it a test with a 10k word dump later on. amihartA sorted list of size 2,500 should only take 12 iterations to find any item in the list, and a sorted list of 10,000 should only take 14 iterations to find any item in the list. Increasing the size of the dictionary should not cause slow down in something like this.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesOkay, so I took a decent shower and it quickly occurred to me that every time you call the Swype function, it runs through the entire library once in a FOR loop. This must be the issue, because running through a string array of 10,000 indexes is consuming.
I could remove that function and add another argument to the Swype function that calls for a kind of metadata which points to where each sub-alphabetical list of entries are. So basically, I wouldn't need to search your entire library to know where "t" starts, I could simply run through it once and store that information.
Hell, if I create a new sorting algorithm that best suits my needs, I'd really be in business, because the next slowest thing is pretty much the same thing as the last problem except it runs through all of the entries it initially pulled from the first run-through, looking for entries sharing the same end-character.
The sorting function would need to sort entries alphabetically only by the first and end characters, disregarding all characters in between.
Yes, such a function would really boost the speed ...MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!Hobbies@amihart
Well, I am performing a check on each element in the array, and I am also pushing information from that check onto a new stack, so it's a little more than just running through the array. amihartIf your array is sorted and you're running through each element, you're doing something wrong. There's always a faster way if the data is sorted. Such as, if you are just doing a single lookup in a list of size 10k, it would take 14 iterations to find any element using a binary search (doing 10k iterations through the whole thing is overkill). Depending on what exactly your algorithm is doing (I haven't looked at it yet so I don't know exactly what you are doing), there will likely be some way you an utilize the fact it's sorted to help you isolate the information you need.YolkaiHead AdminYou should at least only look through the entries that begin with the given initial letter.
Also, I wonder if it would be good to sort entries based on a system that acknowledges keyboard position, though I'm not sure how such a system would be designed. Maybe some kind of irregular constellation. Then it's easier to do the fuzzy matching.
Edit: ignore this, I forgot swype input won't look close to the intended string
MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesActually, acknowledging keyboard position (namely, the positions of the keys) is not a bad idea. For most smaller words, say, "me," you have to trek across the keyboard hitting many keys, which may sometimes render as other words with (unintentionally) more algorithmic "hits" than the short, intended word.
By observing the direction of the Swype relative to the positions of the keys, it may help for determining when the user intends to type a shorter word versus a potential longer one. YolkaiHead AdminMy understanding of the idea with length approximation is to track changes in stroke direction. A sharp change in direction is a high-probability intended key in the approximate area. The problem with this is obviously that there are words where intended letters lie between each other on the arrangement e.g. [w]->[e]->[t] = [w][t]. I'm pretty sure even mobile Swype still has trouble with midpoint key hits.12Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfPerhaps it would be better/easier to track changes in SPEED. In the example "wet", the user might slow down around the E, and any direction change is also going to be a change in speed, too.MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesActually, in my testing phase, I found that to be incorrect. Speed remains relatively constant throughout the swipe (unless you deliberately slow yourself of course, perhaps as a learning user). Searching for changes in direction could add to the success rate of the algorithm. I imagine it would be implemented in a weighted system, where characters which occupied the swipe's change-of-direction would have more weight over other characters present in other potential results (some "turns" could be wider arcs which skew results, so, unlike the beginning and end characters which are given, you can't say for certain a turn lying on a character is definite).
Actually, I think this would be particularly useful for words contained entirely or partially within one key row, ex: "writer, quote, purpose, etc." because those words are the ones the algorithm has most trouble rendering correctly.