Playmaker Forum

PlayMaker News => General Discussion => Topic started by: Kothe on February 24, 2016, 02:58:22 AM

Title: Predictive Text
Post by: Kothe on February 24, 2016, 02:58:22 AM
Hi,
Its possible to develope a "Predictive text" with PlayMaker ?
If it so...How should I start  ?

Thanks
Title: Re: Predictive Text
Post by: Kothe on May 09, 2016, 08:19:52 AM
nope ?

some kind of auto-complete words.
Something to start with....

Thx
Title: Re: Predictive Text
Post by: megmaltese on May 10, 2016, 11:58:40 AM
Why not. The problem is probably in the performance. But I wonder if you could ever be able to code such a thing when you don't even know if it's possible...
Title: Re: Predictive Text
Post by: dudebxl on May 10, 2016, 12:40:12 PM
script= http://stackoverflow.com/questions/26422261/making-a-predictive-text-algorithm-go-faster

Re-build this script (for example or search for another if needed) using playmaker (opinion: copy/paste script and use playmaker to run the script and extract the result would be the easiest method).
Title: Re: Predictive Text
Post by: Kothe on May 10, 2016, 02:12:57 PM
Why not. The problem is probably in the performance. But I wonder if you could ever be able to code such a thing when you don't even know if it's possible...

Sure Im not capable to code it. I have no idea. I just get into scripts methods with playmaker actions. I thought some kind of array text, to compare strings,in a dictionary like "100000 word-list " txt on the link.

dudebxl.
Its so crazy for me to modify this script for my use, even I dont know wich one is the good one. :S  I think is real complex for my very low programer skills.


No easy PlayMaker way ?  Like this...to have an array of strings and check them while seting the imput text.
Title: Re: Predictive Text
Post by: megmaltese on May 10, 2016, 02:40:33 PM
Those 100000 words are probably the problem: performance.
But I'm no such expert to be sure.
Title: Re: Predictive Text
Post by: dudebxl on May 10, 2016, 03:46:05 PM
Well you could download the text as a file and load into into an array then use string contain fast or string compare fast (from ecosystem as they have low memory usage) and take if from there..
Title: Re: Predictive Text
Post by: Kothe on May 11, 2016, 03:10:08 AM
Well you could download the text as a file and load into into an array then use string contain fast or string compare fast (from ecosystem as they have low memory usage) and take if from there..

That makes sense to me.
I have been searching but not found... how to load the file into an array?

Thankyou very much, I see somelight on this now.
Title: Re: Predictive Text
Post by: dudebxl on May 11, 2016, 06:49:50 AM
SplitTextToArrayList
Title: Re: Predictive Text
Post by: Kothe on May 12, 2016, 11:08:30 AM
Now on the PM Array List Proxy (Script) I can see there are 109583 "Items"
Thats cool, the txt  has been splited to an Array List. But I cant use directly "string contain fast"  I have to get first from the array list with Array List Get p.e. But it get per At Index, so only checks one item per call.
How can I make to compare automatically the input text with all the items ?

Thanks and sorry for a stop in each step.
Title: Re: Predictive Text
Post by: dudebxl on May 13, 2016, 11:44:46 AM
Hi,

you will need to build you own internal 'system' with playmaker. for example, start with the full list, he types a or A, get all the words starting with A (or split the list into starting letter - so one array for a, another for b, etc, might be quicker) by using string length then string get left and put into another array, then he types r, get all the words that start with ar from last array into another array so now you should have only the words starting with ar the if he types e get all the words in the last list that has are,  something like that. everything will have to be dynamic.. or use the string contain, does it contain ar.. etc and you should use 'array get next' to loop through the list. i have never done something like this so you will need to figure it out. In the C# script he uses a different method by building a tree structure (finding the shortest path) but you should research on the net for a good method or algorithm.
Title: Re: Predictive Text
Post by: ghudson on June 16, 2016, 03:38:17 AM
You could add a complete list which would be easily available.I don't think its necessary though :)