Just like the currently available methods nice_number for converting an integer to a nicely speakable version, there could be a method nice_unit or expand_unit for converting string containing units to a speakable string.
i.e. "The power plant produced 10Wh today" => "The power plant produced ten watt hours today"
"The bathroom temperature is 22 C" => "The bathroom temperature is twenty two degrees celsius"
There exist tools for unit extraction from unstructured text like quantulum (or its python3 equivalent with further development quantulum3).
These tools can be used (or supply a method, see inline_parse_and_expand at quantulum3), to convert the unit into a string.
It can be a very helpful method, used to expand wikipedia articles, wolframalpha answers or home assistant replies.
Just like the currently available methods
nice_number
for converting an integer to a nicely speakable version, there could be a methodnice_unit
orexpand_unit
for converting string containing units to a speakable string.i.e. "The power plant produced 10Wh today" => "The power plant produced ten watt hours today" "The bathroom temperature is 22 C" => "The bathroom temperature is twenty two degrees celsius"
There exist tools for unit extraction from unstructured text like quantulum (or its python3 equivalent with further development quantulum3). These tools can be used (or supply a method, see
inline_parse_and_expand
at quantulum3), to convert the unit into a string.It can be a very helpful method, used to expand wikipedia articles, wolframalpha answers or home assistant replies.