LGames
Class Instance

java.lang.Object
  |
  +--LGames.Instance

public class Instance
extends java.lang.Object

This class implements the instance base used by the CompositionalAgent2 for inducing compositional structures. It stores an expression with its observed meaning.

Copyright (c) 2004 Paul Vogt


Constructor Summary
Instance()
          Empty constructor
Instance(java.lang.String e, IntArray m)
          An instance constructor
 
Method Summary
 IntArray split(java.lang.String e, IntArray m)
          This function investigates how the heard expression e in relation to meaning m can be chunked (hence the name split :-()).
 boolean updateMeanings(int m)
          A function to repair the index of the meanings if another meaning m was removed.
 boolean updateMeanings(IntArray m)
          A function to repair the index of the meanings if an array of meanings m were removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instance

public Instance()
Empty constructor


Instance

public Instance(java.lang.String e,
                IntArray m)
An instance constructor

Parameters:
e - the expression
m - an IntArray pointing to the meanings
Method Detail

updateMeanings

public boolean updateMeanings(int m)
A function to repair the index of the meanings if another meaning m was removed.

Parameters:
m - the meaning that was removed.
Returns:
true if m is one of the meanings in this instance (in which case the instance will be removed). It returns false if all is ok.

updateMeanings

public boolean updateMeanings(IntArray m)
A function to repair the index of the meanings if an array of meanings m were removed.

Parameters:
m - the array of meanings that was removed.
Returns:
true if one of the meanings in m equals one of the meanings in this instance (in which case the instance will be removed). It returns false if all is ok.

split

public IntArray split(java.lang.String e,
                      IntArray m)
This function investigates how the heard expression e in relation to meaning m can be chunked (hence the name split :-()).

Parameters:
e - the expression
m - the meaning
Returns:
an IntArray a that contains the following information: a[0] = 0 alignment first constituent, a[0] = 1 alignement second constituent, a[1] = the position in the string where the chunk can be applied (ie. where the alignment ends or starts), a[2]..a[a.length] the aligning meanings.