ch.uzh.ifi.attempto.acewiki.gf
Class GFGrammar

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.gf.GFGrammar

public class GFGrammar
extends java.lang.Object

This class wraps GF features of a particular GF grammar.

Author:
Tobias Kuhn

Constructor Summary
GFGrammar(java.lang.String pgfFile, java.lang.String serializationLanguage)
          Creates a new GF grammar object.
 
Method Summary
 org.grammaticalframework.parser.ParseState deserialize(java.lang.String serialized)
          Deserializes a serialized representation into a parse state.
 java.lang.String linearizeAsString(org.grammaticalframework.parser.ParseState parseState, java.lang.String language)
          Linearizes a parse state in the given language.
 java.util.List<java.lang.String> linearizeAsTokens(org.grammaticalframework.parser.ParseState parseState, java.lang.String language)
          Linearizes a parse state in the given language.
 org.grammaticalframework.parser.ParseState parse(java.lang.String[] tokens, java.lang.String language)
          Parses the given tokens in the given language.
 org.grammaticalframework.parser.ParseState parse(java.lang.String text, java.lang.String language)
          Parses the given text in the given language.
 java.lang.String serialize(org.grammaticalframework.parser.ParseState parseState)
          Serializes a given parse state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GFGrammar

public GFGrammar(java.lang.String pgfFile,
                 java.lang.String serializationLanguage)
Creates a new GF grammar object.

Parameters:
pgfFile - Path and name of the pgf file.
serializationLanguage - The language used for serialization.
Method Detail

parse

public org.grammaticalframework.parser.ParseState parse(java.lang.String text,
                                                        java.lang.String language)
Parses the given text in the given language.

Parameters:
text - The text.
language - The language.
Returns:
The parse result.

parse

public org.grammaticalframework.parser.ParseState parse(java.lang.String[] tokens,
                                                        java.lang.String language)
Parses the given tokens in the given language.

Parameters:
tokens - The tokens.
language - The language.
Returns:
The parse result.

deserialize

public org.grammaticalframework.parser.ParseState deserialize(java.lang.String serialized)
Deserializes a serialized representation into a parse state.

Parameters:
serialized - The serialized representation
Returns:
The parse state.

linearizeAsString

public java.lang.String linearizeAsString(org.grammaticalframework.parser.ParseState parseState,
                                          java.lang.String language)
Linearizes a parse state in the given language.

Parameters:
parseState - The parse state.
language - The language.
Returns:
The linearization as a string.

linearizeAsTokens

public java.util.List<java.lang.String> linearizeAsTokens(org.grammaticalframework.parser.ParseState parseState,
                                                          java.lang.String language)
Linearizes a parse state in the given language.

Parameters:
parseState - The parse state.
language - The language.
Returns:
The linearization as a list of tokens.

serialize

public java.lang.String serialize(org.grammaticalframework.parser.ParseState parseState)
Serializes a given parse state.

Parameters:
parseState - The parse state.
Returns:
The serialization.


Copyright 2008-2012, AceWiki developers