tapeinosyne / hyphenation

Text hyphenation for Rust
Apache License 2.0
53 stars 12 forks source link

API stabilization #9

Open tapeinosyne opened 8 years ago

tapeinosyne commented 8 years ago

Tentatively:

hyphenate : &corpus<strategy> -> newtype

opportunities : newtype -> Vec<strategy::opportunity>

syllables : newtype -> iter

punctuate/punctuate_with : iter -> intersperse<iter>

breakpoints_from_separators : str -> Vec<strategy::opportunity>
mattiasflodin commented 6 years ago

You probably already realize this, but just in case: fixing issue #1 will require an API change. A hyphenation opportunity needs to come with information on how the word changes (e.g. zucker -> zukker) due to hyphenation. Alternatively, perhaps each opportunity should be described as a pair of string slices containing the part before and after hyphenation point (e.g. ("zuk", "ker")).