Преглед на файлове

ft: replaceSw函数的实现 todo: replaceSw函数的优化 敏感词去除特殊字符

master
SisMaker преди 4 години
родител
ревизия
1459b83c7e
променени са 1 файла, в които са добавени 0 реда и са изтрити 8 реда
  1. +0
    -8
      src/eAcs.erl

+ 0
- 8
src/eAcs.erl Целия файл

@ -22,7 +22,6 @@ doMatchMs(<<>>, _, _Index, MatchList) ->
doMatchMs(<<Word/utf8, Tail/binary>>, State, Index, MatchList) -> doMatchMs(<<Word/utf8, Tail/binary>>, State, Index, MatchList) ->
case acsSpw:getSpw(Word) of case acsSpw:getSpw(Word) of
true -> true ->
%% Index 1
doMatchMs(Tail, State, Index, MatchList); doMatchMs(Tail, State, Index, MatchList);
_ -> _ ->
{NewState, NewMatchList} = matchWordMs(Word, State, Index, MatchList), {NewState, NewMatchList} = matchWordMs(Word, State, Index, MatchList),
@ -79,7 +78,6 @@ doMatchIs(<<>>, _) ->
doMatchIs(<<Word/utf8, Tail/binary>>, State) -> doMatchIs(<<Word/utf8, Tail/binary>>, State) ->
case acsSpw:getSpw(Word) of case acsSpw:getSpw(Word) of
true -> true ->
%%
doMatchIs(Tail, State); doMatchIs(Tail, State);
_ -> _ ->
case matchWordIs(Word, State) of case matchWordIs(Word, State) of
@ -163,13 +161,10 @@ getMatchWords(MatchWordCnt, BinStr, ByteIndex, BslCnt, Utf8Code, FilterWs) ->
Byte = binary:at(BinStr, ByteIndex), Byte = binary:at(BinStr, ByteIndex),
if if
Byte < 128 -> Byte < 128 ->
%% ASCII
case acsSpw:getSpw(Byte) of case acsSpw:getSpw(Byte) of
true -> true ->
%%
getMatchWords(MatchWordCnt, BinStr, ByteIndex - 1, 0, 0, [Byte | FilterWs]); getMatchWords(MatchWordCnt, BinStr, ByteIndex - 1, 0, 0, [Byte | FilterWs]);
_ -> _ ->
%%
getMatchWords(MatchWordCnt - 1, BinStr, ByteIndex - 1, 0, 0, [?RW | FilterWs]) getMatchWords(MatchWordCnt - 1, BinStr, ByteIndex - 1, 0, 0, [?RW | FilterWs])
end; end;
Byte bsr 6 == 2 -> Byte bsr 6 == 2 ->
@ -191,10 +186,8 @@ getMatchWords(MatchWordCnt, BinStr, ByteIndex, BslCnt, Utf8Code, FilterWs) ->
FullWord = Code bsl BslCnt + Utf8Code, FullWord = Code bsl BslCnt + Utf8Code,
case acsSpw:getSpw(FullWord) of case acsSpw:getSpw(FullWord) of
true -> true ->
%%
getMatchWords(MatchWordCnt, BinStr, ByteIndex - 1, 0, 0, [FullWord | FilterWs]); getMatchWords(MatchWordCnt, BinStr, ByteIndex - 1, 0, 0, [FullWord | FilterWs]);
_ -> _ ->
%%
getMatchWords(MatchWordCnt - 1, BinStr, ByteIndex - 1, 0, 0, [?RW | FilterWs]) getMatchWords(MatchWordCnt - 1, BinStr, ByteIndex - 1, 0, 0, [?RW | FilterWs])
end end
end. end.
@ -219,7 +212,6 @@ doMatchRs(<<>>, _TotalSize, _CurIndex, _State, MatchList) ->
doMatchRs(<<Word/utf8, Tail/binary>>, TotalSize, CurIndex, State, MatchList) -> doMatchRs(<<Word/utf8, Tail/binary>>, TotalSize, CurIndex, State, MatchList) ->
case acsSpw:getSpw(Word) of case acsSpw:getSpw(Word) of
true -> true ->
%% CurIndex 1
doMatchRs(Tail, TotalSize, CurIndex, State, MatchList); doMatchRs(Tail, TotalSize, CurIndex, State, MatchList);
_ -> _ ->
{NewState, MatchCnt} = matchWordRs(Word, State, 0), {NewState, MatchCnt} = matchWordRs(Word, State, 0),

Зареждане…
Отказ
Запис