MCPcopy Index your code
hub / github.com/clns/node-commit-msg / processOutput

Function processOutput

lib/nlp-parser.js:70–91  ·  view source on GitHub ↗
(output)

Source from the content-addressed store, hash-verified

68 }
69 var separatorJS = typeof(separator) === 'undefined' || separator === 'newline' ? '\n' : separator;
70 var processOutput = function(output) {
71 var instances = [];
72
73 // Output is separated by two line breaks
74 // wordsAndTags is first, penn is second
75 output = output.trim().split(/\r?\n\r?\n/);
76
77 var formats = OUTPUT_FORMAT.split(',');
78 var length = output.length;
79
80 for (var i=0; i<length; ) {
81 var instance = new StanfordParser();
82
83 formats.forEach(function(format) {
84 instance[format] = output[i++];
85 });
86
87 instances.push(instance);
88 }
89
90 cb(null, instances);
91 };
92
93 StanfordParser.parser(function(err, parser) {
94 if (err) return cb(err);

Callers 2

parseSentenceFunction · 0.85
nlp-parser.jsFile · 0.85

Calls 1

cbFunction · 0.85

Tested by

no test coverage detected