lib/natural/classifiers/classifier.js
function(batchJson) {
        if (abort) return;
        threadPool.any.eval('docsToFeatures(' + batchJson + ');', function(err, docs) {
            if (err) {
                return onError(err);
            }

            finished++;

            if (docs) {
                docs = JSON.parse(docs);
                setTimeout(onFeaturesResult.bind(null, docs));
            }

            if (finished >= obsBatches.length) {
                setTimeout(onFinished);
            }

            setTimeout(sendNext);
        });
    }
function(batchJson) {
        if (abort) return;
        threadPool.any.eval('docsToFeatures(' + batchJson + ');', function(err, docs) {
            if (err) {
                return onError(err);
            }

            finished++;

            if (docs) {
                docs = JSON.parse(docs);
                setTimeout(onFeaturesResult.bind(null, docs));
            }

            if (finished >= obsBatches.length) {
                setTimeout(onFinished);
            }

            setTimeout(sendNext);
        });
    }
function ( batchJson ) { if ( abort ) return ; threadPool . any . eval ( 'docsToFeatures(' + batchJson + ');' , function ( err , docs ) { if ( err ) { return onError ( err ) ; } finished ++ ; if ( docs ) { docs = JSON . parse ( docs ) ; setTimeout ( onFeaturesResult . bind ( null , docs ) ) ; } if ( finished >= obsBatches . length ) { setTimeout ( onFinished ) ; } setTimeout ( sendNext ) ; } ) ; }
Called to send a batch of docs to the threads
Called to send a batch of docs to the threads