|
|
@ -21,14 +21,14 @@ doMatch(<>, State, Index, MatchList) -> |
|
|
|
doMatch(Tail, NewState, Index + 1, NewMatchList). |
|
|
|
|
|
|
|
matchInner(Word, State, Index, MatchList) -> |
|
|
|
Node = acsTrees:goto(State), |
|
|
|
Node = acsTree:goto(State), |
|
|
|
case Node of |
|
|
|
undefined -> |
|
|
|
case State of |
|
|
|
0 -> |
|
|
|
{State, MatchList}; |
|
|
|
_ -> |
|
|
|
{NextState, _} = acsTrees:failOut(State), |
|
|
|
{NextState, _} = acsTree:failOut(State), |
|
|
|
matchInner(Word, NextState, Index, MatchList) |
|
|
|
end; |
|
|
|
_ -> |
|
|
@ -41,7 +41,7 @@ matchInner(Word, State, Index, MatchList) -> |
|
|
|
0 -> |
|
|
|
{State, MatchList}; |
|
|
|
_ -> |
|
|
|
{NextState, _} = acsTrees:failOut(State), |
|
|
|
{NextState, _} = acsTree:failOut(State), |
|
|
|
matchInner(Word, NextState, Index, MatchList) |
|
|
|
end |
|
|
|
end |
|
|
@ -50,7 +50,7 @@ matchInner(Word, State, Index, MatchList) -> |
|
|
|
getOutput(0, _Index, MatchList) -> |
|
|
|
MatchList; |
|
|
|
getOutput(State, Index, MatchList) -> |
|
|
|
{FailState, Pattern} = acsTrees:failOut(State), |
|
|
|
{FailState, Pattern} = acsTree:failOut(State), |
|
|
|
case Pattern of |
|
|
|
undefined -> |
|
|
|
getOutput(FailState, Index, MatchList); |
|
|
@ -76,14 +76,14 @@ doMatch(<>, State) -> |
|
|
|
end. |
|
|
|
|
|
|
|
matchInner(Word, State) -> |
|
|
|
Node = acsTrees:goto(State), |
|
|
|
Node = acsTree:goto(State), |
|
|
|
case Node of |
|
|
|
undefined -> |
|
|
|
case State of |
|
|
|
0 -> |
|
|
|
State; |
|
|
|
_ -> |
|
|
|
{NextState, _} = acsTrees:failOut(State), |
|
|
|
{NextState, _} = acsTree:failOut(State), |
|
|
|
matchInner(Word, NextState) |
|
|
|
end; |
|
|
|
_ -> |
|
|
@ -100,7 +100,7 @@ matchInner(Word, State) -> |
|
|
|
0 -> |
|
|
|
State; |
|
|
|
_ -> |
|
|
|
{NextState, _} = acsTrees:failOut(State), |
|
|
|
{NextState, _} = acsTree:failOut(State), |
|
|
|
matchInner(Word, NextState) |
|
|
|
end |
|
|
|
end |
|
|
@ -109,7 +109,7 @@ matchInner(Word, State) -> |
|
|
|
getOutput(0) -> |
|
|
|
false; |
|
|
|
getOutput(State) -> |
|
|
|
{FailState, Pattern} = acsTrees:failOut(State), |
|
|
|
{FailState, Pattern} = acsTree:failOut(State), |
|
|
|
case Pattern == undefined orelse FailState == 0 of |
|
|
|
true -> |
|
|
|
false; |
|
|
|