class: CharacterArray
authorClaus Gittinger <cg@exept.de>
Tue, 11 Nov 2014 18:01:53 +0100
changeset 17043 4cd789620782
parent 17042 f381b63198e1
child 17044 f5b6a6f70b91
class: CharacterArray changed: #article
CharacterArray.st
--- a/CharacterArray.st	Tue Nov 11 17:51:09 2014 +0100
+++ b/CharacterArray.st	Tue Nov 11 18:01:53 2014 +0100
@@ -283,7 +283,6 @@
     "Created: 3.8.1997 / 18:16:40 / cg"
 ! !
 
-
 !CharacterArray class methodsFor:'cleanup'!
 
 lowSpaceCleanup
@@ -327,7 +326,6 @@
     "
 ! !
 
-
 !CharacterArray class methodsFor:'pattern matching'!
 
 matchEscapeCharacter
@@ -725,7 +723,6 @@
     ^ self == CharacterArray
 ! !
 
-
 !CharacterArray methodsFor:'Compatibility-ANSI'!
 
 addLineDelimiters
@@ -4270,8 +4267,6 @@
 ! !
 
 
-
-
 !CharacterArray methodsFor:'matching - glob expressions'!
 
 compoundMatch:aString
@@ -4955,7 +4950,6 @@
 ! !
 
 
-
 !CharacterArray methodsFor:'padded copying'!
 
 centerPaddedTo:newSize
@@ -5122,6 +5116,15 @@
     ((firstChar isVowel and:[firstChar ~~ $u]) or:[firstChar == $x]) ifTrue:[
         ^ 'an'
     ].
+
+    "/ exceptions: 3 non-vowels in a row: looks like an abbreviation
+    (self size >= 3) ifTrue:[
+        (firstChar isVowel not
+        and:[(self at:2) isVowel not       
+        and:[(self at:3) isVowel not ]]) ifTrue:[       
+            ^ 'an'
+        ]
+    ].
     ^ 'a'
 
     "
@@ -5129,6 +5132,7 @@
         'xmas' article.
         'alarm' article.
         'baby' article.
+        'sql' article.  
     "
 !
 
@@ -5584,7 +5588,6 @@
     "Modified: 17.4.1997 / 12:50:23 / cg"
 ! !
 
-
 !CharacterArray methodsFor:'special string converting'!
 
 asUnixFilenameString
@@ -6575,7 +6578,6 @@
     "
 ! !
 
-
 !CharacterArray methodsFor:'substring searching'!
 
 findRangeOfString:subString
@@ -7159,15 +7161,14 @@
     ^ aVisitor visitString:self with:aParameter
 ! !
 
-
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.549 2014-11-11 10:23:47 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.550 2014-11-11 17:01:53 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.549 2014-11-11 10:23:47 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.550 2014-11-11 17:01:53 cg Exp $'
 ! !