[prev] [index] [next]

PHP Version #1

Comments on this implementation:
  • follows the abstract algorithm closely
  • uses preg_split to break input stream into words
  • "w1 w2" used as key for hash table
  • each entry in table is an array of suffixes (words)
  • for generation phase ...
    • find suffix array using current w1 w2
    • choose suffix by picking random element in array