File: tsi-chewing.diff

package info (click to toggle)
libchewing 0.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,588 kB
  • ctags: 878
  • sloc: sh: 9,738; ansic: 7,644; makefile: 234; python: 49
file content (51 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download | duplicates (3)
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
--- tsidump.c	2004-05-12 23:30:19.000000000 +0800
+++ tsidump-chewing.c	2004-05-12 23:29:12.000000000 +0800
@@ -65,32 +65,23 @@
     }
     i++;
     len = strlen((char *)tsi->tsi)/2;
-    fprintf(fp, "%s", tsi->tsi);
-    if (ref) {
-      fprintf(fp, " %ld", tsi->refcount);
-    }
     if (tsiyin) {
       ZuYinSymbolSequence zs = NULL;
-      int begin = 0;
 
-      fprintf(fp, " ");
       for (j = 0; j < tsi->yinnum; j++) {
+	if (len > 7)
+	  continue;
+	fprintf(fp, "%s %ld\t", tsi->tsi, tsi->refcount);
         for (k = 0; k < len; k++) {
           zs = tabeYinToZuYinSymbolSequence(tsi->yindata[j*len+k]);
           if (zs) {
-            if (begin) {
-              fprintf(fp, "@");
-            }
-            else {
-              begin = 1;
-            }
-            fprintf(fp, "%s", zs);
+	    fprintf(fp, "%s ", zs);
             free(zs);
           }
         }
+	fprintf(fp, "\n");
       }
     }
-    fprintf(fp, "\n");
   }
 
   db->Close(db);
@@ -109,8 +100,8 @@
   char *db_name, *op_name;
 
   db_name = op_name = (char *)NULL;
-  ref = 0;
-  tsiyin = 0;
+  ref = 1;
+  tsiyin = 1;
 
   while ((ch = getopt(argc, argv, "d:f:ry")) != -1) {
     switch(ch) {