Main | News | How it works | Screenshots | Download | Similar programs | Forums | Project Page | Contact
-
<
 
SourceForge
Main
News
How it works
Screenshots
Download
Similar programs
Forums
Project Page
Contact

How it works

This page draws heavily from Matt Peck's original Niall manual.

Niall attempts to learn English, or whatever language you care to teach it, by breaking down the sentences you type in, remembering words, connections between words, the number of times a particular connection has occurred, and start/end sentence markers.

The best was to explain is by example. Suppose the first sentence you typed was:

  • The large green tree was next to the old red shed

Niall would split the sentence into separate words and store any new words it found (Niall's vocabulary is initially blank). It would then store the following information:

  1. The word THE can begin a sentence.
  2. The word LARGE can follow the word THE.
  3. The word GREEN can follow the word LARGE...etc.
  4. The word SHED can end a sentence.

Therefore after analysing this sentence, Niall has learnt 10 new words and knows that the word THE can not only start a sentence by also join onto both LARGE and OLD. This can be expressed as follows:

       /----------<---------------<----------------<----------\
(Start)\-THE --- LARGE -- GREEN -- TREE -- WAS -- NEXT -- TO--/
	    \
	     \--- OLD --- RED --- SHED(End)

Niall then replies to your sentence by picking a random word which can begin the sentence, followed by one of the words which can join onto it selected at random, then one which can join onto it, and so on until the end of sentence marker is reached. Therefore, Niall may reply to your first sentence like so:

  • The old red shed.

The more sentences you type in the more words Niall will learn, the more connections it will make and the more original the replies will seem. Replies must be taken with a pinch of salt since the grammar will be anything but perfect. A semi-intelligent version which attempts to learn grammar too, may appear at a later date.

Niall also remember the number of times a particular connection is made in order to weight the replies and make them sound more realistic. For example, if the second sentence you type is:

  • The old garden gate was blue

Niall now knows that the word THE joins onto the word OLD more often than it joins to LARGE. The table above now looks like this:

       /----------<---------------<----------------<----------\
(Start)\-THE --- LARGE -- GREEN -- TREE -- WAS -- NEXT -- TO -/
	   \\                            /  /
	     === OLD - RED - SHED (End) /  -BLUE (End)
		     \                 /
		      - GARDEN - GATE-/ 

Niall could now reply:

  • The old garden gate was next to the old red shed.

To look at the vocabulary that Niall has built up, select `View Dictionary' from the File menu. If you had typed in the two sentences above, then the output would look like this:

   0: > 2| 1(2)
   1: the 3| 8(2) 2(1)
   2: large 1| 3(1)
   3: green 1| 4(1)
   4: tree 1| 5(1)
   5: was 2| 13(1) 6(1)
   6: next 1| 7(1)
   7: to 1| 1(1)
   8: old 2| 11(1) 9(1)
   9: red 1| 10(1)
  10: shed 1| -1(1)
  11: garden 1| 12(1)
  12: gate 1| 5(1)
  13: blue 1| -1(1)

Word 0 (>) is an empty word which is used to start the sentence. The 2| means that there are 2 possible next words, and the 1(2) means that both those possibilities are word 1 (The). The word -1 (as in 13: blue 1| -1(1)) means end-of-sentence.

-
Web stuff (C) Copyright 2000 Gary Benson. Last updated: 15 September 2000