jade.lang
Interface Codec
- All Known Implementing Classes:
- SL0Codec
- public abstract interface Codec
Interface for Content Language encoders/decoders. This interface
declares two methods that must convert between text and frame
representations according to a specific content language.
- Author:
- Giovanni Rimassa - Universita` di Parma
|
Inner Class Summary |
static interface |
Codec.CodecException
This exception is thrown when some problem occurs in the concrete parsing
subsystem accessed through this interface. |
|
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. |
encode
public 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).
- Parameters:
f - The List of frames to encode as a t-uple.o - The ontology to use to lookup the roles for the various
symbols.- Returns:
- A Java string, representing the given frame according to
this content language.
decode
public java.util.List decode(java.lang.String s,
Ontology o)
throws Codec.CodecException
- Decodes a given
String, 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).
- Parameters:
s - 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.- Returns:
- A List of frame, representing the given ontological elements.