Parcourir la source

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

master
SisMaker il y a 4 ans
Parent
révision
1459b83c7e
1 fichiers modifiés avec 0 ajouts et 8 suppressions
  1. +0
    -8
      src/eAcs.erl

+ 0
- 8
src/eAcs.erl Voir le fichier

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

Chargement…
Annuler
Enregistrer