Askars
Committed by GitHub

Add missing start_time to python API (#591)

Co-authored-by: vsd-vector <askars.salimbajevs@tilde.lv>
... ... @@ -24,6 +24,9 @@ static void PybindOnlineRecognizerResult(py::module *m) {
"tokens",
[](PyClass &self) -> std::vector<std::string> { return self.tokens; })
.def_property_readonly(
"start_time",
[](PyClass &self) -> float { return self.start_time; })
.def_property_readonly(
"timestamps",
[](PyClass &self) -> std::vector<float> { return self.timestamps; });
}
... ...
... ... @@ -509,6 +509,9 @@ class OnlineRecognizer(object):
def timestamps(self, s: OnlineStream) -> List[float]:
return self.recognizer.get_result(s).timestamps
def start_time(self, s: OnlineStream) -> float:
return self.recognizer.get_result(s).start_time
def is_endpoint(self, s: OnlineStream) -> bool:
return self.recognizer.is_endpoint(s)
... ...