public void SetSuffixLinkTo(UNode uNodeWhoseSuffixLinkToSet, UNode uNode) { if (uNodeWhoseSuffixLinkToSet != null) { uNodeWhoseSuffixLinkToSet.SuffixLink = uNode; } }
public void SplitActiveEdge(byte[] store, UNode uNodeToAdd, int index, byte symbol) { UEdge activeEdge = ActiveEdge; UEdge splitEdge = new UEdge(activeEdge.From, activeEdge.From + _activeLength, uNodeToAdd); uNodeToAdd.Edges[store[activeEdge.From + _activeLength]] = new UEdge(activeEdge.From + _activeLength, activeEdge.To, activeEdge.Next); uNodeToAdd.Edges[symbol] = new UEdge(index, store.Length, null); _activeUNode.Edges[_activeEdgeSymbol] = splitEdge; }
public UEdge(int from, int to, UNode next) { From = (short)from; To = (short)to; Next = next; }
public ActivePoint MoveToEdgeStartingWithAndByActiveLengthLessOne(UNode uNode, byte character) { return(new ActivePoint(uNode, character, _activeLength - 1)); }
public ActivePoint MoveTo(UNode uNode) { return(new ActivePoint(uNode, _activeEdgeSymbol, _activeLength)); }
public bool IsThisTheActiveNode(UNode uNode) { return(_activeUNode == uNode); }
public UNode SetSuffixLinkToActiveNodeAndReturnActiveNode(UNode uNode) { SetSuffixLinkTo(uNode, _activeUNode); return(_activeUNode); }
public ActivePoint(UNode activeUNode, byte activeEdgeSymbol, int activeLength) { _activeUNode = activeUNode; _activeEdgeSymbol = activeEdgeSymbol; _activeLength = activeLength; }