File tree Expand file tree Collapse file tree 1 file changed +45
-3
lines changed
fnlp-core/src/main/java/org/fnlp/nlp/parser/dep Expand file tree Collapse file tree 1 file changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -246,13 +246,13 @@ private void toList(ArrayList<List<String>> lists) {
246
246
}
247
247
248
248
}
249
-
249
+ //错误
250
250
public String [] getWords () {
251
251
String [] words = new String [size ];
252
252
getWords (words );
253
253
return words ;
254
254
}
255
-
255
+ //错误
256
256
private void getWords (String [] words ) {
257
257
words [id ] = word ;
258
258
for (int i = 0 ; i < leftChilds .size (); i ++) {
@@ -262,6 +262,48 @@ private void getWords(String[] words) {
262
262
rightChilds .get (i ).getWords (words );
263
263
}
264
264
265
- }
265
+ }
266
+ /**
267
+ * 得到依赖类型数组
268
+ * @return
269
+ */
270
+
271
+ public String getTags () {
272
+ StringBuffer sb = new StringBuffer ();
273
+ for (int i = 0 ; i < leftChilds .size (); i ++) {
274
+ sb .append (leftChilds .get (i ).getTags ());
275
+ }
276
+ if (relation !=null )
277
+ sb .append (relation );
278
+ else
279
+ sb .append ("核心词" );
280
+ sb .append (" " );
281
+ for (int i = 0 ; i < rightChilds .size (); i ++) {
282
+ sb .append (rightChilds .get (i ).getTags ());
283
+ }
284
+ return sb .toString ();
285
+ }
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
266
308
267
309
}
You can’t perform that action at this time.
0 commit comments