Class Phrase

java.lang.Object
  |
  +--Constituent
        |
        +--Phrase
All Implemented Interfaces:
java.io.Serializable

public class Phrase
extends Constituent

A phrase is a list of constituents, the syntactic elements of a sentence.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class Constituent
beginPos, endPos, held, NO_PROLOG, prologName, role, WILDCARD
 
Constructor Summary
Phrase(Constituent[] newConstituents, Role newRole, int begin, int end, PrologEngine engine)
          Create a phrase with the given role and constituents.
 
Method Summary
 java.util.LinkedList beginningsList()
          Get a list backed by the beginnings list.
 boolean consistent()
          Return if this phrase is consistent semantically.
 Constituent firstRaisedAux()
          Deprecated. because it's a HACK.
 java.lang.String getText()
          Get the string representation of the constituents of this constituent.
 java.lang.String interpretation()
          Interpret this constituent.
 
Methods inherited from class Constituent
beginning, checkHeld, end, held, inCat, length, prologName, prologName, prologStatements, syntax, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Phrase

public Phrase(Constituent[] newConstituents,
              Role newRole,
              int begin,
              int end,
              PrologEngine engine)
Create a phrase with the given role and constituents.

Parameters:
newConstituents - the constituents of this phrase.
newRole - the role of this phrase.
begin - the beginning.
end - the end.
engine - the prolog engine, used to find if this is held or not.
Method Detail

getText

public java.lang.String getText()
Get the string representation of the constituents of this constituent.

Specified by:
getText in class Constituent
Returns:
the string.

beginningsList

public java.util.LinkedList beginningsList()
Get a list backed by the beginnings list.

Specified by:
beginningsList in class Constituent
Returns:
a list of Integers.

consistent

public boolean consistent()
Return if this phrase is consistent semantically. Uses results of prolog query made at creation time.

Returns:
true if the phrase is good, false if it's not.

interpretation

public java.lang.String interpretation()
Interpret this constituent.

Specified by:
interpretation in class Constituent
Returns:
the interpretation in prolog of this constituent.

firstRaisedAux

public Constituent firstRaisedAux()
Deprecated. because it's a HACK.

Finds the first object of type aux or V with a held mark set.

Returns:
that object or null.