mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-01-09 07:41:06 +08:00
* exposing online punctuation model support in node-addon-api * renaming nodejs-addon-examples/test_punctuation.js to test_offline_punctuation.js * adding test_online_punctuation to nodejs-addon-examples and updating CI to run test_offline_punctuation and test_online_punctuation
27 lines
557 B
JavaScript
27 lines
557 B
JavaScript
const addon = require('./addon.js');
|
|
|
|
class OfflinePunctuation {
|
|
constructor(config) {
|
|
this.handle = addon.createOfflinePunctuation(config);
|
|
this.config = config;
|
|
}
|
|
addPunct(text) {
|
|
return addon.offlinePunctuationAddPunct(this.handle, text);
|
|
}
|
|
}
|
|
|
|
class OnlinePunctuation {
|
|
constructor(config) {
|
|
this.handle = addon.createOnlinePunctuation(config);
|
|
this.config = config;
|
|
}
|
|
addPunct(text) {
|
|
return addon.onlinePunctuationAddPunct(this.handle, text);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
OfflinePunctuation,
|
|
OnlinePunctuation,
|
|
}
|