yh646492956
Committed by GitHub

Solve the issue of missing the last sentence with punctuation (#856)

Co-authored-by: Hao You <13182720519@sina.cn>
... ... @@ -8,6 +8,7 @@
#include <string>
#include <utility>
#include <vector>
#include <math.h>
#if __ANDROID_API__ >= 9
#include "android/asset_manager.h"
... ... @@ -60,7 +61,7 @@ class OfflinePunctuationCtTransformerImpl : public OfflinePunctuationImpl {
int32_t segment_size = 20;
int32_t max_len = 200;
int32_t num_segments = (token_ids.size() + segment_size - 1) / segment_size;
int32_t num_segments = ceil(((float)token_ids.size() + segment_size - 1) / segment_size);
std::vector<int32_t> punctuations;
int32_t last = -1;
... ...