Class HolesemComsemInputCodec
- All Implemented Interfaces:
HolesemComsemInputCodecConstants
The codec implements the translation of Hole Semantics to normal
dominance graphs described in
Koller et al., EACL 2003. See decode(Reader,DomGraph,NodeLabels)
for details.
An example input for this codec looks as follows:
some(_A,some(_B,some(_C,and(label(_A),and(hole(_B),
and(label(_C),and(some(_A,X,_B),and(pred1(_C,foo,X),leq(_C,_B)))))))))
- Author:
- Alexander Koller
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intNext token.Current token.Generated Token Manager. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with generated Token Manager.HolesemComsemInputCodec(InputStream stream) Constructor with InputStream.HolesemComsemInputCodec(InputStream stream, String encoding) Constructor with InputStream and supplied encodingHolesemComsemInputCodec(Reader stream) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(Reader reader, DomGraph graph, NodeLabels labels) Reads an USR representation from aReader.final voidDisable tracing.final voidEnable tracing.Generate ParseException.final TokenGet the next Token.final TokengetToken(int index) Get the specific Token.final voidInput()final Stringfinal StringvoidReinitialise.voidReInit(InputStream stream) Reinitialise.voidReInit(InputStream stream, String encoding) Reinitialise.voidReinitialise.final voidTerm()final StringVariable()final Stringfinal Stringfinal Stringfinal voidVarlist()Methods inherited from class de.saar.chorus.domgraph.codec.InputCodec
getReaderForSpecification
-
Field Details
-
ERROR_GRAPH_NOT_NORMAL
public static final int ERROR_GRAPH_NOT_NORMAL- See Also:
-
ERROR_GRAPH_NOT_HNC
public static final int ERROR_GRAPH_NOT_HNC- See Also:
-
ERROR_GRAPH_NOT_LEAF_LABELLED
public static final int ERROR_GRAPH_NOT_LEAF_LABELLED- See Also:
-
ERROR_MULTIPLE_PARENTS
public static final int ERROR_MULTIPLE_PARENTS- See Also:
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
HolesemComsemInputCodec
public HolesemComsemInputCodec() -
HolesemComsemInputCodec
Constructor with InputStream. -
HolesemComsemInputCodec
Constructor with InputStream and supplied encoding -
HolesemComsemInputCodec
Constructor. -
HolesemComsemInputCodec
Constructor with generated Token Manager.
-
-
Method Details
-
decode
public void decode(Reader reader, DomGraph graph, NodeLabels labels) throws IOException, ParserException, MalformedDomgraphException Reads an USR representation from aReader. This method converts the USR into an equivalent labelled dominance graph and stores this graph in aDomGraphand the labels in aNodeLabelsobject.This method converts a Hole Semantics USR into a dominance graph. It will then normalise this graph by moving the lower ends of dominance edges up to the respective roots. The resulting graph is guaranteed to be a correct encoding of the original USR (in that the pluggings of the USR correspond to the solved forms of the dominance graph) if the normalised dominance graph is hypernormally connected. If it isn't, then the method throws a
MalformedDomgraphException.- Specified by:
decodein classInputCodec- Parameters:
reader- the reader from which the USR is readgraph- the dominance graph into which the USR is convertedlabels- the node labels of the labelled dominance graph- Throws:
IOException- if an I/O error occurred while reading fromreaderParserException- if a syntactic error occurred while parsing the USRMalformedDomgraphException- if the graph cannot be normalised, or the result is not hypernormally connected.
-
Input
- Throws:
ParseException
-
Term
- Throws:
ParseException
-
LogicalConstant
- Throws:
ParseException
-
PrologAtom
- Throws:
ParseException
-
Varlist
- Throws:
ParseException
-
VariableOrAtom
- Throws:
ParseException
-
Variable
- Throws:
ParseException
-
VariableAsHole
- Throws:
ParseException
-
VariableAsLabel
- Throws:
ParseException
-
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
generateParseException
Generate ParseException. -
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-