There are three tables in a database, these are

  1. a dictionary of words
  2. a list of groups of three words
  3. a list of frequencies of the three word groups

The tables are populated by reading loads of estate agent guff that has been screenscraped using the property-bee.com toolbar for Firefox. The groups of three words are scanned through each sentence one word at a time, for example a four word sentence would consist of two groups. The number of times these groups are seen throughout all the text is then counted in the third frequency table.

On the web page after picking the first word of a sentence the most probably words are displayed in order of probability and inserted into the sentence when you click on them. This is done using Jquery magic.

Changes:
		
29 Aug 2008:  	Added cache for first menu and loading indicator, removed jquery UI related stuff to reduce size

28 Aug 2008:  	First release with PHP+PDO, behind the scenes something 
		akin to a megahal brain creator parses a text file to create db.
		
27 Aug 2007:  	Read source code of megahal and extracted ideas from it, 
		implemented the ideas in MySQL innodb schema.