nl_tokens: convert a single dataset to Weka ARFF string .
pl_tokens: function ( dataset , relationName , featureLookupTable ) { var arff = "% Automatically generated by Node.js\n" ; arff += "@relation " + relationName + "\n" ; featureLookupTable . featureIndexToFeatureName . forEach ( function ( featureName ) { if ( _ . isUndefined ( featureName ) ) arff += "@attribute undefined {0,1}" + "\n" ; else if ( ! _ . isString ( featureName ) ) throw new Error ( "Expected featureName to be a string, but found " + JSON . stringify ( featureName ) ) ; else arff += "@attribute " + featureName . replace ( / [^a-zA-Z0-9] / g , "_" ) + " " + "{0,1}" + "\n" ; } ) ; arff += "\n@data\n" ; dataset . forEach ( function ( datum ) { var datumArff = _ . clone ( datum . input , { } ) ; for ( var i = 0 ; i < datum . output . length ; ++ i ) datumArff [ datum . <mask> [ i ] ] = 1 ; //console.dir(datumArff); var array = featureLookupTable . hashToArray ( datumArff ) ; arff += array + "\n" ; } ) ; return arff ; }