回答編集履歴
3
コードの修正
test
CHANGED
@@ -112,6 +112,8 @@
|
|
112
112
|
|
113
113
|
strcpy_s(resbuf, sizeof resbuf, result);
|
114
114
|
|
115
|
+
delete tagger;
|
116
|
+
|
115
117
|
wcount = 0;
|
116
118
|
|
117
119
|
words[wcount] = strtok(resbuf, "\t\n"); // 単語
|
@@ -265,3 +267,7 @@
|
|
265
267
|
|
266
268
|
|
267
269
|
```
|
270
|
+
|
271
|
+
**追記**
|
272
|
+
|
273
|
+
メモリーリークしないように delete tagger; を追加しました。
|
2
バグ修正2
test
CHANGED
@@ -122,7 +122,7 @@
|
|
122
122
|
|
123
123
|
if ((strlen(words[wcount]) != 2 ||
|
124
124
|
|
125
|
-
(unsigned char)words[wcount][0] > 0x88)
|
125
|
+
(unsigned char)words[wcount][0] >= 0x88)
|
126
126
|
|
127
127
|
&& (!strncmp(p, "名詞", 4) || !strncmp(p, "動詞", 4) ||
|
128
128
|
|
1
バグ修正
test
CHANGED
@@ -86,6 +86,8 @@
|
|
86
86
|
|
87
87
|
int wcount = 0; // 単語の個数(count)
|
88
88
|
|
89
|
+
char wbuf[256] = ""; // words の表示用バッファ
|
90
|
+
|
89
91
|
|
90
92
|
|
91
93
|
while (ProcessMessage() == 0) {
|
@@ -118,7 +120,9 @@
|
|
118
120
|
|
119
121
|
while (wcount < 100 && p) {
|
120
122
|
|
123
|
+
if ((strlen(words[wcount]) != 2 ||
|
124
|
+
|
121
|
-
|
125
|
+
(unsigned char)words[wcount][0] > 0x88)
|
122
126
|
|
123
127
|
&& (!strncmp(p, "名詞", 4) || !strncmp(p, "動詞", 4) ||
|
124
128
|
|
@@ -132,6 +136,12 @@
|
|
132
136
|
|
133
137
|
}
|
134
138
|
|
139
|
+
p = wbuf;
|
140
|
+
|
141
|
+
*p = '\0';
|
142
|
+
|
143
|
+
for (int i = 0; i < wcount; i++) p += sprintf(p, "%s ", words[i]);
|
144
|
+
|
135
145
|
|
136
146
|
|
137
147
|
if (kinbuf[0] == '\0') {
|
@@ -222,12 +232,6 @@
|
|
222
232
|
|
223
233
|
}
|
224
234
|
|
225
|
-
char wstr[256], *p = wstr;
|
226
|
-
|
227
|
-
*p = '\0';
|
228
|
-
|
229
|
-
for (int i = 0; i < wcount; i++) p += sprintf(p, "%s ", words[i]);
|
230
|
-
|
231
235
|
|
232
236
|
|
233
237
|
drawString(0, 0, GetColor(5, 255, 255), pos, str); // 1文字ずつ表示
|
@@ -236,7 +240,7 @@
|
|
236
240
|
|
237
241
|
DrawFormatString(100, 200, GetColor(5, 255, 0), "memobuf = [%s]", memobuf);
|
238
242
|
|
239
|
-
DrawFormatString(100, 300, GetColor(175, 80, 100), "words = [%s]", w
|
243
|
+
DrawFormatString(100, 300, GetColor(175, 80, 100), "words = [%s]", wbuf);
|
240
244
|
|
241
245
|
DrawFormatString(100, 400, GetColor(255, 255, 0), "kinbuf = [%s]",kinbuf);
|
242
246
|
|
@@ -258,4 +262,6 @@
|
|
258
262
|
|
259
263
|
}
|
260
264
|
|
265
|
+
|
266
|
+
|
261
267
|
```
|