playMaker

Author Topic: Predictive Text  (Read 5506 times)

Kothe

  • Junior Playmaker
  • **
  • Posts: 71
Predictive Text
« on: February 24, 2016, 04:58:22 AM »
Hi,
Its possible to develope a "Predictive text" with PlayMaker ?
If it so...How should I start  ?

Thanks

Kothe

  • Junior Playmaker
  • **
  • Posts: 71
Re: Predictive Text
« Reply #1 on: May 09, 2016, 11:19:52 AM »
nope ?

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

Thx

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Predictive Text
« Reply #2 on: May 10, 2016, 02:58:40 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...

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Predictive Text
« Reply #3 on: May 10, 2016, 03: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).

Kothe

  • Junior Playmaker
  • **
  • Posts: 71
Re: Predictive Text
« Reply #4 on: May 10, 2016, 05: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.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Predictive Text
« Reply #5 on: May 10, 2016, 05:40:33 PM »
Those 100000 words are probably the problem: performance.
But I'm no such expert to be sure.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Predictive Text
« Reply #6 on: May 10, 2016, 06: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..

Kothe

  • Junior Playmaker
  • **
  • Posts: 71
Re: Predictive Text
« Reply #7 on: May 11, 2016, 06: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.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Predictive Text
« Reply #8 on: May 11, 2016, 09:49:50 AM »
SplitTextToArrayList

Kothe

  • Junior Playmaker
  • **
  • Posts: 71
Re: Predictive Text
« Reply #9 on: May 12, 2016, 02:08:30 PM »
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.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Predictive Text
« Reply #10 on: May 13, 2016, 02:44:46 PM »
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.

ghudson

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Predictive Text
« Reply #11 on: June 16, 2016, 06:38:17 AM »
You could add a complete list which would be easily available.I don't think its necessary though :)