From 7a37515b579a02e4bb560fed54064d0ab229be14 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 18 Oct 2006 05:48:23 +0000 Subject: [PATCH] don't spell-check Chinese (or any sequence of uncased letters) svn: r4627 --- collects/sirmail/spell.ss | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/collects/sirmail/spell.ss b/collects/sirmail/spell.ss index d16975db99..0f71585482 100644 --- a/collects/sirmail/spell.ss +++ b/collects/sirmail/spell.ss @@ -13,9 +13,13 @@ [word-count (-> number?)]) (define-lex-abbrevs - (extended-alphabetic (:or alphabetic #\')) - (word (:: (:* extended-alphabetic) (:+ alphabetic) (:* extended-alphabetic))) - (paren (char-set "()[]{}"))) + ;; Treat only letters with casing for spelling. This avoids + ;; Chinese, for example, where the concept of spelling doesn't + ;; really apply. + (cased-alphabetic (:or lower-case upper-case title-case)) + (extended-alphabetic (:or cased-alphabetic #\')) + (word (:: (:* extended-alphabetic) (:+ cased-alphabetic) (:* extended-alphabetic))) + (paren (char-set "()[]{}"))) (define get-word (lexer @@ -23,7 +27,7 @@ (values lexeme 'white-space #f (position-offset start-pos) (position-offset end-pos))) (paren (values lexeme 'other (string->symbol lexeme) (position-offset start-pos) (position-offset end-pos))) - ((:+ (:~ (:or alphabetic whitespace paren))) + ((:+ (:~ (:or cased-alphabetic whitespace paren))) (values lexeme 'other #f (position-offset start-pos) (position-offset end-pos))) (word (let ((ok (spelled-correctly? lexeme)))