### operator: predict

```    description:
predict[op] seq
predict[op, n] seq
given an input sequence, predict what is next
optionally, specify the max sequence length you want returned

examples:
-- learn some short simple sequences:
seq |count> => |1> . |2> . |3> . |4> . |5> . |6> . |7> . |8> . |9> . |10>
seq |fib> => |1> . |1> . |2> . |3> . |5> . |8> . |13>
seq |fact> => |1> . |2> . |6> . |24> . |120>
seq |primes> => |2> . |3> . |5> . |7> . |11> . |13> . |17> . |19> . |23>

-- given the sequence 2 . 5 predict the sequences:
predict[seq] (|2> . |5>)
1.0     count   |6> . |7> . |8> . |9> . |10>
1.0     fib     |8> . |13>
1.0     primes  |7> . |11> . |13> . |17> . |19> . |23>
|count: 6 . 7 . 8 . 9 . 10> + |fib: 8 . 13> + |primes: 7 . 11 . 13 . 17 . 19 . 23>

-- again, given the sequence 2 . 5 predict the next 3 elements:
predict[seq, 3] (|2> . |5>)
1.0     count   |6> . |7> . |8>
1.0     fib     |8> . |13>
1.0     primes  |7> . |11> . |13>
|count: 6 . 7 . 8> + |fib: 8 . 13> + |primes: 7 . 11 . 13>

-- use extract-category to predict the names of the sequences:
extract-category predict[seq] (|2> . |5> . |7>)
1.0     count   |8> . |9> . |10>
1.0     primes  |11> . |13> . |17> . |19> . |23>
|count> + |primes>

-- use extract-value to predict just the sequences, with the names removed:
extract-value predict[seq] (|2> . |5> . |7>)
1.0     count   |8> . |9> . |10>
1.0     primes  |11> . |13> . |17> . |19> . |23>
|8 . 9 . 10> + |11 . 13 . 17 . 19 . 23>

-- given the sequence 2 . 5 . 7 predict the next most likely value:
extract-value predict[seq, 1] (|2> . |5> . |7>)
1.0     count   |8>
1.0     primes  |11>
|8> + |11>

-- learn some simple sentences:
sentence |dog 1> => ssplit[" "] |the dog wants food>
sentence |dog 2> => ssplit[" "] |the dog chased the ball>
sentence |cat 1> => ssplit[" "] |a cat sat on the mat>

-- given a word, predict what word follows:
extract-value predict[sentence, 1] |the>
1.0     dog 1   |dog>
1.0     dog 2   |dog>
1.0     dog 2   |ball>
1.0     cat 1   |mat>
2|dog> + |ball> + |mat>

extract-value predict[sentence, 1] |a>
1.0     cat 1   |cat>
|cat>

extract-value predict[sentence] ssplit[" "] |the dog>
1.0     dog 1   |wants> . |food>
1.0     dog 2   |chased> . |the> . |ball>
|wants . food> + |chased . the . ball>