Browse files

force exceptions to lc or uc

  • Loading branch information...
TimToady committed Jul 24, 2012
1 parent e17e4d4 commit 4d51ab7f6d4e25b03009543070fb1346ef3ef301
Showing with 8 additions and 2 deletions.
  1. +8 −2 S32-setting-library/Str.pod
@@ -144,9 +144,15 @@ and to any intermediate word that the C<where> parameter smartmatches.
Assuming suitable definitions of word lists, standard English
capitalization might be handled with something like this:
- .wordcase(where => none @conjunctions, @prepositions);
+ my $where = none map *.fc, @conjunctions, @prepositions;
+ .wordcase(:$where);
-(Note, "standard" authorities disagree on the prepositions!)
+(Note that the "standard" authorities disagree on the prepositions!)
+The smartmatching is done case insensitively, so you should store
+your exceptions in C<fc> form. If the C<where> smartmatch does not
+match, then the word will be forced to lowercase unless the filter
+is C<&tcuc>, in which case the exception will be forced to uppercase.
There is no provision for an alternate regex; if you need a custom
word recognizer, you can write your own C<.subst> as above.

0 comments on commit 4d51ab7

Please sign in to comment.