Minor fixes (#161)
This commit is contained in:
@@ -219,19 +219,21 @@ std::string OfflineRecognitionResult::AsJsonString() const {
|
||||
nlohmann::json j;
|
||||
j["text"] = text;
|
||||
j["tokens"] = tokens;
|
||||
|
||||
#if 1
|
||||
// This branch chooses number of decimal points to keep in
|
||||
// the return json string
|
||||
std::ostringstream os;
|
||||
os << "[";
|
||||
std::string sep = "";
|
||||
for (auto t : timestamps) {
|
||||
os << sep << std::fixed << std::setprecision(2) << t;
|
||||
sep = ",";
|
||||
sep = ", ";
|
||||
}
|
||||
os << "]";
|
||||
|
||||
// NOTE: We don't use j["timestamps"] = timestamps;
|
||||
// because we need to control the number of decimal points to keep
|
||||
j["timestamps"] = os.str();
|
||||
#else
|
||||
j["timestamps"] = timestamps;
|
||||
#endif
|
||||
|
||||
return j.dump();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ struct OnlineRecognizerConfig {
|
||||
EndpointConfig endpoint_config;
|
||||
bool enable_endpoint = true;
|
||||
|
||||
std::string decoding_method = "modified_beam_search";
|
||||
std::string decoding_method = "greedy_search";
|
||||
// now support modified_beam_search and greedy_search
|
||||
|
||||
int32_t max_active_paths = 4; // used only for modified_beam_search
|
||||
|
||||
Reference in New Issue
Block a user