28.12.2013 Aufrufe

pdf - Universität zu Köln

pdf - Universität zu Köln

pdf - Universität zu Köln

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

#the function returns the encoded character and a flag that shows if a further<br />

#character should be skipped<br />

sub getcode<br />

{<br />

my ($self,$char,$nextchar)=@_;<br />

$nextchar||= ":";<br />

return ("1",0) if index ("bp",$char) >= 0;<br />

return ("8",0) if index ("dt",$char) >= 0 and index ("csz",$nextchar) >= 0;<br />

return ("2",0) if index ("dt",$char) >= 0 ;<br />

return ("3",0) if index ("fvw",$char) >= 0;<br />

return ("3",1) if index ("p",$char) >= 0 and $nextchar eq "h";<br />

return ("4",0) if index ("gqk",$char) >= 0;<br />

return ("4",0) if ($char eq "c") and index ("aouhkq",$nextchar) >= 0;<br />

return ("48",1) if ($char eq "c") and $nextchar eq "x";<br />

return ("48",0) if $char eq "x";<br />

return ("5",0) if $char eq "l";<br />

return ("6",0) if $char eq "m" or $char eq "n";<br />

return ("7",0) if $char eq "r";<br />

#the handling of sc was ambiguous in the paper and deducted from the example<br />

#encodings given in the paper. So the c is consumed after an s.<br />

return ("8",1) if $char eq "s" and $nextchar eq "c";<br />

return ("8",0) if ("c" eq $char) and index ("aoukxq",$nextchar) == -1;<br />

return ("8",0) if index ("sz\337",$char)>=0;<br />

#vowels return 0 to function as separators<br />

return ("0",0) if index ($vowels,$char)>=0;<br />

}<br />

1;<br />

#default: return empty string and advance only one char<br />

#for example ignore h<br />

return ("",0);<br />

11.2 Implementation des Daitch-Mokotoff-Algorithmus<br />

# Implementation of the Daitch-Mokotoff-Algorithm as described by<br />

64

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!