|
|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 67584 (0x10800)
Types: TextFile
Names: »hyphenation«
└─⟦621cfb9a2⟧ Bits:30002817 RC8000 Dump tape fra HCØ. Detaljer om "HC8000" projekt.
└─⟦0364f57e3⟧
└─⟦this⟧ »hyphenation«
\f
boolean procedure hyphenation(call_word,result_word);
integer array call_word,result_word;
begin
<*******************************************************************
* *
* H Y P H E N A T I O N *
* *
* This procedure will try to hyphenate a word according to the *
* following rules: *
* *
* 1. Exception removal: *
* If the word appears in the dictionary of special *
* words, use the hyphenation found in the dictionary. *
* *
* 2. Suffix removal: *
* A permissible hyphen is inserted if the word ends *
* with a known suffix. *
* *
* 3. Prefix removal: *
* A permissible hyphen is inserted if the word begins *
* with a known prefix. *
* *
* 4. Study of consonant pairs: *
* In the remainder of the word, after suffixes and *
* prefixes have been removed, we try to break between *
* two consonants placed in accepted combinations. *
* *
* 5. Retaining short ends: *
* After applying rules 1, 2, 3 and 4, we take back *
* all "permissible" breaks that result in only one *
* or two letters after the rightmost break. *
* *
* ---------------------- *
* *
* Programmed july 1981 by BYN (special thanks to D.E. Knuth) *
* *
*******************************************************************>
\f
<*********** help procedures ************>
boolean procedure char_in_set(ch,set);
value ch;
boolean ch;
string set;
begin
integer set_lgh,char_pos,i;
boolean found;
boolean array char_val(1:25);
long array comp_1,comp_2(1:5);
char_pos := 1;
set_lgh := puttext(comp_1,1,set);
puttext(comp_2,1,<:vowel:>);
i := set_lgh;
if compare_text(comp_1,comp_2,i) = 0 then
set_lgh := puttext(char_val,1,<:aeiouyæøå:>)
else
begin
puttext(comp_2,1,<:consonant:>);
i := set_lgh;
if compare_text(comp_1,comp_2,i) = 0 then
set_lgh := puttext(char_val,1,<:bcdfghjklmnpqrstvwxz:>)
else
puttext(char_val,1,set,set_lgh);
end;
i := 1;
repeat
found := ch extract 8 = char_val(i) extract 8;
i := i + 1
until found or i > set_lgh;
char_in_set := found;
end char_in_set;
\f
boolean procedure first_vowel(word,pos);
long array word;
integer pos;
begin
integer lgh,i;
boolean array test_word(1:max_word_length);
boolean found;
i := 1;
lgh := puttext(test_word,i,word);
putchar(test_word,i,0);
i := 1;
repeat
found := char_in_set(test_word(i),<:vowel:>);
i := i + 1
until found or i > lgh;
pos := i - 1;
first_vowel := found;
end first_vowel;
boolean procedure special_consonant(word,pos);
value pos;
long array word;
integer pos;
begin
integer i;
boolean array help(1:max_word_length);
i := 1;
puttext(help,i,word);
putchar(help,i,0);
special_consonant := false;
if help(pos+1) extract 8 = 'h' then
special_consonant := char_in_set(help(pos),<:cgpst:>);
end special_consonant;
\f
boolean procedure string_in_word(txt,word,start_pos,next_pos);
string txt;
long array word;
integer start_pos,next_pos;
begin
boolean array temp_txt(1:10),temp_word(1:max_word_length);
integer i,j,txt_lgh,word_lgh;
boolean found;
txt_lgh := puttext(temp_txt,1,txt);
word_lgh := puttext(temp_word,1,word);
found := false;
i := 0;
for i := 1,i + 1 while i <= word_lgh - txt_lgh + 1 and -, found do
if temp_word(i) extract 8 = temp_txt(1) extract 8 then
begin
found := true;
for j := 2 step 1 until txt_lgh do
if temp_txt(j) extract 8 <> temp_word(i+j-1) extract 8 then
found := false;
end;
start_pos := i - 1;
next_pos := start_pos + txt_lgh;
string_in_word := found;
end string_in_word;
\f
<*************** word processing procedures ***************>
boolean procedure exception_removal(word,result);
long array word,result;
begin
real array key(1:4);
integer field break_points,extend_check;
integer i,lgh,result_pos,ch_d,j,d_lgh;
boolean array help(1:max_word_length);
long array first_seven,comp(1:2);
boolean ok,try_again;
for i := 1,2,3,4 do
key(i) := real word(i);
break_points := 18;
extend_check := break_points + 2;
get_rec_i(dictionary,key);
exception_removal := result_i = 1;
if result_i = 1 then
begin
lgh := puttext(help,1,word);
result_pos := 1;
for i := 1,i+1 while i <= lgh do
begin
if dictionary.break_points shift (1 - i) extract 1 = 1 then
putchar(result,result_pos,hyphenation_char);
putchar(result,result_pos,help(i));
end;
putchar(result,result_pos,0);
end
else
begin
for i := 1 step 1 until max_word_length do help(i) := false;
lgh := puttext(help,1,word);
if lgh >= 7 then
begin
first_seven(1) := first_seven(2) := 0;
gettext(word,1,first_seven,7);
for i := 1,2 do key(i) := real first_seven(i);
key(3) := key(4) := real <::>;
get_rec_i(dictionary,key);
gettext(dictionary,1,comp,7);
if compare_text(first_seven,comp,7) = 0 then
begin
ok := true;
repeat
if dictionary.extend_check <> 0 then
begin
d_lgh := puttext(result,1,dictionary); <* to get length *>
if lgh < d_lgh then d_lgh := lgh;
for i := 1,i + 1 while i <= d_lgh and ok do
begin
if dictionary.extend_check shift (1-i) extract 1 = 1 then
begin
j := i;
getchar(dictionary,j,ch_d);
if ch_d extract 8 <> help(i) extract 8 then
ok := false;
end;
end;
end;
try_again := false;
if -, ok then
begin
next_rec_i(dictionary);
if result_i = 1 then
begin
gettext(dictionary,1,comp,7);
if compare_text(first_seven,comp,7) = 0 then
ok := try_again := true;
end;
end
until -, ok or -, try_again;
if ok then
begin
result_pos := 1;
exception_removal := true;
for i := 1,i + 1 while i <= lgh do
begin
if dictionary.break_points shift (1 - i) extract 1 = 1 then
putchar(result,result_pos,hyphenation_char);
putchar(result,result_pos,help(i));
end;
putchar(result,result_pos,0);
end;
end;
end;
end;
end exception_removal;
\f
boolean procedure suffix_removal(word,lgh,suffix,rest_word,try_again);
value lgh;
long array word,suffix,rest_word;
integer lgh;
boolean try_again;
begin
procedure cut_word(suf,lg);
value suf,lg;
long suf;
integer lg;
begin
found := true;
suffix(1) := suf;
gettext(word,1,rest_word,lgh - lg);
end cut_word;
long array last_1,last_2,last_3,last_4,last_5,last_6(1:2),help(1:(max_word_length + 5) // 6);
integer pos,i,ch_val,pre_ch_val,count,no_of_suffixes,start,next;
boolean found;
for i := 1,2 do
last_1(i) := last_2(i) := last_3(i) := last_4(i) :=
last_5(i) := last_6(i) := 0;
for i := 1 step 1 until 6 do
begin <* init possible suffixes *>
if i + 1 < lgh then
begin
pos := lgh - i + 1;
case i of
begin
gettext(word,pos,last_1,i);
gettext(word,pos,last_2,i);
gettext(word,pos,last_3,i);
gettext(word,pos,last_4,i);
gettext(word,pos,last_5,i);
gettext(word,pos,last_6,i);
end;
end;
end;
found := try_again := false;
<* look for a known suffix *>
if english then
begin
if last_4(1) = long <:able:> then
begin
pos := lgh - 4;
getchar(word,pos,ch_val); <* preceded letter *>
found := char_in_set(false add ch_val,<:ehiklouwxy:>);
if -, found then
begin
pos := lgh - 4 - 1;
getchar(word,pos,pre_ch_val);
found := pre_ch_val = 'n' and ch_val = 't' or pre_ch_val = 'r' and ch_val = 't';
end;
if found then
begin
cut_word(long <:able:>,4);
try_again := true;
end;
end
else
if last_3(1) = long <:ary:> then
begin
found := last_6(1) shift (-24) shift 24 = long <:ion:> or
_ last_5(1) shift (-32) shift 32 = long <:en:>;
if found then
begin
cut_word(long <:ary:>,3);
try_again := true;
end;
end
else
if last_3(1) = long <:cal:> then
cut_word(long <:cal:>,3)
else
if last_4(1) = long <:cate:> then
begin
pos := lgh - 4;
getchar(word,pos,ch_val);
found := char_in_set(false add ch_val,<:vowel:>);
if found then
cut_word(long <:cate:>,4);
end
else
if last_4(1) = long <:cial:> then
cut_word(long <:cial:>,4)
else
if last_5(1) = long <:cious:> then
begin
pos := lgh - 5;
getchar(word,pos,ch_val);
if ch_val <> 's' then
cut_word(long <:cious:>,5);
end
else
if last_5(1) = long <:cient:> then
cut_word(long <:cient:>,5)
else
if last_4(1) = long <:dent:> then
cut_word(long <:dent:>,4)
else
if last_3(1) = long <:ful:> then
begin
cut_word(long <:ful:>,3);
try_again := true;
end
else
if last_4(1) = long <:lize:> then
begin
cut_word(long <:lize:>,4);
try_again := true;
end
else
if last_4(1) = long <:late:> then
begin
pos := lgh - 4;
getchar(word,pos,ch_val);
if char_in_set(false add ch_val,<:vowel:>) then
cut_word(long <:late:>,4);
end
else
if last_5(1) = long <:lated:> then
begin
pos := lgh - 5;
getchar(word,pos,ch_val);
if char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:lated:>,5);
end
else
if last_4(1) = long <:less:> then
begin
cut_word(long <:less:>,4);
try_again := true;
end
else
if last_2(1) = long <:ly:> then
begin
cut_word(long <:ly:>,2);
try_again := true;
end
else
if last_4(1) = long <:ment:> then
begin
cut_word(long <:ment:>,4);
try_again := true;
end
else
if last_4(1) = long <:ness:> then
begin
cut_word(long <:ness:>,4);
try_again := true;
end
else
if last_4(1) = long <:nary:> then
begin
pos := lgh - 4;
getchar(word,pos,ch_val); <* preceded letter *>
pos := lgh - 5;
getchar(word,pos,pre_ch_val);
if ch_val <> 'e' and (pre_ch_val <> 'i' and ch_val <> 'o') then
cut_word(long <:nary:>,4);
end
else
if last_3(1) = long <:ogy:> then
cut_word(long <:ogy:>,3)
else
if last_6(1) = long <:raphe:> add 'r' then
cutword(long <:raphe:> add 'r',6)
else
if last_5(1) = long <:raphy:> then
cutword(long <:raphy:>,5)
else
if last_6(1) = long <:sciou:> add 's' then
cutword(long <:sciou:> add 's',6)
else
if last_6(1) = long <:scopi:> add 'c' then
cutword(long <:scopi:> add 'c',6)
else
if last_4(1) = long <:sion:> then
cutword(long <:sion:>,4)
else
if last_6(1) = long <:spher:> add 'e' then
cutword(long <:spher:> add 'e',6)
else
if last_3(1) = long <:tal:> then
cutword(long <:tal:>,3)
else
if last_4(1) = long <:tial:> then
cutword(long <:tial:>,4)
else
if last_4(1) = long <:tion:> then
cutword(long <:tion:>,4)
else
if last_5(1) = long <:tions:> then
cutword(long <:tions:>,5)
else
if last_6(1) = long <:tiona:> add 'l' then
begin
found := true;
pos := 1;
suffix(1) := suffix(2) := 0;
puttext(suffix,pos,<:tion:>);
putchar(suffix,pos,hyphenation_char);
puttext(suffix,pos,<:al:>);
gettext(word,1,rest_word,lgh - 6);
end
else
if last_4(1) = long <:tive:> then
cutword(long <:tive:>,4)
else
if last_4(1) = long <:ture:> then
cutword(long <:ture:>,4)
else
if last_3(1) = long <:ing:> then
begin
if lgh >= 7 then
begin
pos := lgh - 3;
getchar(word,pos,ch_val); <* preceded letter *>
pos := lgh - 4;
getchar(word,pos,pre_ch_val);
if ch_val = pre_ch_val and
char_in_set(false add ch_val,<:consonant:>) and
-, char_in_set(false add ch_val,<:flsz:>) then
begin
found := true;
pos := 1;
suffix(1) := 0;
putchar(suffix,pos,ch_val);
puttext(suffix,pos,<:ing:>);
gettext(word,1,rest_word,lgh - 4);
end
else
if ch_val <> 'l' then
cutword(long <:ing:>,3)
else
begin
pos := lgh - 5;
getchar(word,pos,ch_val);
if char_in_set(false add pre_ch_val,<:bcdfgkptz:>) then
begin
if pre_ch_val = 'k' and ch_val = 'c' then
begin <* -ckling *>
cutword(long <:ling:>,4);
end
else
begin
suffix(1) := suffix(2) := 0;
pos := 1;
putchar(suffix,pos,pre_ch_val);
puttext(suffix,pos,<:ling:>);
gettext(word,1,rest_word,lgh - 5);
found := true;
end;
end
else
cutword(long <:ing:>,3);
end;
end lgh >= 7;
end <:ing:>;
end
else
begin <* danish *>
count := 0;
no_of_suffixes := 9;
repeat
count := count + 1;
found := string_in_word((case count of (
<:dom:>,
<:mæssig:>,
<:ning:>,
<:punkt:>,
<:udstyr:>,
<:varig:>,
<:værdig:>,
<:ændring:>,
<:årig:>
)),word,start,next)
until found or count = no_of_suffixes;
if found then
found := next + 3 >= lgh;
if found then
found := start > 2;
if found then
begin
suffix(1) := suffix(2) := 0;
i := start;
gettext(word,i,suffix,lgh - i + 1);
gettext(word,1,rest_word,start - 1);
end;
end danish;
suffix_removal := found;
end suffix_removal;
\f
boolean procedure prefix_removal(word,lgh,prefix,rest_word,try_again);
value lgh;
long array word,prefix,rest_word;
integer lgh;
boolean try_again;
begin
procedure cut_word(pref,lg);
value pref,lg;
long pref;
integer lg;
begin
integer pos;
found := true;
prefix(1) := pref;
prefix(2) := 0;
pos := lg + 1;
gettext(word,pos,rest_word,lgh - lg);
end cut_word;
procedure cut_with_hyphen(p1,p2,lg);
value p1,p2,lg;
long p1,p2;
integer lg;
begin
integer pos;
found := true;
prefix(1) := prefix(2) := 0;
pos := 1;
puttext(prefix,pos,string p1);
putchar(prefix,pos,hyphenation_char);
puttext(prefix,pos,string p2);
pos := lg + 1;
gettext(word,pos,rest_word,lgh - lg);
end cut_with_hyphen;
long array first_1,first_2,first_3,first_4,first_5,first_6,
_ first_7,first_8(1:2);
integer pos,i,ch_val;
boolean found;
for i := 1,2 do
first_1(i) := first_2(i) := first_3(i) :=
first_4(i) := first_5(i) := first_6(i) :=
first_7(i) := first_8(i) := 0;
for i := 1 step 1 until 8 do
begin <* init possible prefixes *>
if i + 1 < lgh then
begin
case i of
begin
gettext(word,1,first_1,i);
gettext(word,1,first_2,i);
gettext(word,1,first_3,i);
gettext(word,1,first_4,i);
gettext(word,1,first_5,i);
gettext(word,1,first_6,i);
gettext(word,1,first_7,i);
gettext(word,1,first_8,i);
end;
end;
end;
found := try_again := false;
<* look for a known prefix *>
if english then
begin
if first_2(1) = long <:be:> then
begin
getchar(word,3,ch_val);
if char_in_set(false add ch_val,<:chsw:>) then
cutword(long <:be:>,2);
end
else
if first_3(1) = long <:com:> then
cutword(long <:com:>,3)
else
if first_3(1) = long <:con:> then
cutword(long <:con:>,3)
else
if first_3(1) = long <:dis:> then
begin
getchar(word,4,ch_val);
if ch_val <> 'h' and ch_val <> 'y' then
begin
cutword(long <:dis:>,3);
try_again := true;
end;
end
else
if first_4(1) = long <:equi:> then
begin
getchar(word,5,ch_val);
if ch_val <> 'v' then
cutword(long <:equi:>,4)
else
cutword(long <:equiv:>,5);
end
else
if first_2(1) = long <:ex:> then
cutword(long <:ex:>,2)
else
if first_4(1) = long <:hand:> then
cutword(long <:hand:>,4)
else
if first_5(1) = long <:horse:> then
cutword(long <:horse:>,5)
else
if first_5(1) = long <:hyper:> then
cut_with_hyphen(long <:hy:>,long <:per:>,5)
else
if first_2(1) = long <:im:> then
begin
cutword(long <:im:>,2);
try_again := true;
end
else
if first_2(1) = long <:in:> then
begin
found := true;
try_again := true;
if first_5(1) = long <:inter:> then
cut_with_hyphen(long <:in:>,long <:ter:>,5)
else
if first_5(1) = long <:intro:> then
cut_with_hyphen(long <:in:>,long <:tro:>,5)
else
cutword(long <:in:>,2);
end
else
if first_4(1) = long <:lexi:> then
cut_with_hyphen(long <:lex:>,long <:i:>,4)
else
if first_5(1) = long <:macro:> then
cut_with_hyphen(long <:mac:>,long <:ro:>,5)
else
if first_5(1) = long <:mathe:> then
cut_with_hyphen(long <:math:>,long <:e:>,5)
else
if first_4(1) = long <:maxi:> then
cut_with_hyphen(long <:max:>,long <:i:>,4)
else
if first_4(1) = long <:mini:> then
cut_with_hyphen(long <:min:>,long <:i:>,4)
else
if first_5(1) = long <:multi:> then
cut_with_hyphen(long <:mul:>,long <:ti:>,5)
else
if first_3(1) = long <:non:> then
begin
cutword(long <:non:>,3);
try_again := true;
end
else
if first_3(1) = long <:out:> then
cutword(long <:out:>,3)
else
if first_4(1) = long <:over:> then
begin
cutword(long <:over:>,4);
try_again := true;
end
else
if first_3(1) = long <:pre:> then
begin
getchar(word,4,ch_val);
getchar(word,5,i);
if char_in_set(false add ch_val,<:cdefhlopr:>) or
ch_val = 's' and i <> 's' or ch_val = 't' and i <> 't' then
cutword(long <:pre:>,3);
end
else
if first_3(1) = long <:pro:> then
begin
getchar(word,4,ch_val);
if char_in_set(false add ch_val,<:cdfghjpstv:>) then
cutword(long <:pro:>,3);
end
else
if first_6(1) = long <:pseud:> add 'o' then
cut_with_hyphen(long <:pseu:>,long <:do:>,6)
else
if first_4(1) = long <:quad:> then
cutword(long <:quad:>,4)
else
if first_4(1) = long <:semi:> then
cutword(long <:semi:>,4)
else
if first_4(1) = long <:some:> then
cutword(long <:some:>,4)
else
if first_3(1) = long <:sub:> then
cutword(long <:sub:>,3)
else
if first_5(1) = long <:super:> then
cut_with_hyphen(long <:su:>,long <:per:>,5)
else
if first_4(1) = long <:tele:> then
cutword(long <:tele:>,4)
else
if first_5(1) = long <:there:> then
cutword(long <:there:>,5)
else
if first_5(1) = long <:trans:> then
begin
getchar(word,6,ch_val);
if char_in_set(false add ch_val,<:afglm:>) then
cutword(long <:trans:>,5);
end
else
if first_3(1) = long <:tri:> then
begin
getchar(word,4,ch_val);
if char_in_set(false add ch_val,<:afu:>) then
cutword(long <:tri:>,3);
end
else
if first_5(1) = long <:under:> then
cut_with_hyphen(long <:un:>,long <:der:>,5)
else
if first_2(1) = long <:un:> then
begin
getchar(word,3,ch_val);
if ch_val <> 'i' and ch_val <> 'd' then
begin
try_again := true;
cutword(long <:un:>,2);
end;
end;
end
else
begin <* danish *>
if first_2(1) = long <:ad:> then
cutword(long <:ad:>,2)
else
if first_2(1) = long <:af:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:af:>,2);
end
else
if first_2(1) = long <:al:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:al:>,2);
end
else
if first_2(1) = long <:an:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:an:>,2);
end
else
if first_4(1) = long <:bede:> then
cut_with_hyphen(long <:be:>,long <:de:>,4)
else
if first_6(1) = long <:bedst:> add 'e' then
cut_with_hyphen(long <:bed:>,long <:ste:>,6)
else
if first_2(1) = long <:be:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:jnr:>) then
cutword(long <:be:>,2);
end
else
if first_5(1) = long <:brugs:> then
cutword(long <:brugs:>,5)
else
if first_4(1) = long <:dags:> then
begin
getchar(word,5,ch_val);
if ch_val <> 'k' then
cutword(long <:dags:>,4);
end
else
if first_3(1) = long <:dag:> then
begin
getchar(word,4,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:dag:>,3);
end
else
if first_4(1) = long <:data:> then
cut_with_hyphen(long <:da:>,long <:ta:>,4)
else
if first_3(1) = long <:der:> then
cutword(long <:der:>,3)
else
if first_3(1) = long <:des:> then
begin
getchar(word,4,ch_val);
if ch_val <> 'e' then
cut_word(long <:des:>,3);
end
else
if first_2(1) = long <:de:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:jln:>) then
cut_word(long <:de:>,2);
end
else
if first_8(1) = long <:erhve:> add 'r' and first_8(2) = long <:vs:> then
begin
found := true;
prefix(1) := long <:erhve:> add 'r';
prefix(2) := long <:vs:>;
gettext(word,9,rest_word,lgh - 8);
end
else
if first_4(1) = long <:fore:> then
cut_with_hyphen(long <:fo:>,long <:re:>,4)
else
if first_3(1) = long <:for:> then
cutword(long <:for:>,3)
else
if first_4(1) = long <:vagt:> then
cutword(long <:vagt:>,4)
else
if first_3(1) = long <:hen:> then
cutword(long <:hen:>,3)
else
if first_3(1) = long <:her:> then
cutword(long <:her:>,3)
else
if first_3(1) = long <:ind:> then
begin
getchar(word,4,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:ind:>,3);
end
else
if first_2(1) = long <:in:> then
cutword(long <:in:>,2)
else
if first_4(1) = long <:lige:> then
cut_with_hyphen(long <:li:>,long <:ge:>,4)
else
if first_3(1) = long <:med:> then
begin
getchar(word,4,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:med:>,3);
end
else
if first_3(1) = long <:ned:> then
cutword(long <:ned:>,3)
else
if first_4(1) = long <:nord:> then
cutword(long <:nord:>,4)
else
if first_2(1) = long <:om:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:om:>,2);
end
else
if first_2(1) = long <:op:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) then
cutword(long <:op:>,2);
end
else
if first_4(1) = long <:oven:> then
cutword(long <:oven:>,4)
else
if first_4(1) = long <:over:> then
cutword(long <:over:>,4)
else
if first_2(1) = long <:på:> then
cutword(long <:på:>,2)
else
if first_2(1) = long <:re:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:bdgjkmnstuv:>) then
cutword(long <:re:>,2);
end
else
if first_3(1) = long <:sam:> then
cutword(long <:sam:>,3)
else
if first_4(1) = long <:selv:> then
cutword(long <:selv:>,4)
else
if first_2(1) = long <:så:> then
cutword(long <:så:>,2)
else
if first_4(1) = long <:tele:> then
cut_with_hyphen(long <:te:>,long <:le:>,4)
else
if first_3(1) = long <:til:> then
cutword(long <:til:>,3)
else
if first_2(1) = long <:ud:> then
begin
getchar(word,3,ch_val);
if -, char_in_set(false add ch_val,<:vowel:>) or ch_val = 'o' then
cutword(long <:ud:>,2);
end
else
if first_5(1) = long <:under:> then
cut_with_hyphen(long <:un:>,long <:der:>,5)
else
if first_5(1) = long <:veder:> then
cut_with_hyphen(long <:ve:>,long <:der:>,5)
else
if first_3(1) = long <:vel:> then
cutword(long <:vel:>,3)
else
if first_3(1) = long <:øje:> then
begin
getchar(word,4,ch_val);
if ch_val <> 'n' then
cutword(long <:øje:>,3);
end;
end danish;
prefix_removal := found;
end prefix_removal;
\f
boolean procedure midfix_removal(word,lgh,pos);
long array word;
integer lgh,pos;
begin
integer count,no_of_midfixes,start,next,i,extra_condition,ch;
boolean found;
no_of_midfixes := 14;
count := 0;
repeat
count := count + 1;
found := string_in_word((case count of (
<:brugs:>,
<:dags:>,
<:dag:>,
<:elses:>,
<:else:>,
<:erhvervs:>,
<:fore:>,
<:for:>,
<:ings:>,
<:ing:>,
<:ions:>,
<:ion:>,
<:sels:>,
<:tets:>
)),word,start,next);
if found then found := next + 1 <= lgh
until found or count = no_of_midfixes;
if found then
found := next + 1 <= lgh;
if found then
begin
extra_condition := case count of (
0,
1,
2,
0,
5,
0,
3,
0,
0,
4,
0,
2,
1,
0
);
i := next;
if extra_condition <> 0 then
begin
case extra_condition of
begin
begin <* 1. next letter <> "k" *>
getchar(word,i,ch);
found := ch <> 'k';
end;
begin <* 2. next letter not a vowel *>
getchar(word,i,ch);
found := char_in_set(false add ch,<:consonant:>);
end;
begin <* 3. next letter <> "n" *>
getchar(word,i,ch);
found := ch <> 'n';
end;
begin <* 4. midfix = "ing" - special *>
getchar(word,i,ch);
if char_in_set(false add ch,<:consonant:>) then
next := next - 1; <* in_g *>
end;
begin <* 5. next letter <> "r" *>
getchar(word,i,ch);
found := ch <> 'r';
end;
end case;
end;
pos := next;
end;
midfix_removal := found;
end midfix_removal;
\f
boolean procedure consonant_pair_study(word,result);
long array word,result;
begin
long pair,comb;
integer lgh,i,vowel_pos,next_vowel_pos,result_pos;
boolean array test(1:max_word_length);
boolean found,finish,spec_1,spec_2,finis;
long array help,help_1(1:(max_word_length + 5) // 6);
found := false;
lgh := puttext(test,1,word);
gettext(word,1,help,lgh);
finish := false;
result_pos := 1;
if english then
begin
if first_vowel(help,vowel_pos) then
begin
repeat
if vowel_pos + 3 > lgh then
begin
finish := true;
puttext(result,result_pos,help);
end
else
if test(vowel_pos + 1) extract 8 = test(vowel_pos + 2) extract 8 then
begin <* two equal letters *>
if char_in_set(test(vowel_pos + 1),<:consonant:>) then
begin
if test(vowel_pos + 1) extract 8 <> 'l' and
test(vowel_pos + 1) extract 8 <> 's' and
vowel_pos + 3 <> lgh then
begin <* break between the consonants *>
puttext(result,result_pos,help,vowel_pos + 1);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 2;
gettext(test,i,help,lgh - i + 1);
end
else
begin
if char_in_set(test(vowel_pos + 3),<:vowel:>) then
begin
if vowel_pos + 4 = lgh and test(vowel_pos + 3) extract 8 =
'e' and test(vowel_pos + 4) extract 8 = 'r'
or
vowel_pos + 5 = lgh and test(vowel_pos + 3) extract 8 = 'e'
and test(vowel_pos + 4) extract 8 = 'r' and
test(vowel_pos + 5) extract 8 = 's' then
begin <* no break *>
puttext(result,result_pos,help,vowel_pos);
i := vowel_pos + 1;
gettext(test,i,help,lgh - i + 1);
end
else
begin <* break between the consonants *>
puttext(result,result_pos,help,vowel_pos + 1);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 2;
gettext(test,i,help,lgh - i + 1);
end;
end
else
begin <* no break *>
puttext(result,result_pos,help,vowel_pos);
i := vowel_pos + 1;
gettext(test,i,help,lgh - i + 1);
end;
end;
end
else
begin <* no break *>
puttext(result,result_pos,help,vowel_pos);
i := vowel_pos + 1;
gettext(test,i,help,lgh - i + 1);
end;
end
else
if test(vowel_pos + 1) extract 8 = 'c' and test(vowel_pos + 2) extract 8 = 'k' then
begin
puttext(result,result_pos,help,vowel_pos + 2);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 3;
gettext(test,i,help,lgh - i + 1);
end
else
if test(vowel_pos + 1) extract 8 = 'q' and test(vowel_pos + 2) extract 8 = 'u' then
begin
puttext(result,result_pos,help,vowel_pos);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 1;
gettext(test,i,help,lgh - i + 1);
end
else
begin
i := vowel_pos + 1;
gettext(test,i,help_1,lgh - i + 1);
if -, first_vowel(help_1,next_vowel_pos) then
begin
puttext(result,result_pos,help);
finish := true;
end
else
begin
next_vowel_pos := next_vowel_pos + vowel_pos;
if next_vowel_pos - vowel_pos > 5 or next_vowel_pos - vowel_pos < 3 then
begin
puttext(result,result_pos,help,next_vowel_pos - 1);
gettext(test,next_vowel_pos,help,lgh - next_vowel_pos + 1);
end
else
begin
spec_1 := special_consonant(help,vowel_pos + 1);
spec_2 := special_consonant(help,vowel_pos + (
_ if spec_1 then 3 else 2));
if -, (spec_1 or spec_2) and next_vowel_pos - vowel_pos > 3 or
spec_1 and spec_2 and next_vowel_pos - vowel_pos <> 5 or
((spec_1 and -, spec_2 or -, spec_1 and spec_2) and
next_vowel_pos - vowel_pos <> 4) then
begin <* no consonant pair *>
puttext(result,result_pos,help,next_vowel_pos - 1);
gettext(test,next_vowel_pos,help,lgh - next_vowel_pos + 1);
end
else
begin <* check the consonant pair *>
if -, (spec_1 or spec_2) then
begin
pair := extend (test(vowel_pos + 1) extract 8) shift 40 +
_ extend (test(vowel_pos + 2) extract 8) shift 32;
for i := 1,i + 1 while -, found and i < 26 do
found := pair = long (case i of (
<:bl:>,<:br:>,<:cl:>,<:cr:>,<:dg:>,<:dr:>,<:fl:>,<:fr:>,
<:gl:>,<:gr:>,<:kn:>,<:lk:>,<:lq:>,<:nk:>,<:nx:>,<:pl:>,
<:pr:>,<:rk:>,<:sp:>,<:sq:>,<:tr:>,<:wh:>,<:wl:>,<:wn:>,<:wr:>));
if found then
begin <* no break *>
puttext(result,result_pos,help,next_vowel_pos - 1);
gettext(test,next_vowel_pos,help,lgh - next_vowel_pos + 1);
end
else
begin <* check word ending with special pairs *>
for i := 1,i + 1 while -, found and i < 13 do
found := pair = long (case i of (
<:ft:>,<:ld:>,<:mp:>,<:nd:>,<:ng:>,<:ns:>,
<:nt:>,<:rg:>,<:rm:>,<:rn:>,<:rt:>,<:st:>));
if found then
begin
if next_vowel_pos + 1 = lgh and test(next_vowel_pos) extract 8 = 'e' and
test(next_vowel_pos + 1) extract 8 = 'd'
or next_vowel_pos + 1 = lgh and test(next_vowel_pos) extract 8 = 'e'
and test(next_vowel_pos + 1) extract 8 = 'r'
or
next_vowel_pos + 2 = lgh and test(next_vowel_pos) extract 8 = 'e' and
test(next_vowel_pos + 1) extract 8 = 'r' and
test(next_vowel_pos + 2) extract 8 = 's'
or
next_vowel_pos + 2 = lgh and test(next_vowel_pos) extract 8 = 'a' and
test(next_vowel_pos + 1) extract 8 = 'g' and
test(next_vowel_pos + 2) extract 8 = 'e'
or
next_vowel_pos + 3 = lgh and test(next_vowel_pos) extract 8 = 'a' and
test(next_vowel_pos + 1) extract 8 = 'g' and
test(next_vowel_pos + 2) extract 8 = 'e' and
test(next_vowel_pos + 3) extract 8 = 's' then
begin <* no break - believe it or not *>
puttext(result,result_pos,help,next_vowel_pos - 1);
gettext(test,next_vowel_pos,help,lgh - next_vowel_pos + 1);
end
else
begin <* break between consonants *>
puttext(result,result_pos,help,vowel_pos + 1);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 2;
gettext(test,i,help,lgh - i + 1);
end;
end
else
begin <* break between consonants *>
puttext(result,result_pos,help,vowel_pos + 1);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 2;
gettext(test,i,help,lgh - i + 1);
end;
end;
end
else
begin <*special consonant pair *>
if spec_1 and spec_2 then
begin <* break between special consonants *>
puttext(result,result_pos,help,vowel_pos + 2);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 3;
gettext(test,i,help,lgh - i + 1);
end
else
if spec_1 then
begin
pair := extend (test(vowel_pos+1) extract 8) shift 40 +
_ extend (test(vowel_pos+2) extract 8) shift 32;
i := test(vowel_pos + 3) extract 8;
if pair = long <:ch:> and (i = 'l' or i = 'r') or
pair = long <:gh:> and i = 't' or pair = long <:ph:> and
i = 'r' or pair = long <:th:> and i = 'r' then
begin <* no break *>
puttext(result,result_pos,help,next_vowel_pos - 1);
gettext(test,next_vowel_pos,help,lgh - next_vowel_pos + 1);
end
else
begin
puttext(result,result_pos,help,vowel_pos + 2);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 3;
gettext(test,i,help,lgh - i + 1);
end;
end
else
begin <* spec_2 is true *>
if test(vowel_pos + 2) extract 8 = 'c' and
char_in_set(test(vowel_pos+1),<:nt:>) or
test(vowel_pos+2) extract 8 = 't' and
test(vowel_pos+1) extract 8 = 'l' then
begin <* no break *>
puttext(result,result_pos,help,next_vowel_pos - 1);
gettext(test,next_vowel_pos,help,lgh - next_vowel_pos + 1);
end
else
begin
puttext(result,result_pos,help,vowel_pos + 1);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 2;
gettext(test,i,help,lgh - i + 1);
end;
end;
end special;
end consonant_pair_check;
end;
end vowel found;
end;
if -, finish then
begin
if first_vowel(help,vowel_pos) then
lgh := puttext(test,1,help)
else
begin
finish := true;
puttext(result,result_pos,help);
end;
end
until finish;
end <* if first vowel *>
else
puttext(result,result_pos,help);
end
else
begin <* danish *>
finis := false;
repeat
lgh := puttext(test,1,word);
if -, first_vowel(word,vowel_pos) or lgh < 3 then
begin
puttext(result,result_pos,word);
finis := true;
end
else
begin
i := vowel_pos + 1;
if i >= lgh then
begin
finis := true;
puttext(result,result_pos,word);
end
else
begin
gettext(word,i,help_1,lgh - vowel_pos);
if -, first_vowel(help_1,next_vowel_pos) then
begin
puttext(result,result_pos,word);
finis := true;
end
else
begin
next_vowel_pos := next_vowel_pos + vowel_pos;
i := next_vowel_pos - vowel_pos;
if i > 4 then
i := 4;
case i of
begin
begin <* 1. No consonants between vowels *>
if test(vowel_pos) extract 8 = 'e' and
test(next_vowel_pos) extract 8 = 'a' and
test(next_vowel_pos+1) extract 8 = 'u' then
begin <* no break *>
puttext(result,result_pos,word,next_vowel_pos);
gettext(test,next_vowel_pos + 1,word,lgh - next_vowel_pos);
end
else
if letter_break(test(vowel_pos) extract 8,test(next_vowel_pos) extract 8)
_ extract 6 = 0 then
begin <* no break *>
puttext(result,result_pos,word,vowel_pos);
gettext(test,next_vowel_pos,word,lgh - next_vowel_pos + 1);
end
else
begin <* break between the vowels *>
puttext(result,result_pos,word,vowel_pos);
putchar(result,result_pos,hyphenation_char);
gettext(test,next_vowel_pos,word,lgh - next_vowel_pos + 1);
end;
end case 1;
begin <* 2. One cosonant between vowels *>
if test(vowel_pos+1) extract 8 = 'x' then
begin <* break after the "x" *>
puttext(result,result_pos,word,vowel_pos + 1);
putchar(result,result_pos,hyphenation_char);
gettext(test,next_vowel_pos,word,lgh - next_vowel_pos + 1);
end
else
if safety > 4 and char_in_set(test(vowel_pos+1),<:lnrst:>) or
safety > 2 and char_in_set(test(vowel_pos+1),<:ls:>) then
begin <* no break *>
puttext(result,result_pos,word,vowel_pos + 1);
gettext(test,next_vowel_pos,word,lgh - next_vowel_pos + 1);
end
else
begin <* break before the consonant *>
puttext(result,result_pos,word,vowel_pos);
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + 1;
gettext(test,i,word,lgh - i + 1);
end;
end case 2;
begin <* 3. Two consonants between vowels *>
comb := extend (test(vowel_pos+1) extract 8) shift 40 +
_ extend (test(vowel_pos+2) extract 8) shift 32;
for i := 1,i+1 while i < 11 and -, found do
found := comb = long (case i of (
_ <:ch:>,<:fl:>,<:fr:>,<:hj:>,<:hv:>,<:kv:>,<:sc:>,<:sp:>,<:st:>,<:sk:>));
if found and safety > 4 and (comb = long <:st:> or comb = long <:fr:>) then
begin
puttext(result,result_pos,word,next_vowel_pos - 1);
gettext(test,next_vowel_pos,word,lgh - next_vowel_pos + 1);
end
else
begin
puttext(result,result_pos,word,vowel_pos + (
if found then 0 else 1));
putchar(result,result_pos,hyphenation_char);
i := vowel_pos + (if found then 1 else 2);
gettext(test,i,word,lgh - i + 1);
end;
end case 3;
begin <* 4. Three or more consonants between vowels *>
<* get the rightmost 3 consonants *>
comb := extend (test(next_vowel_pos-3) extract 8) shift 40 +
_ extend (test(next_vowel_pos-2) extract 8) shift 32 +
_ extend (test(next_vowel_pos-1) extract 8) shift 24;
for i := 1,i+1 while i < 5 and -, found do
found := comb = long (case i of (
_ <:ngl:>,<:ngr:>,<:rgl:>,<:rgr:>));
if found then
begin <* break before the rightmost consonant *>
puttext(result,result_pos,word,next_vowel_pos - 2);
putchar(result,result_pos,hyphenation_char);
i := next_vowel_pos - 1;
gettext(test,i,word,lgh - i + 1);
end
else
begin
for i := 1,i+1 while i < 9 and -, found do
found := comb = long (case i of (
_ <:sch:>,<:skj:>,<:skr:>,<:skv:>,
_ <:spj:>,<:spl:>,<:stj:>,<:str:>));
if found then
begin <* break before the rightmost 3 consonants *>
puttext(result,result_pos,word,next_vowel_pos - 4);
putchar(result,result_pos,hyphenation_char);
i := next_vowel_pos - 3;
gettext(test,i,word,lgh - i + 1);
end
else
begin
<* get the rightmost 2 consonants *>
comb := comb shift 8;
for i := 1,i+1 while i < 38 and -, found do
found := comb = long (case i of (
_ <:bj:>,<:bl:>,<:br:>,<:ch:>,<:dj:>,<:dr:>,<:dv:>,
_ <:fj:>,<:fl:>,<:fn:>,<:fr:>,<:gj:>,<:gl:>,<:gn:>,
_ <:gr:>,<:hj:>,<:hv:>,<:kj:>,<:kl:>,<:kn:>,<:kr:>,
_ <:kv:>,<:pj:>,<:pl:>,<:pr:>,<:sj:>,<:sk:>,<:sl:>,
_ <:sm:>,<:sn:>,<:sp:>,<:st:>,<:sv:>,<:tj:>,<:tr:>,
_ <:tv:>,<:vr:>));
if found and comb shift (-40) extract 8 = 's' and
safety > 4 then
begin <* no break *>
puttext(result,result_pos,word,next_vowel_pos - 1);
gettext(test,next_vowel_pos,word,lgh - next_vowel_pos + 1);
end
else
begin
puttext(result,result_pos,word,next_vowel_pos - (
if found then 3 else 2));
putchar(result,result_pos,hyphenation_char);
i := next_vowel_pos - (if found then 2 else 1);
gettext(test,i,word,lgh - i + 1);
end;
end;
end;
end case 4;
end case;
end;
end;
end
until finis;
end danish;
putchar(result,result_pos,0);
i := puttext(test,1,result);
consonant_pair_study := i <> lgh;
end consonant_pair_study;
\f
procedure retain_short_ends(word);
long array word;
begin
boolean array help(1:max_word_length);
integer lgh,i;
lgh := puttext(help,1,word);
if lgh > 2 then
begin
if help(lgh - 1) extract 8 = hyphenation_char then
begin
help(lgh - 1) := help(lgh);
help(lgh) := false;
gettext(help,1,word,lgh - 1);
end
else
if help(lgh - 2) extract 8 = hyphenation_char and english then
begin
help(lgh - 2) := help(lgh - 1);
help(lgh - 1) := help(lgh);
help(lgh) := false;
gettext(help,1,word,lgh - 1);
end;
if help(2) extract 8 = hyphenation_char then
begin
lgh := puttext(help,1,word);
for i := 2 step 1 until lgh - 1 do
help(i) := help(i + 1);
help(lgh) := false;
gettext(help,1,word,lgh - 1);
end;
end;
end retain_short_ends;
\f
<***************** variable declaration *****************>
long array word,result,rest_word,prefixes,suffixes(1:(max_word_length + 5) // 6),
_ prefix,suffix(1:2);
boolean array help,temp_result,source(1:max_word_length);
integer i,j,lgh,call_lgh,last_letter,suf_pos,pref_pos,
_ source_pos,result_pos,ch_class,ch_val,safety;
boolean found,try_again,finis,input_error;
\f
<*************************************************************>
<************** main procedure ---------- *******************>
<*************************************************************>
source_pos := result_pos := 1;
safety := hyphenation_safety_factor;
intable(0);
input_error := false;
for i := 1,i+1 while i <= max_word_length and -, finis do
begin
source(i) := false add call_word(i);
finis := call_word(i) = 0;
if call_word(i) > 127 then
input_error := true;
end;
source(max_word_length) := false;
call_lgh := i - 2;
if input_error then
begin
write(out,"nl",1,<:ROFF-error ...char <62> 127 : :>);
for i := 1,i+1 while call_word(i) <> 0 do
begin
result_word(i) := call_word(i);
if call_word(i) > 31 and call_word(i) < 127 then
outchar(out,call_word(i))
else
write(out,<:<60>:>,<<d>,call_word(i),<:<62>:>);
end;
write(out,"nl",1);
result_word(i) := 0;
hyphenation := false;
end
else
begin
repeat
pref_pos := 1;
suf_pos := max_word_length + 1;
repeat
ch_class := getchar(source,source_pos,ch_val);
if ch_class shift (-12) <> 6 then
putchar(temp_result,result_pos,ch_val)
until ch_val = 0 or ch_class shift (-12) = 6;
if ch_val <> 0 then
begin
for i := 1,2,3,4 do
word(i) := 0;
i := 1;
repeat
putchar(word,i,lower_case_conv,ch_val);
ch_class := getchar(source,source_pos,ch_val)
until ch_class shift (-12) <> 6;
source_pos := source_pos - 1;
putchar(word,i,0);
lgh := puttext(help,1,word);
if test then write(out,"nl",1,word,"sp",2,lgh);
last_letter := help(lgh) extract 8;
if test then write(out,"nl",1,<:last letter: :>,help(lgh),1);
found := try_again := false;
if -, exception_removal(word,result) then
begin
if last_letter = 's' and lgh > 2 and lgh <= 7 and english then
begin
for i := 1,2,3,4 do
prefixes(i) := 0;
gettext(word,1,prefixes,lgh - 1);
if exception_removal(prefixes,rest_word) then
begin
found := true;
i := 1;
puttext(result,i,rest_word);
putchar(result,i,'s');
putchar(result,i,0);
end;
end;
if -, found then
begin
if -, english and lgh > 6 then
begin
if midfix_removal(word,lgh,j) then
begin
try_again := true;
source_pos := source_pos - lgh;
for i := max_word_length step -1 until source_pos + j do
source(i) := source(i-1);
source(source_pos + j - 1) := false add hyphenation_char;
ch_val := source(source_pos) extract 8;
end;
end;
if -, try_again then
begin
if test then write(out,"nl",1,<:before suffix :>,word,"sp",2,lgh);
repeat
if suffix_removal(word,lgh,suffix,rest_word,try_again) then
begin
i := puttext(help,1,suffix) + 1;
suf_pos := j := suf_pos - i;
putchar(suffixes,j,hyphenation_char);
puttext(suffixes,j,suffix);
i := 1;
lgh := puttext(word,i,rest_word);
putchar(word,i,0);
end
until -, try_again;
if test then write(out,"nl",1,<:before prefix :>,word,"sp",2,lgh);
if lgh > 4 then
repeat
if prefix_removal(word,lgh,prefix,rest_word,try_again) then
begin
puttext(prefixes,pref_pos,prefix);
putchar(prefixes,pref_pos,hyphenation_char);
i := 1;
lgh := puttext(word,i,rest_word);
putchar(word,i,0);
end
until -, try_again;
if test then write(out,"nl",1,<:before cons :>,word,"sp",2,lgh);
if lgh > 3 then
begin
consonant_pair_study(word,rest_word);
puttext(prefixes,pref_pos,rest_word);
end
else
if lgh > 0 then
puttext(prefixes,pref_pos,word);
j := 1;
puttext(result,j,prefixes,pref_pos - 1);
if suf_pos < max_word_length + 1 then
begin
gettext(suffixes,suf_pos,help,max_word_length + 1 - suf_pos);
if lgh = 0 then j := j - 1; <* remove an extra hyphenation-char *>
puttext(result,j,help);
end;
putchar(result,j,0);
end;
end if -, found;
end if -, exception_removal;
if -, try_again then
begin
retain_short_ends(result);
puttext(temp_result,result_pos,result);
end;
end
until ch_val = 0;
putchar(temp_result,result_pos,0);
i := 1;
lgh := puttext(help,i,temp_result);
putchar(help,i,0);
hyphenation := lgh <> call_lgh;
if test then write(out,"nl",1,<:call and return lgh :>,<< ddd>,call_lgh,lgh);
for i := 1,i + 1 while i <= max_word_length + 1 and -, finis do
begin
result_word(i) := help(i) extract 8;
finis := result_word(i) = 0;
end;
<* convert back possible small letters to capital letters *>
j := 0;
for i := 1 step 1 until lgh do
begin
if result_word(i) <> hyphenation_char then
begin
j := j + 1;
if result_word(i) <> call_word(j) then
result_word(i) := result_word(i) - 32;
end
else
if call_word(j+1) = hyphenation_char then
j := j + 1;
end;
end;
intable(table);
end hyphenation;
\f
procedure init_letter_break;
begin
integer i,j,dif,st;
st := 'a' - 1;
dif := 'å' - 'a' + 1;
for i := 'a' step 1 until 'å' do
for j := 'a' step 1 until 'å' do
letter_break(i,j) := false add (case ((i-st-1) * dif + j - st) of (
_ <*a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,æ,ø,å *>
<*a*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
<*b*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*c*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*d*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*e*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,1,
<*f*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*g*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*h*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*i*>1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*j*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*k*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*l*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*m*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*n*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*o*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,
<*p*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*q*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*r*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*s*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*t*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*u*>1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,1,1,
<*v*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*w*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*x*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*y*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,1,1,
<*z*>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
<*æ*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,1,1,
<*ø*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,1,1,
<*å*>1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,1,1
));
end init_letter_break;
▶EOF◀