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) { @@ -24,6 +24,9 @@ static void PybindOnlineRecognizerResult(py::module *m) {
24 "tokens", 24 "tokens",
25 [](PyClass &self) -> std::vector<std::string> { return self.tokens; }) 25 [](PyClass &self) -> std::vector<std::string> { return self.tokens; })
26 .def_property_readonly( 26 .def_property_readonly(
  27 + "start_time",
  28 + [](PyClass &self) -> float { return self.start_time; })
  29 + .def_property_readonly(
27 "timestamps", 30 "timestamps",
28 [](PyClass &self) -> std::vector<float> { return self.timestamps; }); 31 [](PyClass &self) -> std::vector<float> { return self.timestamps; });
29 } 32 }
@@ -509,6 +509,9 @@ class OnlineRecognizer(object): @@ -509,6 +509,9 @@ class OnlineRecognizer(object):
509 def timestamps(self, s: OnlineStream) -> List[float]: 509 def timestamps(self, s: OnlineStream) -> List[float]:
510 return self.recognizer.get_result(s).timestamps 510 return self.recognizer.get_result(s).timestamps
511 511
  512 + def start_time(self, s: OnlineStream) -> float:
  513 + return self.recognizer.get_result(s).start_time
  514 +
512 def is_endpoint(self, s: OnlineStream) -> bool: 515 def is_endpoint(self, s: OnlineStream) -> bool:
513 return self.recognizer.is_endpoint(s) 516 return self.recognizer.is_endpoint(s)
514 517