diff --git a/rebar.config b/rebar.config index f8d6a36..f8e6bf3 100644 --- a/rebar.config +++ b/rebar.config @@ -1,5 +1,7 @@ {erl_opts, [no_debug_info]}. -{deps, []}. +{deps,[ + {eSync, {git, "http://192.168.0.88:53000/SisMaker/eSync.git", {branch, "master"}}} +]}. %% escript diff --git a/src/eAcs.erl b/src/eAcs.erl index 006482c..5089122 100644 --- a/src/eAcs.erl +++ b/src/eAcs.erl @@ -136,14 +136,13 @@ getOutputIs(State) -> replaceSw(BinStr) -> TotalSize = byte_size(BinStr), MatchBIMWs = doMatchRs(BinStr, TotalSize - 1, _Index = 1, _State = 0, _MatchList = []), - io:format("IMY******************* ~p~n", [lists:reverse(MatchBIMWs)]), doReplaceSw(lists:reverse(MatchBIMWs), BinStr, TotalSize, _StartPos = 0, <<>>). %% 从前往后替换 doReplaceSw([], BinStr, TotalSize, StartPos, BinAcc) -> case TotalSize > StartPos of true -> - <>; + <>; _ -> BinAcc end; @@ -173,7 +172,7 @@ getMatchWords(MatchWordCnt, BinStr, ByteIndex, BslCnt, Utf8Code, FilterWs) -> %% 不是特殊词 getMatchWords(MatchWordCnt - 1, BinStr, ByteIndex - 1, 0, 0, [?RW | FilterWs]) end; - Byte band 128 == 128 -> + Byte bsr 6 == 2 -> Code = Byte band 63, getMatchWords(MatchWordCnt, BinStr, ByteIndex - 1, BslCnt + 6, Code bsl BslCnt + Utf8Code, FilterWs); true -> diff --git a/src/test/acTest.erl b/src/test/acTest.erl index f5a6782..00d83b5 100644 --- a/src/test/acTest.erl +++ b/src/test/acTest.erl @@ -7,7 +7,7 @@ test1() -> acTc:ts(1000000, acsTree, goto, [63870]). -test2() -> +test20() -> acTc:ts(1000000, eAcs, matchSw, [<<"fdsfads拉法叶舰fds淫秽ffdsfdsffdddd"/utf8>>]). test21() -> @@ -20,7 +20,7 @@ test3(Cnt, BinStr) -> acTc:ts(Cnt, eAcs, matchSw, [BinStr]). test31(Cnt, BinStr) -> - acTc:ts(Cnt, keyword, filter, [BinStr]). + acTc:ts(Cnt, eAcs, replaceSw, [BinStr]). test4(Cnt, FileName) -> {ok, Data} = file:read_file(FileName),