You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently the word "hyphenation" gives opportunities as 2, 6 and 7...
Dunno which ones are correct, but it doesn't correspond to what's in the readme. Myriam Webster dictionary shows: hy·phen·ate.
Affected version 0.7.1. No other versions where tested.
Full code to reproduce
use hyphenation::*;fnmain() -> Result<(),Box<dyn std::error::Error>>{// Retrieve the embedded American English dictionary for `Standard` hyphenation.let en_us = Standard::from_embedded(Language::EnglishUS) ?;// Identify valid breaks in the given word.let hyphenated = en_us.hyphenate("hyphenation");// Word breaks are represented as byte indices into the string.let break_indices = &hyphenated.breaks;assert_eq!(break_indices,&[2,6]);// The segments of a hyphenated word can be iterated over.let segments = hyphenated.into_iter();let collected :Vec<String> = segments.collect();assert_eq!(collected, vec!["hy","phen","ation"]);// `hyphenate()` is case-insensitive.let uppercase :Vec<_> = en_us.hyphenate("CAPITAL").into_iter().collect();assert_eq!(uppercase, vec!["CAP","I","TAL"]);Ok(())}
The text was updated successfully, but these errors were encountered:
Apparently the word "hyphenation" gives opportunities as 2, 6 and 7...
Dunno which ones are correct, but it doesn't correspond to what's in the readme. Myriam Webster dictionary shows: hy·phen·ate.
Affected version
0.7.1
. No other versions where tested.Full code to reproduce
The text was updated successfully, but these errors were encountered: