Returns empty suggestion if only whitespaces
What does this MR do and why?
This MR ensures we only return empty suggestion if the model returns only whitespaces. This approach uses str.isspace()
to detect if the text only contains whitespace characters. A character is whitespace if in the Unicode character database (see unicodedata), either its general category is Zs
("Separator, space"), or its bidirectional class is one of WS
, B
, or S
.
Relates to #219 (closed)
Edited by Tan Le