|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectcom.hankcs.hanlp.collection.MDAG.MDAGNode
public class MDAGNode
MDAG中的一个节点
The class which represents a node in a MDAG.
构造方法摘要 | |
---|---|
MDAGNode(boolean isAcceptNode)
建立一个节点 Constructs an MDAGNode. |
方法摘要 | |
---|---|
MDAGNode |
addOutgoingTransition(char letter,
boolean targetAcceptStateStatus)
新建一个转移目标 Creates an outgoing _transition labeled with a given char that has a new node as its target. |
MDAGNode |
addOutgoingTransition(char letter,
MDAGNode newTargetNode)
建立一条边(起点是自己) |
void |
clearStoredHashCode()
Clears this node's stored hash value |
MDAGNode |
clone()
克隆一个状态 Creates an MDAGNode possessing the same accept state status and outgoing transitions as this node. |
MDAGNode |
clone(MDAGNode soleParentNode,
char parentToCloneTransitionLabelChar)
克隆一个状态 原来soleParentNode转移到本状态,现在转移到克隆后的状态 Creates an MDAGNode possessing the same accept state status ant _transition set (incoming & outgoing) as this node. outgoing transitions as this node. |
void |
decrementTargetIncomingTransitionCounts()
本状态的目标状态们的入度减一 Decrements (by 1) the incoming _transition counts of all of the nodes that are targets of outgoing transitions from this node. |
boolean |
equals(Object obj)
两个状态是否等价,只有状态转移函数完全一致才算相等 Evaluates the equality of this node with another object. |
int |
getIncomingTransitionCount()
Retrieves this node's incoming _transition count |
int |
getOutgoingTransitionCount()
Retrieves this node's outgoing _transition count. |
TreeMap<Character,MDAGNode> |
getOutgoingTransitions()
Retrieves this node's outgoing transitions. |
Stack<MDAGNode> |
getTransitionPathNodes(String str)
获取一个字符串路径上经过的节点 Retrieves the nodes in the _transition path starting from this node corresponding to a given String . |
int |
getTransitionSetBeginIndex()
Retrieves the index in a simplified mdag data array that the SimpleMDAGNode representation of this node's outgoing _transition set begins at. |
int |
hashCode()
Hashes this node using its accept state status and set of outgoing _transition paths. |
boolean |
hasOutgoingTransition(char letter)
Determines whether this node has an outgoing _transition with a given label. |
boolean |
hasTransitions()
Determines whether this node has any outgoing transitions. |
static boolean |
haveSameTransitions(MDAGNode node1,
MDAGNode node2)
是否含有相同的转移函数 |
boolean |
isAcceptNode()
Retrieves the accept state status of this node. |
boolean |
isConfluenceNode()
Determines if this node is a confluence node (defined as a node with two or more incoming transitions |
void |
reassignOutgoingTransition(char letter,
MDAGNode oldTargetNode,
MDAGNode newTargetNode)
重新设置转移状态函数的目标 Reassigns the target node of one of this node's outgoing transitions. |
void |
removeOutgoingTransition(char letter)
移除一个转移目标 Removes a _transition labeled with a given char. |
void |
setAcceptStateStatus(boolean isAcceptNode)
Sets this node's accept state status. |
void |
setTransitionSetBeginIndex(int transitionSetBeginIndex)
转移状态在数组中的起始下标 Records the index that this node's _transition set starts at in an array containing this node's containing MDAG data (simplified MDAG). |
String |
toString()
|
MDAGNode |
transition(char letter)
Follows an outgoing _transition of this node labeled with a given char. |
MDAGNode |
transition(char[] str)
|
MDAGNode |
transition(char[] str,
int offset)
|
MDAGNode |
transition(String str)
沿着一个路径转移 Follows a _transition path starting from this node. |
从类 java.lang.Object 继承的方法 |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
构造方法详细信息 |
---|
public MDAGNode(boolean isAcceptNode)
isAcceptNode
- 是否是终止状态 a boolean denoting the accept state status of this node方法详细信息 |
---|
public MDAGNode clone()
Object
中的 clone
public MDAGNode clone(MDAGNode soleParentNode, char parentToCloneTransitionLabelChar)
soleParentNode
- the MDAGNode possessing the only _transition that targets this nodeparentToCloneTransitionLabelChar
- the char which labels the _transition from soleParentNode
to this node
public int getTransitionSetBeginIndex()
public int getOutgoingTransitionCount()
public int getIncomingTransitionCount()
public boolean isConfluenceNode()
public boolean isAcceptNode()
public void setAcceptStateStatus(boolean isAcceptNode)
isAcceptNode
- a boolean representing the desired accept state statuspublic void setTransitionSetBeginIndex(int transitionSetBeginIndex)
transitionSetBeginIndex
- a _transition setpublic boolean hasOutgoingTransition(char letter)
letter
- the char labeling the desired _transition
letter
, and false otherwisepublic boolean hasTransitions()
public MDAGNode transition(char letter)
letter
- the char representation of the desired _transition's label
letter
,
or null if there is no such labeled _transition from this nodepublic MDAGNode transition(String str)
str
- a String corresponding a _transition path in the MDAG
str
, or null if such a _transition path is not present in the MDAGpublic MDAGNode transition(char[] str)
public MDAGNode transition(char[] str, int offset)
public Stack<MDAGNode> getTransitionPathNodes(String str)
str
- a String corresponding to a _transition path starting from this node
str
, in the order they are encountered in during transitioningpublic TreeMap<Character,MDAGNode> getOutgoingTransitions()
public void decrementTargetIncomingTransitionCounts()
public void reassignOutgoingTransition(char letter, MDAGNode oldTargetNode, MDAGNode newTargetNode)
letter
- the char which labels the outgoing _transition of interestoldTargetNode
- the MDAGNode that is currently the target of the _transition of interestnewTargetNode
- the MDAGNode that is to be the target of the _transition of interestpublic MDAGNode addOutgoingTransition(char letter, boolean targetAcceptStateStatus)
letter
- a char representing the desired label of the _transitiontargetAcceptStateStatus
- a boolean representing to-be-created _transition target node's accept status
public MDAGNode addOutgoingTransition(char letter, MDAGNode newTargetNode)
letter
- 边上的字符串newTargetNode
- 边的重点
public void removeOutgoingTransition(char letter)
letter
- the char labeling the _transition of interestpublic static boolean haveSameTransitions(MDAGNode node1, MDAGNode node2)
node1
- node2
-
public void clearStoredHashCode()
public boolean equals(Object obj)
Object
中的 equals
obj
- an object
obj
is an MDAGNode and the set of
_transition paths from this node and obj are equivalentpublic int hashCode()
Object
中的 hashCode
public String toString()
Object
中的 toString
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |