pub(crate) fn unspaced_word_breaks(line: &str, boundaries: &[usize]) -> Vec<usize> {
#[cfg(feature = "southeast-asian-line-breaks")]
if line.chars().any(is_written_without_spaces) {
let end = boundaries.len() - 1;
return icu_segmenter::LineSegmenter::new_dictionary(Default::default())
.segment_str(line)
.filter_map(|byte| boundaries.binary_search(&byte).ok())
.filter(|&idx| idx > 0 && idx < end)
.collect();
}
#[cfg(not(feature = "southeast-asian-line-breaks"))]
let _ = (line, boundaries);
Vec::new()
}
#[cfg(feature = "southeast-asian-line-breaks")]
fn is_written_without_spaces(ch: char) -> bool {
use icu_properties::{CodePointMapData, props::LineBreak};
CodePointMapData::<LineBreak>::new().get(ch) == LineBreak::ComplexContext
}