JTP API Documentation

jtp.fol.kif
Class KIF2CNF

java.lang.Object
  |
  +--jtp.fol.kif.KIF2CNF
All Implemented Interfaces:
FirstOrderLogicParser

public class KIF2CNF
extends Object
implements FirstOrderLogicParser

KIF2CNF.java Created: Mon Jun 26 05:49:35 2000


Constructor Summary
KIF2CNF()
           
 
Method Summary
 void addNamespaceMapping(String from, String to)
          creates mapping between two namespaces, Whenever the parser encounters in the input a symbol in the "from" namespace, it will replace it with the corresponding symbol in the "to" namespace.
static FirstOrderLogicTranslator createTranslator()
           
 boolean getDefaultUpperCase()
           
 String getLanguage()
          returns the name of the language of this parser.
 Map getNamespaceMap()
          returns an unmodifyable namespace replacement map.
 boolean getPolarity()
          A logical text is parsed in different ways depending on whether it is interpreted as an assertion or a query.
 boolean isCaseSensitiveSymbols()
           
 ClauseIterator parse(Reader rdr)
          parses the contents extracted from the given Reader
 ClauseIterator parse(Reader rdr, URL url)
          parses the contents extracted from the given Reader.
 ClauseIterator parse(URL url)
          parses the contents retrieved from the given URL
 ClauseIterator parse(URL actualLocation, URL publicLocation)
          parses the contents retrieved from the given URL
 void removeNamespaceMapping(String namespace)
          removes mapping for a namespace.
 void setCaseSensitiveSymbols(boolean newCaseSensitiveSymbols)
           
 void setDefaultUpperCase(boolean v)
          KIF symbols are normally case-insensitive.
 void setPolarity(boolean polarity)
          tells the parser whether to interpret the text as an assertion or a query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KIF2CNF

public KIF2CNF()
Method Detail

addNamespaceMapping

public void addNamespaceMapping(String from,
                                String to)
creates mapping between two namespaces, Whenever the parser encounters in the input a symbol in the "from" namespace, it will replace it with the corresponding symbol in the "to" namespace.

Parameters:
from - the namespace to look for
to - its replacement

removeNamespaceMapping

public void removeNamespaceMapping(String namespace)
removes mapping for a namespace.

Parameters:
namespace - a namespace that used to be replaced with another.
See Also:
addNamespaceMapping(java.lang.String, java.lang.String)

getNamespaceMap

public Map getNamespaceMap()
returns an unmodifyable namespace replacement map.

Returns:
an unmodifyable namespace replacement map.
See Also:
addNamespaceMapping(java.lang.String, java.lang.String)

parse

public ClauseIterator parse(URL url)
                     throws ParsingException
Description copied from interface: FirstOrderLogicParser
parses the contents retrieved from the given URL

Specified by:
parse in interface FirstOrderLogicParser
Parameters:
url - the location of content
Returns:
the iterator of clauses resulting from parsing content
ParsingException

parse

public ClauseIterator parse(Reader rdr)
Description copied from interface: FirstOrderLogicParser
parses the contents extracted from the given Reader

Specified by:
parse in interface FirstOrderLogicParser
Parameters:
rdr - the reader to read the content stream from.
Returns:
the iterator of clauses resulting from parsing content

parse

public ClauseIterator parse(Reader rdr,
                            URL url)
Description copied from interface: FirstOrderLogicParser
parses the contents extracted from the given Reader. The public location of the document is set to the URL provided.

Specified by:
parse in interface FirstOrderLogicParser
Parameters:
rdr - the reader to read the content stream from.
url - the public location for the document, i.e. where this document is officially supposed to be coming from.
Returns:
the iterator of clauses resulting from parsing content

parse

public ClauseIterator parse(URL actualLocation,
                            URL publicLocation)
                     throws ParsingException
Description copied from interface: FirstOrderLogicParser
parses the contents retrieved from the given URL

Specified by:
parse in interface FirstOrderLogicParser
Parameters:
actualLocation - the actual location of content
publicLocation - the public location for the document, i.e. where this document is officially supposed to be coming from.
Returns:
the iterator of clauses resulting from parsing content
ParsingException

getPolarity

public boolean getPolarity()
Description copied from interface: FirstOrderLogicParser
A logical text is parsed in different ways depending on whether it is interpreted as an assertion or a query. This method returns true if the parser is interpreting input as an assertion.

Specified by:
getPolarity in interface FirstOrderLogicParser
Returns:
if the parser is interpreting input as an assertion.

setPolarity

public void setPolarity(boolean polarity)
Description copied from interface: FirstOrderLogicParser
tells the parser whether to interpret the text as an assertion or a query.

Specified by:
setPolarity in interface FirstOrderLogicParser
Parameters:
polarity - true if input is to be interpreted as an assertion.

getLanguage

public String getLanguage()
Description copied from interface: FirstOrderLogicParser
returns the name of the language of this parser.

Specified by:
getLanguage in interface FirstOrderLogicParser
Returns:
the name of the language of this parser.

getDefaultUpperCase

public boolean getDefaultUpperCase()
Returns:
true if by default, case-insensitive symbols are cast to upper case; false if to lowercase.
See Also:
setDefaultUpperCase(boolean)

setDefaultUpperCase

public void setDefaultUpperCase(boolean v)
KIF symbols are normally case-insensitive. If this property is set to true (default value), such symbols are cast to upper case during input; otherwise they are cast to lowercase.

Parameters:
v - true if by default, case-insensitive symbols are cast to upper case; false if to lowercase.

isCaseSensitiveSymbols

public boolean isCaseSensitiveSymbols()

setCaseSensitiveSymbols

public void setCaseSensitiveSymbols(boolean newCaseSensitiveSymbols)

createTranslator

public static FirstOrderLogicTranslator createTranslator()

JTP API Documentation