csli.util
Class FeatureStructure

java.lang.Object
  extended by csli.util.FeatureStructure

public class FeatureStructure
extends Object

Author:
alexgru Jan 15, 2004: I'm now co-opting this to be a not-very-thin layer between oaa data types and lf data types so it can actually do something useful. Essentially, I'll be more more or less replicating the capabilities of the AAA framework for feature structures

Constructor Summary
FeatureStructure()
           
FeatureStructure(com.sri.oaa2.icl.IclTerm fs)
          should be of the form [ key: value, ...] which is equivalent to [ :(key,value) , ...]
 
Method Summary
 Object get(String feature)
          Returns either another LFFeatureStructure of an ICLTerm -alexgru Jan 15, 2004
 Set getFeatures()
           
 FeatureStructure getFS(String feature)
          convenience when you know it's a FS; will get a class cast exception if you're wrong
 com.sri.oaa2.icl.IclTerm getTerm(String feature)
          convenience to get a term; or if it's a fs then it's converted to a term first
static void main(String[] args)
          test main -alexgru Feb 26, 2004
 void put(String feature, Object o)
          This will throw a runtime exception if this isn't a feature structure of a iclterm
 void putFS(String feature, FeatureStructure childFS)
           
 void putTerm(String feature, com.sri.oaa2.icl.IclTerm term)
           
 void putTerm(String feature, String iclStr)
           
 com.sri.oaa2.icl.IclTerm toIcl()
          equivalent to return toIcl(false) -alexgru Jan 21, 2004
 com.sri.oaa2.icl.IclTerm toIcl(boolean addTail)
          return an ICL version of the feature structure
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureStructure

public FeatureStructure()

FeatureStructure

public FeatureStructure(com.sri.oaa2.icl.IclTerm fs)
should be of the form [ key: value, ...] which is equivalent to [ :(key,value) , ...]

Parameters:
fs -
Method Detail

main

public static void main(String[] args)
                 throws antlr_oaa.RecognitionException,
                        antlr_oaa.TokenStreamException
test main -alexgru Feb 26, 2004

Throws:
antlr_oaa.RecognitionException
antlr_oaa.TokenStreamException

get

public Object get(String feature)
Returns either another LFFeatureStructure of an ICLTerm -alexgru Jan 15, 2004


getFeatures

public Set getFeatures()

getFS

public FeatureStructure getFS(String feature)
convenience when you know it's a FS; will get a class cast exception if you're wrong

Parameters:
feature -
Returns:
-alexgru Jan 15, 2004

getTerm

public com.sri.oaa2.icl.IclTerm getTerm(String feature)
convenience to get a term; or if it's a fs then it's converted to a term first

Parameters:
feature -
Returns:
-alexgru Jan 15, 2004

put

public void put(String feature,
                Object o)
This will throw a runtime exception if this isn't a feature structure of a iclterm

Parameters:
feature -
o - -alexgru Feb 16, 2004

putFS

public void putFS(String feature,
                  FeatureStructure childFS)

putTerm

public void putTerm(String feature,
                    com.sri.oaa2.icl.IclTerm term)

putTerm

public void putTerm(String feature,
                    String iclStr)

toIcl

public com.sri.oaa2.icl.IclTerm toIcl()
equivalent to return toIcl(false) -alexgru Jan 21, 2004


toIcl

public com.sri.oaa2.icl.IclTerm toIcl(boolean addTail)
return an ICL version of the feature structure

Parameters:
addTail - if this is true, then produce a feature structure with a tail e.g. [a:b, c:d | _] if it's false, then don't include a tail, e.g. [a:b, c:d]
Returns:
The constructed ICL term -alexgru Jan 21, 2004

toString

public String toString()
Overrides:
toString in class Object