~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to reports/ahnenliste.ll

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-08-14 00:02:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.4 gutsy)
  • Revision ID: james.westby@ubuntu.com-20070814000204-mpv5faygl0dgq3qi
Tags: 3.0.61-1
* New upstream release. (Closes: #387856).
* Fixing documentation build problems also fixes FTBFS if built twice in a
  row. (Closes: #424543).
* Adding lynx as a build dependency. This is necessary to generate txt files
  from html, discovered while fixing #424543.
* Upstream fix: charset for gedcom file in unicode. (Closes: #396206).
* Upstream fim: updating documentation about desc-tex2. (Closes: #405501).
* Bumping Standards-Version to 3.7.2 without package changes.
* Dropping local debian patches added upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * @progname    ahnenliste.ll
3
 
 * @version     4
 
3
 * @version     6
4
4
 * @author      Jim Eggert
5
5
 * @category
6
6
 * @output      Text
19
19
Change the routine write_header() to use your submitter tag, name,
20
20
and address.
21
21
 
22
 
Version 1, 14 July 1994, by Jim Eggert, EggertJ@crosswinds.net
 
22
Version 1, 14 July 1994, by Jim Eggert, EggertJ@verizon.net
23
23
Version 2, 18 Aug  1998, added HTML
24
24
Version 3, 17 Feb  1999, added surnames to location list
25
25
Version 4, 15 Jan  2000, fixed quicksort bug
 
26
Version 5, 26 Jan  2000, added sorting translation
 
27
Version 6, 22 Jun  2000, improved handling of intersecting lines
26
28
 
27
29
*/
28
30
 
33
35
global(a_list)
34
36
global(g_list)
35
37
global(ahn_table)
36
 
global(prev_table)
37
38
 
38
39
global(html)
39
40
global(sep)
43
44
global(unbold)
44
45
global(gt)
45
46
global(lt)
46
 
global(amp)
 
47
global(born)
 
48
global(bapt)
 
49
global(died)
 
50
global(burd)
 
51
global(marr)
 
52
 
 
53
global(sort_xlat)
 
54
global(html_xlat)
 
55
global(ISO8859_xlat)
47
56
 
48
57
/* write_header writes a little header */
49
58
 
50
59
proc write_header(person) {
51
 
 
52
60
  sep
53
61
  if (html) { "<H1>" }
54
 
  "Ahnenliste " surname(person) "\n"
 
62
  "Ahnenliste " autohtml(mysurname(person)) "\n"
55
63
  if (html) { "</H1>" }
56
64
  sep "\n"
57
 
  bold "Proband:" unbold " " fullname(person,0,1,80) br
58
 
  bold "Autor:" unbold "   " getproperty("user.fullname") par
 
65
  bold "Proband:" unbold " " autohtml(fullname(person,0,1,80)) br
 
66
  bold "Autor:" unbold "   James R. Eggert" par
59
67
  bold "Inhalt:" unbold br
60
68
  if (html) { "   Erl&auml;uterungen," }
61
69
  else { "   Erl\"auterungen," }
66
74
  ", Berichtigungen, Anfragen oder Kommentare werden als\n"
67
75
  "eMail erbeten an:" br
68
76
  if (html) {
69
 
    "<A HREF=\"MAILTO:" getproperty("user.email") "\"> " 
70
 
    getproperty("user.fullname") " </A>"
71
 
    "(" getproperty("user.email") ")"
 
77
    "<A HREF=\"MAILTO:EggertJ@verizon.net\">Jim Eggert</A>"
 
78
    "(EggertJ@verizon.net)"
72
79
  } else {
73
 
    getproperty("user.fullname") "(" getproperty("user.email") ")"
 
80
    "Jim Eggert (EggertJ@verizon.net)"
74
81
  }
75
82
  par
76
83
  dayformat(1)
83
90
 
84
91
  "Die genealogischen Zeichen wurden durch folgende Satzzeichen ersetzt:" br
85
92
 
86
 
  "   * -- geboren" br
87
 
  "   = -- getauft" br
88
 
  "   + -- gestorben" br
89
 
  "   # -- begraben" br
90
 
  "   " amp " -- verheiratet" br br
 
93
  "   " born " -- geboren" br
 
94
  "   " bapt " -- getauft" br
 
95
  "   " died " -- gestorben" br
 
96
  "   " burd " -- begraben" br
 
97
  "   " marr " -- verheiratet" br br
91
98
 
92
99
  "Die zweiteilige Nummer vor jeder Zahl setzt sich zusammen auf die\n"
93
100
  "Generation (bezogen auf den Probanden) und der Ordnungszahl im\n"
108
115
  call section("Landschaften")
109
116
 
110
117
  "deutsche Gebiete:  Hannover (Amt Dannenberg), Schaumburg-Lippe,\n"
111
 
  "  Provinz Posen, Westpreussen" br
 
118
  "  Provinz Posen, Westpreussen, Pfalz" br
112
119
  "US-amerikanische Bundesstaate:  Illinois, Kansas, Massachusetts,\n"
113
120
  "  Minnesota, Nebraska, New Jersey" br
114
121
  "Syrien" par
116
123
 
117
124
 
118
125
proc main() {
 
126
  table(sort_xlat)
 
127
  table(html_xlat)
 
128
  table(ISO8859_xlat)
 
129
  call init_xlat()
 
130
 
119
131
  getintmsg(html,"Enter 0 for text, 1 for HTML output:")
 
132
  set(born,"*")
 
133
  set(bapt,"=")
 
134
  set(died,"+")
 
135
  set(marr,"oo")
120
136
  if (html) {
121
137
    set(sep,"<HR>")
122
138
    set(par,"<P>\n")
125
141
    set(unbold,"</B>")
126
142
    set(gt,"&gt;")
127
143
    set(lt,"&lt;")
128
 
    set(amp,"&amp;")
 
144
    set(burd,"&plusmn;")
129
145
  } else {
130
146
    set(sep,
131
147
    "_________________________________________________________________\n")
135
151
    set(unbold,"")
136
152
    set(gt,">")
137
153
    set(lt,"<")
138
 
    set(amp,"&")
 
154
    set(burd,"�")
139
155
  }
140
156
 
141
157
  getindi(person)
154
170
  list(work_c_list)
155
171
  list(locationsurname_list)
156
172
  table(ahn_table)  /* holds all ancestors once, with ahnentafel numbers */
157
 
  table(prev_table) /* tracks previously output ancestors */
158
173
 
159
174
  enqueue(work_i_list, person)
160
175
  enqueue(work_a_list, 1)
171
186
    set(gen,dequeue(work_g_list))
172
187
    set(child,dequeue(work_c_list))
173
188
 
174
 
    call locations(person)
 
189
    if (not(lookup(ahn_table,key(person)))) { /* only do a person once */
 
190
      insert(ahn_table,key(person),ahnen)
 
191
      call locations(person)
175
192
/* test for inclusion of this individual as a root */
176
 
    if (child) { set(include,0) } else { set(include,1) }
177
 
    if (not(include)) {
178
 
      if (not(lookup(ahn_table,key(person)))) {
179
 
        insert(ahn_table,key(person),ahnen)
180
 
        if (male(person)) {
181
 
          if (strcmp(soundex(person),soundex(child))) {
182
 
            set(include,1)
183
 
          }
184
 
        }
185
 
        else {
186
 
          if (or(father(child),
187
 
                           strcmp(soundex(person),soundex(child)))) {
188
 
            set(include,1)
189
 
          }
190
 
        }
 
193
      set(include,0)
 
194
      if (child) {
 
195
        if (strcmp(soundex(person),soundex(child))) {
 
196
          set(include,1)
 
197
        } elsif (and(female(person),father(child))) {
 
198
            set(include,1)
 
199
        }
 
200
      } else { set(include,1) }
 
201
      if (include) {
 
202
        enqueue(i_list,person)
 
203
        insert(i_table,save(key(person)),ahnen)
 
204
        enqueue(a_list,ahnen)
 
205
        enqueue(g_list,gen)
 
206
        enqueue(s_list,save(mysurname(person)))
191
207
      }
192
 
    }
193
 
    if (include) {
194
 
      enqueue(i_list,person)
195
 
      insert(i_table,save(key(person)),ahnen)
196
 
      enqueue(a_list,ahnen)
197
 
      enqueue(g_list,gen)
198
 
      enqueue(s_list,save(surname(person)))
199
 
    }
200
208
 
201
209
/* iterate into working lists */
202
 
    incr(gen)
203
 
    set(ahnen,mul(ahnen,2))
204
 
    if (f,father(person)) {
205
 
      enqueue(work_i_list,f)
206
 
      enqueue(work_a_list,ahnen)
207
 
      enqueue(work_g_list,gen)
208
 
      enqueue(work_c_list,person)
209
 
    }
210
 
    if (m,mother(person)) {
211
 
      enqueue(work_i_list,m)
212
 
      enqueue(work_a_list,add(ahnen,1))
213
 
      enqueue(work_g_list,gen)
214
 
      enqueue(work_c_list,person)
 
210
      incr(gen)
 
211
      set(ahnen,mul(ahnen,2))
 
212
      if (f,father(person)) {
 
213
        enqueue(work_i_list,f)
 
214
        enqueue(work_a_list,ahnen)
 
215
        enqueue(work_g_list,gen)
 
216
        enqueue(work_c_list,person)
 
217
      }
 
218
      if (m,mother(person)) {
 
219
        enqueue(work_i_list,m)
 
220
        enqueue(work_a_list,add(ahnen,1))
 
221
        enqueue(work_g_list,gen)
 
222
        enqueue(work_c_list,person)
 
223
      }
215
224
    }
216
225
  }
217
226
 
218
227
  call section("Orte")
219
228
  list(index_list)
220
 
  call quicksort(locationsurname_list,index_list)
 
229
  list(trans_locsur_list)
 
230
  call translate(locationsurname_list,trans_locsur_list)
 
231
  call quicksort(trans_locsur_list,index_list)
221
232
  set(prevplace,"zzznowhere")
222
233
  set(prevsurname,"zzznoone")
223
234
  set(prevfirstplace,"zzznothere")
 
235
  set(yearfrom,9999)
 
236
  set(yearto,0)
224
237
  forlist(index_list,index,i) {
225
238
         set(locationsurname,getel(locationsurname_list,index))
226
239
         list(ls)
227
240
         extracttokens(locationsurname,ls,nls,":")
228
241
         set(location,getel(ls,1))
229
242
         set(surname,getel(ls,2))
 
243
         set(years,lookup(locationsurname_table,locationsurname))
230
244
    if (strcmp(location,prevplace)) {
231
 
      br
 
245
      if (strcmp(prevplace,"zzznowhere")) {
 
246
        if (yearto) {
 
247
          " ("
 
248
          if (ne(yearfrom,yearto)) {
 
249
            d(yearfrom) "-"
 
250
          }
 
251
          d(yearto) ")"
 
252
        }
 
253
        br
 
254
      }
 
255
      set(yearfrom,getel(years,1))
 
256
      set(yearto,getel(years,2))
232
257
      list(placenamelist)
233
258
      extracttokens(location,placenamelist,nplaces,",")
234
259
      set(name,getel(placenamelist,1))
238
263
      }
239
264
      set(prevfirstplace,save(name))
240
265
      forlist(placenamelist,placename,np) {
241
 
        placename
 
266
        autohtml(placename)
242
267
        if (lt(np,nplaces)) {
243
268
          if (eq(np,1)) { " - " } else { ", " }
244
269
        }
245
 
      } ":  " surname
 
270
      } ":  " autohtml(surname)
246
271
      set(prevplace,save(location))
247
272
      set(prevsurname,save(surname))
248
273
    } else {
249
274
      if (strcmp(surname,prevsurname)) {
250
 
        ", " surname
 
275
        ", " autohtml(surname)
251
276
        set(prevsurname,save(surname))
252
277
      }
253
 
    }
 
278
      if (thisyearfrom,getel(years,1)) {
 
279
        if (or(lt(thisyearfrom,yearfrom),eq(yearfrom,0))) {
 
280
          set(yearfrom,thisyearfrom)
 
281
        }
 
282
      }
 
283
      if (gt(getel(years,2),yearto)) {
 
284
        set(yearto,getel(years,2))
 
285
      }
 
286
    }
 
287
  }
 
288
  if (yearto) {
 
289
    " ("
 
290
    if (ne(yearfrom,yearto)) {
 
291
      d(yearfrom) "-"
 
292
    }
 
293
    d(yearto) ")"
254
294
  }
255
295
  br
256
296
 
257
297
  call section("Namen")
258
298
  list(index_list)
259
 
  call quicksort(s_list,index_list)
 
299
  list(trans_s_list)
 
300
  call translate(s_list,trans_s_list)
 
301
  call quicksort(trans_s_list,index_list)
260
302
  set(ni,length(index_list))
261
303
  set(prevname,"zzxxyyzz")
262
304
  set(comma,0)
263
305
  forlist(index_list,index,i) {
264
306
    set(name,getel(s_list,index))
265
307
    if (strcmp(name,prevname)) {
266
 
      if (comma) { ", " } name
 
308
      if (comma) { ", " } autohtml(name)
267
309
      set(comma,1)
268
310
      set(prevname,save(name))
269
311
    }
291
333
 
292
334
proc doline(person_index) {
293
335
  set(person,getel(i_list,person_index))
294
 
  if (not(lookup(prev_table,key(person)))) {
295
 
    sep
296
 
    if (html) { "<H3>" } else { "\n" }
 
336
  sep
 
337
  if (html) { "<H3>" } else { "\n" }
297
338
/* First pass to print out appropriate surnames */
298
 
    table(prev_surname_table)
299
 
    surname(person)
300
 
    insert(prev_surname_table,save(surname(person)),1)
301
 
    while (person,father(person)) {
302
 
      set(prev_ahn,lookup(i_table,key(person)))
303
 
      if (not(prev_ahn)) {
304
 
        set(prev_ahn,lookup(prev_table,key(person)))
305
 
      }
306
 
      if (prev_ahn) {
307
 
        set(person,0)
308
 
      } else {
309
 
        set(s,save(surname(person)))
310
 
        if (not(lookup(prev_surname_table,s))) {
311
 
          ", " s
312
 
          insert(prev_surname_table,s,1)
313
 
        }
 
339
  table(prev_surname_table)
 
340
  autohtml(mysurname(person))
 
341
  insert(prev_surname_table,save(mysurname(person)),1)
 
342
  while (person,father(person)) {
 
343
    if (lookup(i_table,key(person))) {
 
344
      set(person,0)
 
345
    } else {
 
346
      set(s,save(mysurname(person)))
 
347
      if (not(lookup(prev_surname_table,s))) {
 
348
        ", " autohtml(s)
 
349
        insert(prev_surname_table,s,1)
314
350
      }
315
351
    }
316
 
    if (html) { "</H3>" }
317
 
    "\n\n"
 
352
  }
 
353
  if (html) { "</H3>" }
 
354
  "\n\n"
318
355
 
319
356
/* Second pass to print out detailed information */
320
 
    set(person,getel(i_list,person_index))
321
 
    set(gen,getel(g_list,person_index))
322
 
    set(ahn,getel(a_list,person_index))
323
 
    call doperson(person,gen,ahn)
324
 
    while (person,father(person)) {
325
 
      incr(gen)
326
 
      set(ahn,add(ahn,ahn))
327
 
      set(prev_ahn,lookup(i_table,key(person)))
328
 
      if (not(prev_ahn)) {
329
 
        set(prev_ahn,lookup(prev_table,key(person)))
330
 
      }
331
 
      if (prev_ahn) {
332
 
        bold if (lt(gen,10)) { "0" } d(gen) " " d(ahn) unbold  " "
333
 
        fullname(person,0,1,80) " siehe "
334
 
        set(gen2,ahn2gen(prev_ahn))
335
 
        if (lt(gen2,10)) { "0" } d(gen2) " " d(prev_ahn) "." br
336
 
        set(person,0)
337
 
      } else {
338
 
        call doperson(person,gen,ahn)
339
 
        insert(prev_table,key(person),ahn)
340
 
      }
 
357
  set(person,getel(i_list,person_index))
 
358
  set(gen,getel(g_list,person_index))
 
359
  set(ahn,getel(a_list,person_index))
 
360
  call doperson(person,gen,ahn)
 
361
  while (person,father(person)) {
 
362
    incr(gen)
 
363
    set(ahn,add(ahn,ahn))
 
364
    set(prev_ahn,lookup(i_table,key(person)))    /* stop if person is a key... */
 
365
    if (not(prev_ahn)) {
 
366
      set(prev_ahn,lookup(ahn_table,key(person)))
 
367
      if (eq(prev_ahn,ahn)) { set(prev_ahn,0) }  /* or if we did them already */
 
368
    }
 
369
    if (prev_ahn) {
 
370
      bold if (lt(gen,10)) { "0" } d(gen) " " d(ahn) unbold  " "
 
371
      autohtml(fullname(person,0,1,80)) " siehe "
 
372
      set(gen2,ahn2gen(prev_ahn))
 
373
      if (lt(gen2,10)) { "0" } d(gen2) " " d(prev_ahn) "." br
 
374
      set(person,0)
 
375
    } else {
 
376
      call doperson(person,gen,ahn)
341
377
    }
342
378
  }
343
379
}
354
390
 
355
391
proc doperson(person,gen,ahn) {
356
392
  bold if (lt(gen,10)) { "0" } d(gen) " " d(ahn) unbold " "
357
 
  givens(person) set(comma,0)
 
393
  autohtml(mygivens(person)) set(comma,0)
358
394
 
359
395
  if (b,birth(person)) {
360
 
    " *" call doevent(b)
 
396
    " " born call doevent(b)
361
397
    set(comma,1)
362
398
  }
363
399
  if (b,baptism(person)) {
364
400
    if (comma) { "," }
365
 
    " =" call doevent(b)
 
401
    " " bapt call doevent(b)
366
402
    set(comma,1)
367
403
  }
368
404
  set(nfam,nfamilies(person))
370
406
    set(m,marriage(fam))
371
407
    if (or(m,spouse,gt(nfamilies,1))) {
372
408
      if (comma) { "," }
373
 
      " " amp if (gt(nfamilies,1)) { d(fnum) }
 
409
      " " marr if (gt(nfamilies,1)) { d(fnum) }
374
410
      if (m) { call doevent(m) }
375
 
      if (spouse) { " " givens(spouse) " " bold surname(spouse) unbold }
 
411
      if (spouse) {
 
412
        " " autohtml(mygivens(spouse))
 
413
        " " bold autohtml(mysurname(spouse)) unbold
 
414
      }
376
415
      set(comma,1)
377
416
    }
378
417
  }
379
418
  if (b,death(person)) {
380
419
    if (comma) { "," }
381
 
    " +" call doevent(b)
 
420
    " " died call doevent(b)
382
421
    set(comma,1)
383
422
  }
384
423
  if (b,burial(person)) {
385
424
    if (comma) { "," }
386
 
    " #" call doevent(b)
 
425
    " " burd call doevent(b)
387
426
    set(comma,1)
388
427
  }
389
428
  "." br
390
429
}
391
430
 
 
431
func mygivens(person) {
 
432
  set(g,givens(person))
 
433
  if (strlen(g)) { return(g) }
 
434
  return("____")
 
435
}
 
436
 
 
437
func mysurname(person) {
 
438
  set(s,surname(person))
 
439
  if (strcmp(s,"<unknown>")) { return(s) }
 
440
  return ("____")
 
441
}
 
442
 
392
443
proc doevent(event) {
393
444
  list(placelist)
394
445
  extractplaces(event,placelist,nplaces)
395
446
  if (nplaces) {
396
447
    set(place,dequeue(placelist))
397
 
    if (strlen(place)) { " " } place
 
448
    if (strlen(place)) { " " } autohtml(place)
398
449
  }
399
450
  set(d,date(event))
400
451
  if (strlen(d)) { " " }
430
481
}
431
482
 
432
483
proc locations(person) {
433
 
  call one_location(burial(person),surname(person))
434
 
  call one_location(death(person),surname(person))
 
484
  call one_location(burial(person),mysurname(person),death(person))
 
485
  call one_location(death(person),mysurname(person),burial(person))
435
486
  if (female(person)) {
436
 
    families(person,family,husband,fnum) { "" } /* find last husband */
437
 
    call one_location(burial(person),surname(husband))
438
 
    call one_location(death(person),surname(husband))
 
487
    families(person,family,husband,fnum) { set(lasthusband,husband) } /* find last husband */
 
488
    call one_location(burial(person),mysurname(lasthusband),death(person))
 
489
    call one_location(death(person),mysurname(lasthusband),burial(person))
439
490
  }
440
491
  families(person,family,spouse,fnum) {
441
 
    call one_location(marriage(family),surname(person))
442
 
    call one_location(marriage(family),surname(spouse))
 
492
    call one_location(marriage(family),mysurname(person),0)
 
493
    call one_location(marriage(family),mysurname(spouse),0)
443
494
  }
444
 
  call one_location(baptism(person),surname(person))
445
 
  call one_location(birth(person),surname(person))
 
495
  call one_location(baptism(person),mysurname(person),birth(person))
 
496
  call one_location(birth(person),mysurname(person),baptism(person))
446
497
}
447
498
 
448
 
proc one_location(event,surname) {
 
499
proc one_location(event,surname,event2) {
449
500
  if (event) {
450
501
    set(loc,place(event))
 
502
    set(yr,atoi(year(event)))
 
503
    if (not(yr)) { set(yr,atoi(year(event2))) }
 
504
    if (not(yr)) { set(yr,0) }
451
505
    if (strlen(loc)) {
 
506
      set(loc,locfilter(loc))
452
507
      set(locsur,concat(loc,":",surname))
453
508
      if (not(lookup(locationsurname_table,locsur))) {
454
 
        insert(locationsurname_table,save(locsur),1)
 
509
        list(locsuryears)
 
510
        setel(locsuryears,1,yr)
 
511
        setel(locsuryears,2,yr)
 
512
        insert(locationsurname_table,save(locsur),locsuryears)
455
513
        enqueue(locationsurname_list,save(locsur))
 
514
      } elsif (yr) {
 
515
        set(locsuryears,lookup(locationsurname_table,locsur))
 
516
        if (lt(yr,getel(locsuryears,1))) {
 
517
          setel(locsuryears,1,yr)
 
518
        } elsif (gt(yr,getel(locsuryears,2))) {
 
519
          setel(locsuryears,2,yr)
 
520
        }
 
521
        if (eq(getel(locsuryears,1),0)) {
 
522
          setel(locsuryears,1,yr)
 
523
        }
456
524
      }
457
525
    }
458
526
  }
459
527
}
460
528
 
 
529
/* remove unneeded location info from location name */
 
530
func locfilter(string) {
 
531
  set(string,strfilterstart(string,"near "))
 
532
  set(string,strfilter(string,"?"))
 
533
  return(string)
 
534
}
 
535
 
 
536
/* remove a string at the start of another string, if present */
 
537
func strfilterstart(string,start) {
 
538
  if (strcmp(substring(string,1,strlen(start)),start)) {
 
539
    return(string)
 
540
  }
 
541
  return(substring(string,add(strlen(start),1),strlen(string)))
 
542
}
 
543
 
 
544
/* remove a string from another string, multiple times if needed */
 
545
func strfilter(string,sub) {
 
546
  while (m,index(string,sub,1)) {
 
547
    set(string,concat(substring(string,1,sub(m,1)),
 
548
                      substring(string,add(m,strlen(sub)),strlen(string))))
 
549
  }
 
550
  return(string)
 
551
}
 
552
 
 
553
/* translate a string but only if html global is set */
 
554
func autohtml(string) {
 
555
  if (html) { return(strxlat(html_xlat,string)) }
 
556
  return(string)
 
557
}
 
558
 
 
559
/* translate a whole list via sort_xlat to a sortable list */
 
560
proc translate(listin,listout) {
 
561
    forlist(listin,element,i) {
 
562
        enqueue(listout,strxlat(sort_xlat,element))
 
563
    }
 
564
}
 
565
 
 
566
/* translate string according to xlat table */
 
567
func strxlat(xlat,string) {
 
568
    set(fixstring,"")
 
569
    set(pos,strlen(string))
 
570
    while(pos) {
 
571
        set(char,substring(string,pos,pos))
 
572
        if (special,lookup(xlat,char)) {
 
573
            set(fixstring,concat(special,fixstring))
 
574
        }
 
575
        else { set(fixstring,concat(char,fixstring)) }
 
576
        decr(pos)
 
577
    }
 
578
    return(fixstring)
 
579
}
 
580
 
 
581
proc init_xlat() {
 
582
/* This initializes the various translation tables.
 
583
   Note that these use the Macintosh encoding scheme!
 
584
*/
 
585
 
 
586
/* Translation table for sorting purposes.
 
587
   Note that this is mostly to handle German characters.
 
588
*/
 
589
    insert(sort_xlat,"�","oe")
 
590
    insert(sort_xlat,"�","oe")
 
591
    insert(sort_xlat,"�","ue")
 
592
    insert(sort_xlat,"�","ue")
 
593
    insert(sort_xlat,"�","ae")
 
594
    insert(sort_xlat,"�","ae")
 
595
    insert(sort_xlat,"�","ss")
 
596
    insert(sort_xlat,"�","ss")
 
597
    insert(sort_xlat,"�","Ae")
 
598
    insert(sort_xlat,"�","Ae")
 
599
    insert(sort_xlat,"�","Oe")
 
600
    insert(sort_xlat,"�","Oe")
 
601
    insert(sort_xlat,"�","Ue")
 
602
    insert(sort_xlat,"�","Ue")
 
603
    insert(sort_xlat,"�","e")
 
604
    insert(sort_xlat,"�","e")
 
605
    insert(sort_xlat,"�","y")
 
606
    insert(sort_xlat,"�","y")
 
607
    insert(sort_xlat,"�","e")
 
608
    insert(sort_xlat,"�","e")
 
609
    insert(sort_xlat,"�","n~")
 
610
    insert(sort_xlat,"�","n~")
 
611
    insert(sort_xlat,"�","oe")
 
612
    insert(sort_xlat,"�","oe")
 
613
 
 
614
/* For the full list of HTML encodings for special characters, see
 
615
   http://info.cern.ch/hypertext/WWW/MarkUp/ISOlat1.html
 
616
*/
 
617
    insert(html_xlat,"�","&ouml;")
 
618
    insert(html_xlat,"�","&ouml;")
 
619
    insert(html_xlat,"�","&uuml;")
 
620
    insert(html_xlat,"�","&uuml;")
 
621
    insert(html_xlat,"�","&auml;")
 
622
    insert(html_xlat,"�","&auml;")
 
623
    insert(html_xlat,"�","&szlig;")
 
624
    insert(html_xlat,"�","&szlig;")
 
625
    insert(html_xlat,"�","&Auml;")
 
626
    insert(html_xlat,"�","&Auml;")
 
627
    insert(html_xlat,"�","&Ouml;")
 
628
    insert(html_xlat,"�","&Ouml;")
 
629
    insert(html_xlat,"�","&Uuml;")
 
630
    insert(html_xlat,"�","&Uuml;")
 
631
    insert(html_xlat,"�","&euml;")
 
632
    insert(html_xlat,"�","&euml;")
 
633
    insert(html_xlat,"�","&yuml;")
 
634
    insert(html_xlat,"�","&yuml;")
 
635
    insert(html_xlat,"�","&eacute;")
 
636
    insert(html_xlat,"�","&eacute;")
 
637
    insert(html_xlat,"&","&amp;")
 
638
    insert(html_xlat,"�","&ntilde;")
 
639
    insert(html_xlat,"�","&ntilde;")
 
640
    insert(html_xlat,"�","&oelig;")
 
641
    insert(html_xlat,"�","&oelig;")
 
642
 
 
643
/* ISO 8859 translation for the GENDEX.txt file
 
644
*/
 
645
    insert(ISO8859_xlat,"�","�")
 
646
    insert(ISO8859_xlat,"�","�")
 
647
    insert(ISO8859_xlat,"�","�")
 
648
    insert(ISO8859_xlat,"�","�")
 
649
    insert(ISO8859_xlat,"�","�")
 
650
    insert(ISO8859_xlat,"�","�")
 
651
    insert(ISO8859_xlat,"�","�")
 
652
    insert(ISO8859_xlat,"�","�")
 
653
    insert(ISO8859_xlat,"�","�")
 
654
    insert(ISO8859_xlat,"�","�")
 
655
    insert(ISO8859_xlat,"�","�")
 
656
    insert(ISO8859_xlat,"�","�")
 
657
}
 
658
 
461
659
/*
462
660
   quicksort: Sort an input list by generating a permuted index list
463
661
   Input:  alist  - list to be sorted
520
718
func compare(string1,string2) {
521
719
  return(strcmp(string1,string2))
522
720
}
 
721