prettyIndex() ->
case ets:first(tab) of
'$end_of_table' ->
ok;
First ->
case First of
{W,N} ->
Ind = {Word,N}
end,
prettyIndexNext(First,Ind)%处理函数
end.
prettyIndexNext(First,{Word,Lines} = Ind) ->
Next = ets:next(tab,First) ,
case Next of
'$end_of_table' ->
Fun(Ind); %收集等特的key,记录出现在N行出现 2.把重复行去掉
{NextWord,M} ->
if
NextWord == Word ->
NextWord == Word ->
prettyIndexNext(Next,{NextWord,[M|Lines]})
true ->
Fun(Ind),
prettyIndexNext(Next,{NextWord,[M]})
end
end.