File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,17 @@ impl<S: BuildHasher> Dictionary<S> {
92
92
/// patterns" which Spellbook respects though. For example `check("light-weight-like")`
93
93
/// returns `true` for the `en_US` dictionary because the break patterns allow splitting into
94
94
/// the words "light", "weight" and "like".
95
+ ///
96
+ /// # Example
97
+ ///
98
+ /// ```
99
+ /// let dic = std::fs::read_to_string("./vendor/en_US/en_US.dic").unwrap();
100
+ /// let aff = std::fs::read_to_string("./vendor/en_US/en_US.aff").unwrap();
101
+ /// let dict = spellbook::Dictionary::new(&dic, &aff).unwrap();
102
+ ///
103
+ /// assert!(dict.check("optimize"));
104
+ /// assert!(!dict.check("optimise")); // allowed by en_GB but not en_US.
105
+ /// ```
95
106
pub fn check ( & self , word : & str ) -> bool {
96
107
Checker :: new ( self ) . check ( word)
97
108
}
You can’t perform that action at this time.
0 commit comments