dictionary frequency normalization script
This commit is contained in:
parent
671df5288c
commit
1e35e35d77
3 changed files with 77 additions and 15 deletions
|
|
@ -3,5 +3,11 @@ exports.print = function(str) {
|
|||
};
|
||||
|
||||
exports.printError = function(str) {
|
||||
process.stderr.write(`${str}\n`);
|
||||
};
|
||||
process.stderr.write(`${str instanceof Error ? str.stack : str}\n`);
|
||||
};
|
||||
|
||||
exports.printWordsWithFrequencies = function(words) {
|
||||
if (Array.isArray(words)) {
|
||||
words.forEach(w => exports.print(`${w.word}${w.frequency ? '\t' + w.frequency : ''}`));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue