Skip to main content

join_sentences

Function join_sentences 

Source
pub fn join_sentences<S: AsRef<str>>(
    sentences: impl IntoIterator<Item = S>,
) -> String
Expand description

Separately translated sentences as one message, one after the other: with a space between them, except after a sentence that ends in full-width punctuation (。, !, ?, a full-width closing bracket), which Chinese and Japanese follow without a space. Empty sentences are left out.

Build a message from whole sentences this way rather than with push(' ') or join(" "): then each sentence is translated on its own and the space follows the writing of the language, including when one of the sentences falls back to English.