Add missing start_time to python API (#591)
Co-authored-by: vsd-vector <askars.salimbajevs@tilde.lv>
This commit is contained in:
@@ -23,6 +23,9 @@ static void PybindOnlineRecognizerResult(py::module *m) {
|
|||||||
.def_property_readonly(
|
.def_property_readonly(
|
||||||
"tokens",
|
"tokens",
|
||||||
[](PyClass &self) -> std::vector<std::string> { return self.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(
|
.def_property_readonly(
|
||||||
"timestamps",
|
"timestamps",
|
||||||
[](PyClass &self) -> std::vector<float> { return self.timestamps; });
|
[](PyClass &self) -> std::vector<float> { return self.timestamps; });
|
||||||
|
|||||||
@@ -509,6 +509,9 @@ class OnlineRecognizer(object):
|
|||||||
def timestamps(self, s: OnlineStream) -> List[float]:
|
def timestamps(self, s: OnlineStream) -> List[float]:
|
||||||
return self.recognizer.get_result(s).timestamps
|
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:
|
def is_endpoint(self, s: OnlineStream) -> bool:
|
||||||
return self.recognizer.is_endpoint(s)
|
return self.recognizer.is_endpoint(s)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user