|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsl.SL0Codec
The codec class for the SL0 language. This class
implements the Codec interface and allows converting
back and forth between strings and frames, according to the SL0
grammar.
WARNING: When creating the Ontology, notice that this SL0Parser
returns a Java object of type Long everytime it parses an
integer, and
it returns a Java object of type Double everytime it parses a
float.
Therefore, the slots of the frames in the ontology must be of type,
respectively, Ontology.LONG_TYPE and
Ontology.DOUBLE_TYPE, otherwise you get an
IllegalArgumentException.
Notice also that the following convention is needed for all the frames representing actions:
the name of the frame must be NAME_OF_ACTION_FRAME,
and the name of the two slots representing actor and the action term
must be, respectively, NAME_OF_ACTOR_SLOT and
NAME_OF_ACTION_SLOT.
| Field Summary | |
private SL0Encoder |
encoder
|
static java.lang.String |
NAME
A symbolic constant, containing the name of this language. |
static java.lang.String |
NAME_OF_ACTION_FRAME
Symbolic constant identifying a frame representing an action |
static java.lang.String |
NAME_OF_ACTION_SLOT
Symbolic constant identifying a slot representing an action |
static java.lang.String |
NAME_OF_ACTOR_SLOT
Symbolic constant identifying a slot representing an actor |
private SL0Parser |
parser
|
| Constructor Summary | |
SL0Codec()
|
|
| Method Summary | |
java.util.List |
decode(java.lang.String s,
Ontology o)
Decodes a given String, according to the given
Content Language and obtains a t-uple of Frame objects.
|
java.lang.String |
encode(java.util.List v,
Ontology o)
Encodes a t-uple of Frame objects into a Java
String, according to this Content Language and Ontology by
looking up the given ontology for the role played by symbols
(i.e. whether they are concepts, actions or predicates). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String NAME
public static java.lang.String NAME_OF_ACTION_FRAME
public static java.lang.String NAME_OF_ACTOR_SLOT
public static java.lang.String NAME_OF_ACTION_SLOT
private SL0Parser parser
private SL0Encoder encoder
| Constructor Detail |
public SL0Codec()
| Method Detail |
public java.lang.String encode(java.util.List v,
Ontology o)
CodecFrame objects into a Java
String, according to this Content Language and Ontology by
looking up the given ontology for the role played by symbols
(i.e. whether they are concepts, actions or predicates).
encode in interface Codeco - The ontology to use to lookup the roles for the various
symbols.
public java.util.List decode(java.lang.String s,
Ontology o)
throws CodecException
CodecString, according to the given
Content Language and obtains a t-uple of Frame objects.
This method can use the given ontology to distinguish among the different
kinds of roles a symbol can play (i.e. Concept vs. Action
vs. Predicate).
decode in interface Codecs - A string containing the representation of an ontological
element, encoded according to this content language.o - The ontology to use to lookup the roles for the various
symbols.
CodecException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||