@@ -32,8 +32,8 @@ export class JavaArrayList extends JavaObject {
32
32
super ( 'java.util.ArrayList' , value ) ;
33
33
}
34
34
35
- async add ( ...items ) {
36
- this . addSync ( ...items ) ;
35
+ add ( ...items ) {
36
+ return Promise . resolve ( this . addSync ( ...items ) ) ;
37
37
}
38
38
39
39
addSync ( ...items ) {
@@ -58,8 +58,8 @@ export default class TwitterKoreanProcessor {
58
58
* @param text Input text.
59
59
* @return Normalized text.
60
60
*/
61
- static async normalize ( text ) {
62
- return this . normalizeSync ( text ) ;
61
+ static normalize ( text ) {
62
+ return Promise . resolve ( this . normalizeSync ( text ) ) ;
63
63
}
64
64
65
65
static normalizeSync ( text ) {
@@ -72,8 +72,8 @@ export default class TwitterKoreanProcessor {
72
72
* @param text Input text.
73
73
* @return A list of Korean Tokens (run tokensToJsonArray to transform to Java List)
74
74
*/
75
- static async tokenize ( text ) {
76
- return this . tokenizeSync ( text ) ;
75
+ static tokenize ( text ) {
76
+ return Promise . resolve ( this . tokenizeSync ( text ) ) ;
77
77
}
78
78
79
79
static tokenizeSync ( text ) {
@@ -86,14 +86,14 @@ export default class TwitterKoreanProcessor {
86
86
*
87
87
* @param words List of user nouns.
88
88
*/
89
- static async addNounsToDictionary ( ...words ) {
90
- return this . addNounsToDictionarySync ( ...words ) ;
89
+ static addNounsToDictionary ( ...words ) {
90
+ return Promise . resolve ( this . addNounsToDictionarySync ( ...words ) ) ;
91
91
}
92
92
93
93
static addNounsToDictionarySync ( ...words ) {
94
94
if ( Array . isArray ( words [ 0 ] ) ) words = words [ 0 ] ;
95
95
96
- let list = new JavaArrayList ( ) ;
96
+ const list = new JavaArrayList ( ) ;
97
97
list . addSync ( ...words ) ;
98
98
return this . instance . addNounsToDictionarySync ( list . instance ) ;
99
99
}
@@ -105,8 +105,8 @@ export default class TwitterKoreanProcessor {
105
105
* @param keepSpace Keep spaces
106
106
* @return Array of token objects.
107
107
*/
108
- static async tokensToJsonArray ( tokens , keepSpace = false ) {
109
- return this . tokensToJsonArraySync ( tokens , keepSpace ) ;
108
+ static tokensToJsonArray ( tokens , keepSpace = false ) {
109
+ return Promise . resolve ( this . tokensToJsonArraySync ( tokens , keepSpace ) ) ;
110
110
}
111
111
112
112
static tokensToJsonArraySync ( tokens , keepSpace = false ) {
@@ -132,8 +132,8 @@ export default class TwitterKoreanProcessor {
132
132
* @param tokens Korean tokens (output of tokenize(CharSequence text)).
133
133
* @return StemmedTextWithTokens(text, tokens)
134
134
*/
135
- static async stem ( tokens ) {
136
- return this . stemSync ( tokens ) ;
135
+ static stem ( tokens ) {
136
+ return Promise . resolve ( this . stemSync ( tokens ) ) ;
137
137
}
138
138
139
139
static stemSync ( tokens ) {
@@ -146,8 +146,8 @@ export default class TwitterKoreanProcessor {
146
146
* @param text Input text.
147
147
* @return Array of Sentence objects.
148
148
*/
149
- static async splitSentences ( text ) {
150
- return this . splitSentencesSync ( text ) ;
149
+ static splitSentences ( text ) {
150
+ return Promise . resolve ( this . splitSentencesSync ( text ) ) ;
151
151
}
152
152
153
153
static splitSentencesSync ( text ) {
@@ -172,8 +172,8 @@ export default class TwitterKoreanProcessor {
172
172
* @param includeHashtags
173
173
* @return Array of phrase CharSequences.
174
174
*/
175
- static async extractPhrases ( tokens , filterSpam = true , includeHashtags = false ) {
176
- return this . extractPhrasesSync ( tokens , filterSpam , includeHashtags ) ;
175
+ static extractPhrases ( tokens , filterSpam = true , includeHashtags = false ) {
176
+ return Promise . resolve ( this . extractPhrasesSync ( tokens , filterSpam , includeHashtags ) ) ;
177
177
}
178
178
179
179
static extractPhrasesSync ( tokens , filterSpam = true , includeHashtags = false ) {
@@ -197,8 +197,8 @@ export default class TwitterKoreanProcessor {
197
197
* @param words List of words.
198
198
* @return String Detokenized string.
199
199
*/
200
- static async detokenize ( ...words ) {
201
- return this . detokenizeSync ( ...words ) ;
200
+ static detokenize ( ...words ) {
201
+ return Promise . resolve ( this . detokenizeSync ( ...words ) ) ;
202
202
}
203
203
204
204
static detokenizeSync ( ...words ) {
0 commit comments