com.xerox.jxip
Class XipUnit

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

public class XipUnit
extends java.lang.Object

XipUnit Class


Constructor Summary
XipUnit(XipNode rootNode, java.util.Vector<XipLeaf> leaves, java.util.Vector<XipDependency> dependencies, java.lang.String language, long sentNb)
          Constructor for the XipUnit object
 
Method Summary
 java.util.Vector<XipDependency> getDependencies()
          Gets the dependencies
 java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name)
          Gets the dependencies having the specified name.
 java.lang.String getLanguage()
          Gets the language attribute
 XipNode getLeafNodeByTokOffset(long offset)
          Returns the leaf node having the specified token offset (token position in the sentence).
 java.util.Vector<XipNode> getLeafNodes()
          Returns a Vector containing leaf nodes descendant of the current unit.
 java.util.Vector<XipLeaf> getLeaves()
          Gets the leaves node
 XipNode getNodeByGramId(long id)
          Returns the node having the specified gram id in the current unit
 java.util.Vector<XipNode> getNodesByCategory(java.lang.String category)
          Returns all XipNodes descendant all the root node that have the category name.
 java.util.Vector<XipNode> getNodesByCategory(java.lang.String category, java.lang.String features)
          Returns all XipNodes descendant all the root node that have the category name and the specified features.
 java.util.Vector<XipNode> getNodesByFeature(java.lang.String name, java.lang.String value)
          Returns all XipNodes descendant all the root node that have the feature name with the specified value.
 XipNode getNodeUid(java.lang.String uid)
          Returns the node having the specified uid in the current unit
 XipNode getRoot()
          Gets the root XipNode
 long getSentenceNb()
          Gets The sentence number
 java.lang.String getSentenceString()
          Gets the sentence
 boolean hasDependency(java.lang.String name)
          Tests whether the current unit has the specified dependency or not.
 java.lang.String toString()
          return XipUnit data as a string
 java.lang.String toString(boolean withFeature)
          return XipUnit data as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XipUnit

public XipUnit(XipNode rootNode,
               java.util.Vector<XipLeaf> leaves,
               java.util.Vector<XipDependency> dependencies,
               java.lang.String language,
               long sentNb)
Constructor for the XipUnit object

Parameters:
rootNode - the root XipNode
leaves - the leaves: Vector of XipLeaf
dependencies - the dependencies: Vector of dependency
language -
sentNb -
Method Detail

getRoot

public XipNode getRoot()
Gets the root XipNode

Returns:
The root XipNode

getSentenceNb

public long getSentenceNb()
Gets The sentence number

Returns:
The sentence number

getDependencies

public java.util.Vector<XipDependency> getDependencies()
Gets the dependencies

Returns:
The dependencies: Vector of XipDependency

getDependenciesByName

public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name)
Gets the dependencies having the specified name.

Parameters:
name - the name of the expected dependencies.
Returns:
the dependencies having the appropriate name.

hasDependency

public boolean hasDependency(java.lang.String name)
Tests whether the current unit has the specified dependency or not.

Parameters:
name - the name of the dependency.
Returns:
true if the node has the specified dependency, false otherwise.

getNodeByGramId

public XipNode getNodeByGramId(long id)
Returns the node having the specified gram id in the current unit

Parameters:
id - the search node gram id
Returns:
the XipNode corresponding to this id if found in the current unit null otherwise.

getLeafNodeByTokOffset

public XipNode getLeafNodeByTokOffset(long offset)
Returns the leaf node having the specified token offset (token position in the sentence).

Parameters:
offset - the token offset
Returns:
the leaf node having the specified token offset

getNodeUid

public XipNode getNodeUid(java.lang.String uid)
Returns the node having the specified uid in the current unit

Parameters:
uid - the search node uid
Returns:
the XipNode corresponding to this id if found in the current unit null otherwise.

getNodesByFeature

public java.util.Vector<XipNode> getNodesByFeature(java.lang.String name,
                                                   java.lang.String value)
Returns all XipNodes descendant all the root node that have the feature name with the specified value.

Parameters:
name - the name of the feature
value - the value of the feature ("*" if all values are fine)
Returns:
a Vector of XipNode having the appropriate feature.
See Also:
XipNode.getDescendantsByFeature(String name, String value)

getNodesByCategory

public java.util.Vector<XipNode> getNodesByCategory(java.lang.String category)
Returns all XipNodes descendant all the root node that have the category name.

Parameters:
category - the name of the category
Returns:
a Vector of XipNode having the appropriate category.
See Also:
XipNode.getDescendantsByCategory(String category)

getNodesByCategory

public java.util.Vector<XipNode> getNodesByCategory(java.lang.String category,
                                                    java.lang.String features)
Returns all XipNodes descendant all the root node that have the category name and the specified features. Features String format are the XIP traditional format.

Parameters:
category - the name of the category
features - the String representation of the feature lists (XIP format)
Returns:
a Vector of XipNode having the appropriate category.
See Also:
XipNode.getDescendantsByCategory(String category)

getLeaves

public java.util.Vector<XipLeaf> getLeaves()
Gets the leaves node

Returns:
The leaves: a Vector of XipLeaf

getLeafNodes

public java.util.Vector<XipNode> getLeafNodes()
Returns a Vector containing leaf nodes descendant of the current unit. Leaves that are only different interpretations of a same node are NOT considered.

Returns:
a Vector of XipNodes corresponding to the tokenization part.

getLanguage

public java.lang.String getLanguage()
Gets the language attribute

Returns:
The language value

getSentenceString

public java.lang.String getSentenceString()
Gets the sentence

Returns:
The string sentence

toString

public java.lang.String toString()
return XipUnit data as a string

Overrides:
toString in class java.lang.Object
Returns:
XipUnit to a string

toString

public java.lang.String toString(boolean withFeature)
return XipUnit data as a string

Parameters:
withFeature - if true build the string with the XipNode features
Returns:
XipUnit to a string


Copyright © 2008 Xerox All Rights Reserved.