コード例 #1
0
 public void SetSuffixLinkTo(UNode uNodeWhoseSuffixLinkToSet, UNode uNode)
 {
     if (uNodeWhoseSuffixLinkToSet != null)
     {
         uNodeWhoseSuffixLinkToSet.SuffixLink = uNode;
     }
 }
コード例 #2
0
        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;
        }
コード例 #3
0
 public UEdge(int from, int to, UNode next)
 {
     From = (short)from;
     To   = (short)to;
     Next = next;
 }
コード例 #4
0
 public ActivePoint MoveToEdgeStartingWithAndByActiveLengthLessOne(UNode uNode, byte character)
 {
     return(new ActivePoint(uNode, character, _activeLength - 1));
 }
コード例 #5
0
 public ActivePoint MoveTo(UNode uNode)
 {
     return(new ActivePoint(uNode, _activeEdgeSymbol, _activeLength));
 }
コード例 #6
0
 public bool IsThisTheActiveNode(UNode uNode)
 {
     return(_activeUNode == uNode);
 }
コード例 #7
0
 public UNode SetSuffixLinkToActiveNodeAndReturnActiveNode(UNode uNode)
 {
     SetSuffixLinkTo(uNode, _activeUNode);
     return(_activeUNode);
 }
コード例 #8
0
 public ActivePoint(UNode activeUNode, byte activeEdgeSymbol, int activeLength)
 {
     _activeUNode      = activeUNode;
     _activeEdgeSymbol = activeEdgeSymbol;
     _activeLength     = activeLength;
 }