Skip to main content

compile_pattern

Function compile_pattern 

Source
pub fn compile_pattern(pattern: &str) -> Option<HyphenationPattern>
Expand description

Parse a TeX-format hyphenation pattern string into a compiled pattern.

Pattern format: digits interleaved with lowercase letters.

  • "hy3p" → chars = ['h','y','p'], levels = [0,0,3,0]
  • ".ab4c" → chars = ['.','a','b','c'], levels = [0,0,0,4,0]
  • "2ph" → chars = ['p','h'], levels = [2,0,0]

Returns None if the pattern is empty or contains no alphabetic/dot characters.