@@ -43,15 +43,16 @@ public static TextAnnotation createTextAnnotationFromTokens(List<String[]> token
43
43
44
44
45
45
/**
46
- * The default way to create a {@link TextAnnotation} from pre-tokenized text.
46
+ * A way to create a {@link TextAnnotation} from pre-tokenized text from Python
47
47
*
48
- * @param tokenizedSentences A list of sentences, each one being an array of tokens
48
+ * @param tokenizedSentences A list of sentences, each one being an list of tokens
49
49
* @return A {@link TextAnnotation} containing the SENTENCE and TOKENS views.
50
50
*/
51
51
public static TextAnnotation createTextAnnotationFromListofListofTokens (List <List <Object >> tokenizedSentences ) {
52
- // Function name is not createTextAnnotationFromTokens - due to same erasure error
52
+ // This function takes List<List<Object>> to be able to run with cogcomp-nlpy (using pyjnius)
53
53
// Convert the inner lists to String arrays
54
54
// Call the default TextAnnotation builder function
55
+
55
56
List <String []> tokenizedSentences_formatted = new ArrayList <String []>();
56
57
57
58
// Converting inner list to array
@@ -69,29 +70,6 @@ public static TextAnnotation createTextAnnotationFromListofListofTokens(List<Lis
69
70
}
70
71
71
72
72
-
73
- // /**
74
- // * The default way to create a {@link TextAnnotation} from pre-tokenized text.
75
- // *
76
- // * @param tokenizedSentences A list of sentences, each one being an array of tokens
77
- // * @return A {@link TextAnnotation} containing the SENTENCE and TOKENS views.
78
- // */
79
- // public static TextAnnotation createTextAnnotationFromListofListofTokens(List<List<String>> tokenizedSentences) {
80
- // // Function name is not createTextAnnotationFromTokens - due to same erasure error
81
- // // Convert the inner lists to String arrays
82
- // // Call the default TextAnnotation builder function
83
- // List<String[]> tokenizedSentences_formatted = new ArrayList<String[]>();
84
- //
85
- // // Converting inner list to array
86
- // for (List<String> sentence : tokenizedSentences) {
87
- // String[] sentence_array = (String[]) sentence.toArray();
88
- // tokenizedSentences_formatted.add(sentence_array);
89
- // }
90
- //
91
- // return createTextAnnotationFromTokens("", "", tokenizedSentences_formatted);
92
- // }
93
-
94
-
95
73
/**
96
74
* The default way to create a {@link TextAnnotation} from pre-tokenized text.
97
75
*
0 commit comments