mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-27 03:56:50 -06:00
Merge pull request #1329
This commit is contained in:
@@ -357,6 +357,9 @@ impl Dictionary {
|
||||
|
||||
/// Is `word` spelt correctly? Capitalised and upper-case forms of a lower-case word pass.
|
||||
pub fn check(&self, word: &str) -> bool {
|
||||
if word.contains('\u{2019}') {
|
||||
return self.check(&word.replace('\u{2019}', "'"));
|
||||
}
|
||||
if word.is_empty() || word.chars().all(|c| !c.is_alphabetic()) {
|
||||
return true;
|
||||
}
|
||||
@@ -800,6 +803,13 @@ SFX D Y 1\nSFX D 0 ed/S .\n";
|
||||
Dictionary::parse(AFF.as_bytes(), DIC.as_bytes())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn curly_apostrophe_matches_ascii_entry() {
|
||||
let d = Dictionary::parse(AFF.as_bytes(), "2\ndon't\nwork\n".as_bytes());
|
||||
assert!(d.check("don't"));
|
||||
assert!(d.check("don\u{2019}t"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn roots_affixes_and_cross_products_check() {
|
||||
let d = d();
|
||||
|
||||
Reference in New Issue
Block a user