如何识别 Erlang 中的德语变音符号?我已经尝试了好几天,当我将文本作为列表阅读时,它只是没有得到它们。例如,我试过这个
change_umlaut(Word) -> change_umlaut(lists:reverse(Word), []).
change_umlaut([],Acc) -> Acc;
change_umlaut([H|T],Acc) ->
if
%extended ascii characters
H =:= 129 -> change_umlaut(T, ["ue"|Acc]);
H =:= 132 -> change_umlaut(T, ["ae"|Acc]);
H =:= 148 -> change_umlaut(T, ["oe"|Acc]);
%extended ascii characters
H == 129 -> change_umlaut(T, ["ue"|Acc]);
H == 132 -> change_umlaut(T, ["ae"|Acc]);
H == 148 -> change_umlaut(T, ["oe"|Acc]);
%literals
H == "ü" -> change_umlaut(T, ["ue"|Acc]);
H == "ä" -> change_umlaut(T, ["ae"|Acc]);
H == "ö" -> change_umlaut(T, ["oe"|Acc]);
%else
true -> change_umlaut(T, [H|Acc])
end;
它只是传递所有参数而不匹配,直到为真...谢谢您的帮助。