Add Java and Kotlin API for punctuation models (#818)
This commit is contained in:
@@ -9,6 +9,11 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
#include "android/asset_manager.h"
|
||||
#include "android/asset_manager_jni.h"
|
||||
#endif
|
||||
|
||||
#include "sherpa-onnx/csrc/macros.h"
|
||||
#include "sherpa-onnx/csrc/math.h"
|
||||
#include "sherpa-onnx/csrc/offline-ct-transformer-model.h"
|
||||
@@ -24,6 +29,12 @@ class OfflinePunctuationCtTransformerImpl : public OfflinePunctuationImpl {
|
||||
const OfflinePunctuationConfig &config)
|
||||
: config_(config), model_(config.model) {}
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
OfflinePunctuationCtTransformerImpl(AAssetManager *mgr,
|
||||
const OfflinePunctuationConfig &config)
|
||||
: config_(config), model_(mgr, config.model) {}
|
||||
#endif
|
||||
|
||||
std::string AddPunctuation(const std::string &text) const override {
|
||||
if (text.empty()) {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user