Skip to content
This repository
Browse code

force exceptions to lc or uc

  • Loading branch information...
commit 4d51ab7f6d4e25b03009543070fb1346ef3ef301 1 parent e17e4d4
Larry Wall authored July 24, 2012

Showing 1 changed file with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. 10  S32-setting-library/Str.pod
10  S32-setting-library/Str.pod
Source Rendered
@@ -144,9 +144,15 @@ and to any intermediate word that the C<where> parameter smartmatches.
144 144
 Assuming suitable definitions of word lists, standard English
145 145
 capitalization might be handled with something like this:
146 146
 
147  
-    .wordcase(where => none @conjunctions, @prepositions);
  147
+    my $where = none map *.fc, @conjunctions, @prepositions;
  148
+    .wordcase(:$where);
148 149
 
149  
-(Note, "standard" authorities disagree on the prepositions!)
  150
+(Note that the "standard" authorities disagree on the prepositions!)
  151
+
  152
+The smartmatching is done case insensitively, so you should store
  153
+your exceptions in C<fc> form.  If the C<where> smartmatch does not
  154
+match, then the word will be forced to lowercase unless the filter
  155
+is C<&tcuc>, in which case the exception will be forced to uppercase.
150 156
 
151 157
 There is no provision for an alternate regex; if you need a custom
152 158
 word recognizer, you can write your own C<.subst> as above.

0 notes on commit 4d51ab7

Please sign in to comment.
Something went wrong with that request. Please try again.