can it be done simply through his api (requireFailure,recgnizeWith, etc.)?
here is an example I wrote. Please help me improve the above requirements
https://codepen.io/russell201.
if it is more complicated, I think it can also be judged by the isFinal returned by him, but the code is very verbose.