com.xerox.jxip
Class XipResultManager

java.lang.Object
  extended by com.xerox.jxip.XipResultManager

public class XipResultManager
extends java.lang.Object

The purpose of this class is to build XipResult. The result of a parse can be returned as a XipResult object. This object contains a vector of XipUnit objects. Each XipUnit object corresponds to the analysis of a given sentence. A XipUnit, in turn, is composed of the root of the chunking tree (a XipNode object) and a vector of dependencies (a XipDependency object). Each XipNode object contains a set of features, stored as a vector of XipFeature objects. Each XipDependency is composed of a dependency name, a vector of XipNode objects, and a set of XipFeature objects. If the node is a non-lexical node (such as an NP or a VP), then the surface field stores the label of that node, while the lemma vector remains empty. If a node is a lexical node, then the surface field stores the surface form of that lexeme, while the lemma vector stores all other possible reading for that lexeme. For non-lexical nodes, the list of all the daughters of a node is accessible through the daughters vector. Thus, you can explore the complete chunk tree using the root field of a XipUnit object as a starting point and scanning the daughter nodes. A dependency is a relation that links together nodes in the chunk tree. A dependency has a name, such as subject or object, and is associated with a set of features that are stored in a vector of XipFeature objects. The nodes that are linked together by a dependency are gathered in a vector of XipNode objects, each corresponding to a specific node in the chunk tree. Each node is associated with features. A feature expresses a property of the node, such as part of speech, singular and plural, and so on. A feature consists of a name and a value pair. For example, gender is a feature with the possible values of fem, masc, and neutral.


Constructor Summary
XipResultManager()
          Constructor for the XipResultManager object
 
Method Summary
 int buildXipResult(int gHandler, java.lang.String inputStr)
          build the java XipResult (string parsing)
 int buildXipResultFromFile(int gHandler, java.lang.String fileName)
          build the java XipResult (file parsing)
 int buildXipResultFromXmlFile(int gHandler, java.lang.String fileName)
          call buildXipResultFromXmlFile (...., depth =2)
 int buildXipResultFromXmlFile(int gHandler, java.lang.String fileName, int depth)
          build the java XipResult from (XML file parsing)
 void destroyNativeXipResult(int gHandler)
          destroy the current c++ XipResult
 java.lang.String getXipOutput()
          Gets the string generated by "print" in the xipRules
 XipResult getXipResult()
          Gets the XipResult
 java.util.Hashtable<java.lang.String,java.lang.String> getXmlTagInfo()
           
 void keepNativeXipResult()
          do not destroy the current c++ XipResult
static void main(java.lang.String[] args)
           
 void myCBXml()
           
 int xipResultBuilderFromString(int gHandler, java.lang.String inputStr, java.lang.Object objInst, java.lang.String cb)
           
 int xipResultBuilderFromTextFile(int gHandler, java.lang.String textFileName, java.lang.Object objInst, java.lang.String cb)
           
 int xipResultBuilderFromXmlFile(int gHandler, java.lang.String xmlFileName, java.lang.Object objInst, java.lang.String cb, java.lang.String xmlCb)
          call xipResultBuilderFromXmlFile( ....
 int xipResultBuilderFromXmlFile(int gHandler, java.lang.String xmlFileName, java.lang.Object objInst, java.lang.String cb, java.lang.String xmlCb, int depth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XipResultManager

public XipResultManager()
Constructor for the XipResultManager object

Method Detail

buildXipResult

public int buildXipResult(int gHandler,
                          java.lang.String inputStr)
                   throws java.lang.Exception
build the java XipResult (string parsing)

Parameters:
gHandler - a grammar handler
inputStr - the string to parse
Returns:
0 if Ok , 1 if error
Throws:
java.lang.Exception

buildXipResultFromFile

public int buildXipResultFromFile(int gHandler,
                                  java.lang.String fileName)
                           throws java.lang.Exception
build the java XipResult (file parsing)

Parameters:
gHandler - a grammar handler
fileName - the full file name to parse
Returns:
0 if Ok , 1 if error
Throws:
java.lang.Exception

buildXipResultFromXmlFile

public int buildXipResultFromXmlFile(int gHandler,
                                     java.lang.String fileName)
                              throws java.lang.Exception
call buildXipResultFromXmlFile (...., depth =2)

Parameters:
gHandler - a grammar handler
fileName - the full file name to parse
Returns:
0 if Ok , 1 if error
Throws:
java.lang.Exception

buildXipResultFromXmlFile

public int buildXipResultFromXmlFile(int gHandler,
                                     java.lang.String fileName,
                                     int depth)
                              throws java.lang.Exception
build the java XipResult from (XML file parsing)

Parameters:
gHandler - a grammar handler
fileName - the full file name to parse
depth - must be 0 or 2 (full or partial xml parsing)
Returns:
0 if Ok , 1 if error
Throws:
java.lang.Exception

xipResultBuilderFromString

public int xipResultBuilderFromString(int gHandler,
                                      java.lang.String inputStr,
                                      java.lang.Object objInst,
                                      java.lang.String cb)
                               throws java.lang.Exception
Parameters:
gHandler - a grammar handler
inputStr - the string to parse
objInst - the object instance of the callBack. If null, no callback will be invoked
cb - the callback method invoked after the analyze of one sentence
Returns:
Throws:
java.lang.Exception

xipResultBuilderFromTextFile

public int xipResultBuilderFromTextFile(int gHandler,
                                        java.lang.String textFileName,
                                        java.lang.Object objInst,
                                        java.lang.String cb)
                                 throws java.lang.Exception
Parameters:
gHandler - a grammar handler
textFileName - the full file name to parse (text file)
objInst - the object instance of the callBack. If null, no callback will be invoked
cb - the callback method invoked after the analyze of one sentence
Returns:
Throws:
java.lang.Exception

xipResultBuilderFromXmlFile

public int xipResultBuilderFromXmlFile(int gHandler,
                                       java.lang.String xmlFileName,
                                       java.lang.Object objInst,
                                       java.lang.String cb,
                                       java.lang.String xmlCb)
                                throws java.lang.Exception
call xipResultBuilderFromXmlFile( .... , depth = 2)

Parameters:
gHandler - a grammar handler
xmlFileName - the full file name to parse (XML file)
objInst - the object instance of the callBack. If null, no callback will be invoked
cb - the callback method invoked after the analyze of one sentence
xmlCb - the callback method invoked after the each xml tag take in account by the xip parser
Returns:
Throws:
java.lang.Exception

xipResultBuilderFromXmlFile

public int xipResultBuilderFromXmlFile(int gHandler,
                                       java.lang.String xmlFileName,
                                       java.lang.Object objInst,
                                       java.lang.String cb,
                                       java.lang.String xmlCb,
                                       int depth)
                                throws java.lang.Exception
Parameters:
gHandler - a grammar handler
xmlFileName - the full file name to parse (XML file)
objInst - the object instance of the callBack. If null, no callback will be invoked
cb - the callback method invoked after the analyze of one sentence
xmlCb - the callback method invoked after the each xml tag take in account by the xip parser
depth - must 0 or 2. (full or partial xml parsing)
Returns:
Throws:
java.lang.Exception

getXipResult

public XipResult getXipResult()
Gets the XipResult

Returns:
The XipResult

getXipOutput

public java.lang.String getXipOutput()
Gets the string generated by "print" in the xipRules

Returns:
The output

keepNativeXipResult

public void keepNativeXipResult()
                         throws java.lang.Exception
do not destroy the current c++ XipResult

Throws:
java.lang.Exception

destroyNativeXipResult

public void destroyNativeXipResult(int gHandler)
                            throws java.lang.Exception
destroy the current c++ XipResult

Parameters:
gHandler -
Throws:
java.lang.Exception

getXmlTagInfo

public java.util.Hashtable<java.lang.String,java.lang.String> getXmlTagInfo()

myCBXml

public void myCBXml()

main

public static void main(java.lang.String[] args)
Parameters:
args -


Copyright © 2008 Xerox All Rights Reserved.