File: libtabe.sgml

package info (click to toggle)
libtabe 0.2.6-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,568 kB
  • ctags: 1,782
  • sloc: ansic: 17,454; sh: 9,848; makefile: 268
file content (619 lines) | stat: -rw-r--r-- 14,024 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
<!doctype linuxdoc system>
<!-- @ ʵ -->

<article>

<!-- Title information -->
<title>libtabe -- TaBE 禡w

<author>ʵ <it><htmlurl url="mailto:shawn@iis.sinica.edu.tw"
                     name="&lt;shawn@iis.sinica.edu.tw&gt;"></it></author>
<date>$Id: libtabe.sgml,v 1.2 2001/08/20 03:53:02 thhsieh Exp $

<abstract>
bqWBzA즳 C 禡w@QXC
H Big5 XӻA@ӦrF byteAެOprסA
Ϊ̬OnҼ{rrǡAƦܭnBzΥylɭԡAݭnSOվA
즳 C 禡wڥŨϥΡC
t@譱AѩCӵ{}oHbBz媺ɭԡAۤvkA
ҥHP{ɨ禡wA󤣥δЧQΤFC
TaBE peƱѤ@ӧnϥҡA]A
Nܻݭn@ӯBzrBByΤ@P禡wA
ӰҦε{¦C
libtabeANOƱ榨o˪@M禡wAѲΤ@P\A
ε{jj¦iHoC
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin of document -->
<sect>
<p>
libtabe N媺BzXӶqAѤpjOOG
<itemize>
<item>`Ÿ(ZuYin Symbols)G
      C@ӤrѤ@өΦhӪ`Ÿ[W@nղŸҲզC
      `Ÿ[WnղŸ`ƬO|QG
      (TQCӪ`Ÿ[WnղŸ)
<item>Ū(Yin)G
      @ŪOѤ@өΦhӪ`Ÿ[W@nղŸզC
      CŪO㦳NqAiHN@ӤrCMA
      Pr]\|ۦPŪC@Ӧr]i঳ƺŪC
<item>r(Zhi)G
      ]NOrC
<item>(TsiYin)G
      @ӵŪC@ӵi঳ƺŪC
<item>(Tsi)G
      Ѥ@ƭӦrҲզCbyWAO̰򥻤S㦳NqC
<item>y(Chu)G
      @ӥyliHF@ӧ㪺AѤ@ƭӵҲզC
</itemize>
</p>

<p>
libtabe wHWUӳBzqѤ@Ǩ禡C]b{BzqA
ഫ禡C᪺`AN@@ШCӳBzqҴѪ禡A
λP۾FBzqഫ禡C
</p>

<p>
ϥΤPsXBzɡAi|PʽA
ҥHoӨ禡wĥ Big5 XXAݭnഫLXɡA
iHϥഫơC
</p>
</sect>

<sect>Ƶc
<sect1>e
<p>
b`Aڭ̱NЦb libtabe ҷ|ϥΨ쪺XӰ򥻸ƵcC
ǸƵcMuOLƧκAswqӤwALA
FP C yƧκA۲VcAڭ٬Oϥγo˪覡C
</p>

<sect1>wq
<p>
<code>
typedef unsigned char    *ZuYinSymbol;
typedef unsigned char    *ZuYinSymbolSequence;
typedef unsigned int      ZuYinIndex;

typedef unsigned int      ZhiCode;
typedef unsigned char    *Zhi;
typedef unsigned char    *ZhiStr;

typedef unsigned long int Yin;

struct ZhiInfo {
  ZhiCode           code;
  Zhi               chct;
  Yin               yin[4];
  unsigned long int refcount; /* should be obsoleted soon */
};

struct TsiInfo {
  ZhiStr             tsi;
  unsigned long int  refcount;
  unsigned long int  yinnum;
  Yin               *yindata;
};

struct TsiYinInfo {
  Yin               *yin ;
  unsigned long int  yinlen;
  unsigned long int  tsinum;
  ZhiStr             tsidata;
};

struct ChunkInfo {
  ZhiStr          chunk;
  int             num_tsi;
  struct TsiInfo *tsi;
};

struct ChuInfo {
  ZhiStr            chu;
  int               num_chunk;
  struct ChunkInfo *chunk;
};

struct TsiDB {
  int type;
  int flags;
  char *db_name;
  void *dbp;
  void *dbcp;
  .
  .
  .
};

struct TsiYinDB {
  int type;
  int flags;
  char *db_name;
  void *dbp;
  void *dbcp;
  .
  .
  .
};
</code>
</p>
</sect1>

<sect1>
<p>
<itemize>
<item>ZhiCodeGs Big5 XC
<item>ZhiGs@ Big5 XܪrCo@wO@ӦrA
           iu byte ӤwC
<item>ZhiStrGs@ Big5 XܪrCo@wO@ӦrA
                NULL ׵C
<item>YinGs@ŪC
<item>ZhiInfoG@ӤrƵcCzLoӸƵcA
               iHo\hoӦrTCyin soӦrŪA
               ̦h|ӡC
<item>TsiInfoG@ӵƵcCzLoӸƵcA
               iHo\hoӦrTC
               yinnum P yindata s񪺬OoӵTŪA
               ]\u@ӡC
<item>TsiYinInfoG@ӵƵcCyinlen OoӵסA
                  tsinum OoŪ@XӵA
                  tsidata Ooǵ۱sC
<item>TsiDBGwƵcCzLoӸƵcA
             iHswAPLTC
<item>TsiYinDBGwƵcCzLoӸƵcA
                iHswPAPLTC
<item>ChunkInfoGΨ_ƵcCn_qsbo̡A
                 _XӪhsb tsi C
<item>ChuInfoGyz@ӥylƵcC@ӥylSiAƭӤqC
</itemize>
</sect1>
</sect>

<sect>`Ÿ
<sect1>e
<p>
`ŸOxWaϩҦHbDz߰yɡAΨӾDzߵokuC
o˪kAiHTܤ@ӦrŪA|yVcCҥHA
libtabe ϥΪ`ŸŪpBzC
</p>
<p>
`Ÿ@TQCӡAA[WnղŸA`pO|QGӡC
FKbqBz`ŸAlibtabe q "t"  ""A
̧ǵP 1  37 `s (Index)C38 On()A
39  42 OO@n|nC0 OdϥΡAHKPŪBzqഫC
</p>
</sect1>

<sect1>tabeZuYinIndexToZuYinSymbol()
<p>
<tscreen>
const Zhi tabeZuYinIndexToZuyinSymbol(ZuYinIndex idx);
</tscreen>
</p>

<p>
beҴL`sX (Index) P`Ÿ (ZuYinSymbol) ഫC
</p>
</sect1>

<sect1>tabeZuYinSymbolToZuYinIndex()
<p>
<tscreen>
int tabeZuYinSymbolToZuYinIndex(ZuYinSymbol sym);
</tscreen>
</p>

<p>
P tabeZuYinIndexToZuYinSymbol() ۦAuLOۤϪഫC
</p>
</sect1>

<sect1>tabeZozyKeyToZuYinIndex()
<p>
<tscreen>
int tabeZozyKeyToZuYinIndex(int key);
</tscreen>
</p>
<p>
禡ѹs@`JkP`sഫC
</p>
</sect1>
</sect>

<sect>Ū
<sect1>e
<p>
qLqs| (CMEX) ҴѪݩʪέpoA
Big5 Xҥ]tr@ 1302 ӤPŪC
ӨCŪOѪ`Ÿ[nղŸҲզA
ҥHڭ̴NΪ`sXӲզŪsXAKഫC
SAFPDzΪϥκDҵXAŪOĤ@nɡAڭ̨äϥθnղŸC
</p>

<p>
軡A"" oŪNO
((((<bf>15</bf>*43)+<bf>23</bf>)*43+<bf>36</bf>)*43)+<bf>0</bf>)*43C
15B23B36 OO ""B""B"" `sC
ѩ@Ū̦hTӪ`Ÿ[@nղŸA
ĥγoؤ覡N|VcA]ݭn`ŸX{mSC
</p>

<p>
CMEX ݩɤA@Ӥr̦h|ŪC
b Big5 XDΪ 13060 ӤrA12098 Ӧru@ŪA
888 ӦrŪA62 ӦrTŪA10 Ӧr|ŪCt~A
٦ӦrSŪAOOJ (0xC94A) P (0xDDFC) oӦ`ΦrC
(]L̬OЪrCӥB CMEX rɤ]SoӦr)
ѩڭ̨ϥ CMEX ݩXӪӪAҥHoӦrNŪC
</p>
</sect1>

<sect1>tabeYinToZuYinSymbolSequence()
<p>
<tscreen>
ZuYinSymbolSequence tabeYinToZuyinSymbolSequence(Yin yin);
</tscreen>
</p>
<p>
NŪରҲզ`ŸPnղŸC
</p>
</sect1>

<sect1>tabeZuYinSymbolSequenceToYin()
<p>
<tscreen>
Yin tabeZuYinSymbolSequenceToYin(ZuYinSymbolSequence str);
</tscreen>
</p>
<p>
N`ŸPnղŸզXনŪC
</p>
</sect1>

<sect1>tabeYinLookupZhiList()
<p>
<tscreen>
ZhiStr tabeYinLookupZhiList(Yin yin);
</tscreen>
</p>

<p>
dߩҦ㦳oŪrCoǦrsb@ӦrꤤC
</p>
</sect>

<sect>r
<sect1>e
<p>
bxWҺDΪ Big5 XA@ 13060 ӤrA
OO 5401 ӱ`ΦrA7652 Ӧ`ΦrAA[Wʤѩr 7 ӤrC
</p>
</sect1>

<sect1>tabeZhiInfoLookupYin()
<p>
<tscreen>int tabeZhiInfoLookupYin(struct ZhiInfo *h);
</tscreen>
</p>

<p>
d ZhiInfo oӸƵc code ҥNrҦŪA
sb ZhiInfo  yin CǦ^ȦpGp 0ANӦrSŪC
</p>
</sect1>
</sect>

<sect>
<sect1>e
<p>
boM禡wAO̭nBzqC襤yӻA
^夤r@ˡAO㦳Nq̤pCO^夣POA
媺PS㪺jAάO^夤ťդ@ˡA
iHϹjӳrjŸC
</p>
<p>
]Aڭ̻ݭn_C_N@ꤤrjXӡC
</p>
<p>
媺_ثeOĥΤw覡ӧ@A
ҥH@ӨjBIJvnwOݭnC
ҥHAlibtabe  Berkeley DB Ӻ޲zwAp@ӡAJϵwܤjɡA
]ٯܦnįC
</p>
</sect1>
<sect1>tabeTsiInfoLookupPossibleYin()
<p>
<tscreen>
int tabeBig5TsiLookupPossibleTsiYin(struct TsiInfo *tsi);
</tscreen>
dX TsiInfo  tsi oӦrҦC
`Ʀsb TsiInfo  yinnum Ayindata hOoǵAssC
<p>

<sect1>tabeTsiDBOpen()
<p>
<tscreen>
struct TsiDB *tabeTsiDBOpen(int type, const char *db_name, int flags);
</tscreen>
</p>
<p>
}Ҥ@ӵwCtype OwAثeu DB_TYPE_DB @ءA
]NO Berkeley DBCflags OoӸƮw@ǯSʡApUG
<itemize>
<item>DB_FLAG_OVERWRITEGpGbgJwɤwЪAмgC
<item>DB_FLAG_CREATEDBGpG}ҵwɧ䤣즹wAsWɡC
<item>DB_FLAG_READONLYG}ҵwŪACPe flag VΡC
</itemize>
</p>
<p>
Ǧ^ TsiDB NOIsLwBzƮɲĤ@ӰѼơC
</p>
</sect1>

<sect1>tsidb->Close()
<p>
<tscreen>
void tsidb->Close(struct TsiDB *tsidb);
</tscreen>
</p>
<p>
wC
</p>
</sect1>

<sect1>tsidb->RecordNumber()
<p>
<tscreen>
int tsidb->RecordNumber(struct TsiDB *tsidb);
</tscreen>
</p>
<p>
d߸ӵw@hֵC
</p>
</sect1>

<sect1>tsidb->Put()
<p>
<tscreen>
int tsidb->Put(struct TsiDB *tsidb, struct TsiInfo *tsi);
</tscreen>
</p>
<p>
N TsiInfo  tsiBrefcountByinnumByindata sJwC
</p>
</sect1>

<sect1>tsidb->Get()
<p>
<tscreen>
int tsidb->Get(struct TsiDB *tsidb, struct TsiInfo *tsi);
</tscreen>
</p>
<p>
dߵwO_ TsiInfo  tsi oӵC
ܱNLƥѵwJ TsiInfo C
</p>
</sect1>

<sect1>tsidb->CursorSet()
<p>
<tscreen>
int tsidb->CursorSet(struct TsiDB *tsidb, struct TsiInfo *tsi);
</tscreen>
</p>
<p>
Nwг] TsiInfo  tsi ҫVaCpG tsi sbA
hVĤ@OCPɤ]NӵJ TsiInfo C
</p>
</sect1>

<sect1>tsidb->CursorNext()
<p>
<tscreen>
int tsidb->CursorNext(struct TsiDB *tsidb, struct TsiInfo *tsi);
</tscreen>
</p>
<p>
ŪU@C
</p>
</sect1>

<sect1>tsidb->CursorPrev()
<p>
<tscreen>
int tsidb->CursorPrev(struct TsiDB *tsidb, struct TsiInfo *tsi);
</tscreen>
</p>
<p>
ŪW@C
</p>
</sect1>
</sect>

<sect>
<sect1>e
<p>
ŪC
</p>
</sect1>
<sect1>tabeTsiYinDBOpen()
<p>
<tscreen>
struct TsiYinDB *tabeTsiYinDBOpen(int type, const char *db_name, int flags);
</tscreen>
</p>
<p>
}Ҥ@ӵwCtype OwAثeu DB_TYPE_DB @ءA
]NO Berkeley DBCflags OoӸƮw@ǯSʡApUG
<itemize>
<item>DB_FLAG_OVERWRITEGpGbgJwɤwЪAмgC
<item>DB_FLAG_CREATEDBGpG}ҵwɧ䤣즹wAsWɡC
<item>DB_FLAG_READONLYG}ҵwŪACPe flag VΡC
</itemize>
</p>
<p>
Ǧ^ TsiYinDB NOIsLwBzƮɲĤ@ӰѼơC
</p>
</sect1>

<sect1>yindb->Close()
<p>
<tscreen>
void yindb->Close(struct TsiYinDB *yindb);
</tscreen>
</p>
<p>
wC
</p>
</sect1>

<sect1>yindb->RecordNumber()
<p>
<tscreen>
int tabeTsiYinDBRecordNumber(struct Big5TsiYinDB *yindb);
</tscreen>
</p>
<p>
d߸ӵw@hֵC
</p>
</sect1>

<sect1>yindb->Put()
<p>
<tscreen>
int yindb->Put(struct TsiYinDB *yindb, struct TsiYinInfo *yin);
</tscreen>
</p>
<p>
N TsiYinInfo  yinByinlenBtsinumBtsidata sJwC
</p>
</sect1>

<sect1>yindb->Get()
<p>
<tscreen>
int yindb->Get(struct TsiYinDB *yindb, struct TsiYinInfo *yin);
</tscreen>
</p>
<p>
dߵwO_ TsiYinInfo  yin oӵC
ܱNLƥѵwJ TsiYinInfo C
</p>
</sect1>

<sect1>yindb->CursorSet()
<p>
<tscreen>
int yindb->CursorSet(struct TsiYinDB *yindb, struct TsiYinInfo *tsiyin);
</tscreen>
</p>
<p>
Nwг] TsiYinInfo  yin ҫVaCpG yin sbA
hVĤ@OCPɤ]NӵJ TsiYinInfo C
</p>
</sect1>

<sect1>yindb->CursorNext()
<p>
<tscreen>
int yindb->CursorNext(struct TsiYinDB *yindb, struct TsiYinInfo *yin);
</tscreen>
</p>
<p>
ŪU@C
</p>
</sect1>

<sect1>yindb->CursorPrev()
<p>
<tscreen>
int yindb->CursorPrev(struct TsiYinDB *yindb, struct TsiYinInfo *yin);
</tscreen>
</p>
<p>
ŪW@C
</p>
</sect1>
</sect>

<sect>y
<sect1>e
<p>
FHPqbrPBzWošA
ڭ̳]wHqq̤pOylCLylwqӹLҽkA
A[WӤHbqWϥΤ媺ߺDɬۦPAҥH󬰡yyzɭɩwC
yqzOڭ̦byP[J@ӤCC
@ӡyqzrҲզADrҰϹjC@ӥyliH\hqC
</p>
<p>
wylBzAF⥦ӤrA󭫭nOn[C
ҥH_OoӶqnBzơC
</p>
</sect1>

<sect1>tabeChuInfoToChunkInfo()
<p>
<tscreen>
int tabeChuInfoToChunkInfo(struct ChuInfo *chu);
</tscreen>
</p>
<p>
N ChuInfo  ChunkInfo XӡCChunkInfo `Ʀs num_chunk A
 chunk[i] O i+1  ChunkInfoC
</p>
</sect1>

<sect1>tabeChunkInfoSegmentationSimplex()
<p>
<tscreen>
int tabeChunkInfoSegmentationSimplex(struct TsiDB *tsidb,
                                     struct ChunkInfo *chunk);
</tscreen>
</p>
<p>
ϥγ̰򥻪yukhzN ChunkInfo XӡC
Cӵs@ TsiInfo ƵcAtsi[i] O i+1 ӵC
`Ʀs num_tsi C
</p>
</sect1>

<sect1>tabeChunkInfoSegmentationComplex()
<p>
<tscreen>
int tabeChunkInfoSegmentationComplex(struct TsiDB *tsidb,
                                     struct ChunkInfo *chunk);
</tscreen>
</p>
<p>
ϥνӯE_tkN ChunkInfo XӡC
Cӵs@ TsiInfo ƵcAtsi[i] O i+1 ӵC
`Ʀs num_tsi C
</p>
<p>
ӯE_tkiѦ
<htmlurl
 url="http://casper.beckman.uiuc.edu/~c-tsai4/chinese/wordseg/mmseg.html"
name="http://casper.beckman.uiuc.edu/~c-tsai4/chinese/wordseg/mmseg.html">
</p>
</sect1>

<sect1>tabeChunkInfoSegmentationBackward()
<p>
<tscreen>
int tabeChunkInfoSegmentationBackward(struct TsiDB *tsidb,
                                      struct ChunkInfo *chunk);
</tscreen>
</p>
<p>
ϥΪLŵ (shlin@iis.sinica.edu.tw) _tkN ChunkInfo
XӡCCӵs@ TsiInfo ƵcA
tsi[i] O i+1 ӵC`Ʀs num_tsi C
</p>
</sect1>
</sect>

</article>