readme.doc — Coverdisk 18a← Back to NIALL
NIALL...The Non-Intelligent AMOS Language Learner

I have sectioned the instructions into three parts so you can skip the bits
which do not interest you.  The sections are:

1....What NIALL does.
2....How to Use NIALL.
3....Credits.

VERY IMPORTANT...Read this now!
     Niall was written on an expanded A500.  Because of this the program
contains Hi-Res graphics screens in 4 colours with quick reference
instructions and up to a 3000 word vocabulary with a 120K buffer.  Not
surprisingly this did not work on unexpanded A500's.  Instead of removing
all of the above I left them alone and wrote in clauses which makes the 
unexpanded A500 version look a lot less impressive.  It is, however, still
the same program with the same vocabulary size and string buffer. 
However on an unexpanded machine the Hi-Res screens in 4 colours become
Lo-Res screens in 2 colours, and there are not quick reference instructions.

ALSO: In order to keep the buffer size and vocab size the same,
users with Unexpanded A500's have to TURN OFF ALL EXTERNAL DRIVES or the
program will crash!

One further note to users with expanded A500's or A2000's. If you have the
AMOS package you can load the program and change the buffer size and vocab
size if you feel the values I have set are too restricting.

  Buffer size can be set by altering the first line:
     Set Buffer 120 (Reserve 120K) to any size memory allows.

  Vocab size can be set by altering the second line:
     MNW=3000  (Set MNW to the max number of words you wish.)


WHAT NIALL DOES

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.

The sentences can begin to get original. Well that's basically it for how
it works.  If you have any questions contact me by writing to the address 
at the end of this text.


HOW TO USE NIALL

     This is simplicity itself.  You are given the prompt USER:
Here you can type up to 255 words in any number of sentences, each sentence
must be separated from the next by a full stop.  It is not necessary to
finish your sentence with a full stop if you only type one sentence.
Each sentence of your input will be dealt with one after the other.  It is
perfectly legal to type:

	The cat sat on the mat. The cat was called George.

IMPORTANT: Do NOT put COMMAS in your sentence because they are 
treated just like full stops.

Niall will then reply and you can enter another sentence.

If you just press return without entering anything, Niall will say something
else.  If you just press return when Niall has no vocabulary, the message
"I cannot speak yet!" will be displayed.

At the USER: prompt you can also enter one fo the command words.
All command words are prefixed by a "#".  The command words perform
the following functions:


#LIST....:This function will display on the screen the current
          vocabulary list and list of connections.  The format of
	  the connection string is:
Total no. of connections|Word no.(No. of times connected)..etc  
The word number is displayed to the left of the word during the listing.

#LLIST...:Outputs the same list to the printer. 
	  MAKE SURE THAT YOU HAVE THE BOOT DISC IN THE DRIVE because
 	  printer drivers need to be accessed and if a requester appears
          you will find it hard to close because the mouse pointer is
	  shut down.

#LPRINT..:Toggles continuous output of the sentences you type and 
          Niall's replies to a printer.  Again make sure the boot disk
          is in the drive.

#CORRECT.:If you spell a word incorrectly and have already pressed
          return you can correct by using this command.  You will be asked
          to enter the incorrect spelling and the new word which replaces
          it.
         
#SPEAK...:Toggles the internal speech.  Only Niall's replies are
          spoken. Make sure boot disk is in the drive as the translator
          device is needed and the requester box is difficult to cancel
          when the mouse cursor is shut down.

#FRESH...:This will wipe the current vocabulary.  You will be given
          the "Are you sure?" option before the vocabulary is cleared.

#SAVE....:Saves the current vocab list to disk under any name. A
          file requester will appear.  All files are saved under
          <NAME>.NIALL. If you omit the .NIALL, the program will add
          it for you.

#LOAD....:Loads a previously saved vocab list.  The file requester
          can be used to select the file. An example file is provided
          on the disk and is called EXAMPLE.NIALL.

#QUIT....:A nice way to exit.  You will be given the "Are you sure?"
          option. Note CTRL-C will also work but exit by this method is
          immediate.


That's it.  Have fun, and remember that the more rubbish you type in, the
more you'll get back



CREDITS

All program code and graphics by Matthew Peck in 1990.
Program written using AMOS 1.1, and run using RAMOS.

Niall is based on an idea called DANI (Dynamic Artificial Non-Intelligence)
which was written for the MSX machines and published some years ago in a 
magazine called MSX Computing.  NIALL is completely re-written and contains
none of the original source code found in DANI, but I would like to give
credit to the author of DANI for the inspiration.  However, I have lost the
magazine and do not know the author's name.  If you wrote DANI or know of 
who did, please contact me so that I can put his/her name in the credit list.

Other credits to:
Patrick Fox........Who helped playtest this, and whose major 
                   contribution was helping iron out the bugs, as
                   well as teaching Niall to swear.
Adam Wright........For not stealing the idea and writing his own
                   version, which he very nearly did, and for 
                   playtesting too.
Kevin Tye..........For being a good demo contact and nice guy.
Gary Keogh.........For being a most encouraging and good fun sort of
                   room mate at college.
Francois Lionet....For taking the effort to code AMOS and not do a
                   direct STOS conversion.
Sarah Gould........For being a wonderful, warm and caring girlfriend
                   whenever I need her.


If you have any problems, suggestions, ideas, updates, extra functions,
marvellous dictionaries, complaints, the odd red Ferrari Testarossa you
don't want, or 5 million pounds to give away, then contact me (Mat Peck) at:

                    23 WELBECK AVENUE,
                     BEDGROVE,
                      AYLESBURY,
                       BUCKS,
                        ENGLAND,
                         HP21 9BH.

		AMOS and RAMOS (c) 1990 Mandarin/Jawx
		   NIALL is (c) Matthew Peck 1990
install.niall — Coverdisk 18a

Historical note: these are the original 1991 instructions for building a bootable NIALL floppy disk. They are preserved here for reference — the web port you are using does not need them.

                       How to make a Niall disk

Due to problems with the size of Niall (Non-Intelligent-Amos-Language-
Learner) here is a list of instructions to get this extremely
interesting program working on its own, seperate disk. Of course, you
need a blank disk to do this.
        The proceadure works on all Amigas, though if you have more
than one floppy disk drive it will be considerably faster.

1) Making a copy of Workbench
-----------------------------

First, boot up with your working Workbench disk, and click once on its
icon. Then select the duplicate option from the menu bar at the top of
the screen. Select Ok when prompted to insert the SOURCE disk - you're
making a copy of Workbench, and it's already in the drive.
        When prompted for a TO disk, put in the disk that you want
Niall working on. After a while, you'll see to Workbench icons, one
with the words 'Copy of' in front of the Workbench title. Click on it
once, select the rename option from the top right menu, and press the
DEL key to get rid of the words 'Copy of Workbench', and put in the
word 'Niall' instead so that you don't get confused as to which disk
is which! Don't forgot to press RETURN.

2) Making space on the Niall disk
---------------------------------

Reboot with the Niall disk in the floppy drive. Double click on the
Niall icon, and then double click on the Shell icon. Type:-

cd df0:Utilities
delete #?
cd df0:Prefs
delete #?
cd df0:

        Don't forget to press RETURN after each line (I'll stop saying
that now, but you should keep on pressing RETURN to enter the line
into the computer) and carry on to step 3 straight away.

3) Copying the files from the Coverdisk
---------------------------------------

Type in the following commands, with your Niall disk in the drive:-

makedir ram:Niall
makedir ram:Niall/Amos_system

        Now comes some disk swapping for those who have only one disk
drive. When prompted, put the correct disk into the drive - the
coverdisk or the Niall disk.

copy from "Coverdisk 18a:ramos" to ram:niall
copy from "Coverdisk 18a:niall.amos" to ram:niall
copy from "Coverdisk 18a:example.niall" to ram:niall
copy all from "Coverdisk 18a:amos_system" to ram:niall/amos_system

        Once that's finished (and it only takes a few minutes) there
will be a version of Niall waiting in ram to be transferred to the
Niall disk. Carry on straight to step 4.

4) Copying the files onto the Niall disk
----------------------------------------

Make sure that the Niall disk is in the disk drive, and type:-

copy all from ram:niall to niall:

        All of the files will be automatically copied onto your Niall
disk. It only remains to make it autobooting (necessary for readers
with unexpanded machines - see step 5).

5) Making the Niall disk autobooting
------------------------------------

With the Niall disk still in the drive, type the following:-

delete s/startup-sequence
ed s/startup-sequence

        The computer will display something like "making new file".
Type in the following:-

:ramos niall.amos

        This is the only command that the Niall disk will perform when
it starts up - it will run ramos (the AMOS run time system) and then
load in niall.amos, plus a few other files.

        Finally, to make ed save the new startup sequence, press the
following sequence of keys:-

ESC x RETURN

        After the disk light has gone out, try booting with the Niall
disk in the drive. If you've followed these steps correctly, then it
should all work - I know because I tested them on a single drive,
unexpanded A500.

Finally
-------
        That's all folks! If you would have rather had a simple to use
Niall program that ran straight from the coverdisk, something else
would have had to go. And yes, the effort is worth it - how many
computers have you heard of that attempt to talk in English?


        Pat McDonald
About this web port
This is a port (not an emulation) of NIALL v1.0 by Matthew Peck, published
on Amiga Format Coverdisk 18a (January 1991). The original program states:
"This program is fully Public Domain".

The AMOS BASIC source (NIALL.AMOS) was detokenised and its learning engine,
screens, commands and quirks were re-implemented in JavaScript. The title
banner and instruction-screen artwork are the original IFF images unpacked
from the program's AMOS memory banks. EXAMPLE.NIALL is the original example
dictionary, byte for byte.

Web port notes:
  #SAVE   saves the dictionary in the browser (and downloads a .NIALL file
          in the original AMOS file format).
  #LOAD   loads EXAMPLE.NIALL, a browser-saved dictionary, or an uploaded
          .NIALL file.
  #SPEAK  uses your browser's speech synthesiser in place of the Amiga's
          translator.device + narrator.device.
  #LLIST  opens your browser's print dialog in place of an Amiga printer.
  #LPRINT toggles capture of the conversation; turning it off sends the
          captured text to the print dialog.

Typeface: "TopazPlus a500" from the amigafonts project
(https://github.com/rewtnull/amigafonts), GPL-licensed remake of the
Amiga Topaz system font. See assets/amigafonts_README.txt.