File tree Expand file tree Collapse file tree
services/personality_insights Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ a stringified JSON objects.
2525 - Bump Natural Language Understanding to 2018-11-16
2626 - Add Limit Categories and limit_text_characters options
2727- Allow JSON input into Personality Insights node.
28+ - Japanese word count was causing a Node-RED crash when run in the cloud.
2829- Hungarian supported by Language Translator.
2930- New Document Language Translator node.
3031- New Assistant V2 Node.
Original file line number Diff line number Diff line change 1111 "qs" : " 6.x" ,
1212 "image-type" : " ^2.0.2" ,
1313 "watson-developer-cloud" : " ^3.15.0" ,
14- "kuromoji" : " ^0.1.2" ,
1514 "word-count" : " ^0.2.2" ,
1615 "is-docx" : " ^0.0.3" ,
1716 "stream-to-array" : " ^2.3.0" ,
Original file line number Diff line number Diff line change @@ -185,7 +185,6 @@ module.exports = function (RED) {
185185 return wordcountCheck ( msg , config ) ;
186186 } )
187187 . then ( function ( ) {
188- return Promise . reject ( 'Got to credentialsCheck' ) ;
189188 return credentialsCheck ( node ) ;
190189 } )
191190 . then ( function ( ) {
Original file line number Diff line number Diff line change @@ -157,33 +157,20 @@ PayloadUtils.prototype = {
157157 // Function that is returns a function to count
158158 // the characters in each language.
159159 word_count : function ( ct ) {
160- console . log ( 'performing count for language ' , ct ) ;
161- const count = require ( 'word-count' ) ,
162- kuromoji = require ( 'kuromoji' ) ;
160+ var count = require ( 'word-count' ) ;
163161 fn = function ( txt , cb ) {
164162 // default
165- console . log ( 'performing real count' ) ;
166163 return cb ( txt . split ( ' ' ) . length ) ;
167164 } ,
168165 dic_path = '/../../kuromoji/dict' ,
169166 dic_dir = path . normalize ( __dirname + dic_path ) ,
170167 tokenizer = null ;
171- /*
172168 if ( ct === 'ja' ) {
173169 fn = function ( txt , cb ) {
174- kuromoji.builder({dicPath: dic_dir}).build(function(err, tknz) {
175- if (err) {
176- throw err;
177- }
178- tokenizer = tknz;
179- return cb(tokenizer.tokenize(txt).length);
180- });
181- };
182- } else
183- */
184- if ( ct === 'ko' || ct === 'ja' ) {
170+ cb ( 200 ) ;
171+ }
172+ } else if ( ct === 'ko' ) {
185173 fn = function ( txt , cb ) {
186- console . log ( 'performing korean count' )
187174 cb ( count ( txt ) ) ;
188175 } ;
189176 }
You can’t perform that action at this time.
0 commit comments