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

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

package Text::German::Syllable;<br />

#hash of sonority values<br />

our %sonority = ("-"=>-1,k=>2,x=>2,c=>2,ck=>2,g=>2,q=>1,p=>2,t=>1,h=>1,<br />

z=>1,s=>1,"\337"=>1,ch=>1,sch=>1,r=>5,l=>4,<br />

b=>1,d=>1,v=>3,ph=>3,f=>2,w=>3,m=>4,n=>4,<br />

j=>5,y=>8,"\374"=>8,i=>8,ih=>8,u=>8,uh=>8,e=>9,eh=>9,<br />

"\351"=>9,"\366"=>9,"\351h"=>9,"\366h"=>9,o=>9,oh=>9,<br />

"\344"=>10,"\344h"=>10,a=>11,ah=>11);<br />

our @multichar;<br />

sub new<br />

{<br />

my $proto = shift;<br />

my $class = ref($proto) || $proto;<br />

my $self = {@_};<br />

our @multichar=sort {length $b length $a} grep {length $_>1} keys %sonority;<br />

}<br />

bless ($self, $class);<br />

return $self;<br />

#replace uncommon characters with accents by aequivalent ones<br />

sub convertChars<br />

{<br />

my $text=shift;<br />

$text=~tr/\’\140/\-\-/;<br />

$text=~tr/\350\352\353/eee/;<br />

$text=~tr/\347/c/;<br />

$text=~tr/\340\341\342\343/aaaa/;<br />

$text=~tr/\362\363\364/ooo/;<br />

$text=~tr/\372\371\373/uuu/;<br />

$text=~tr/\361/n/;<br />

$text=~tr/\354\355\356/iii/;<br />

$text=~tr/\304/e/;<br />

$text=~s/~//g;<br />

return $text;<br />

}<br />

71

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

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!