Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

force exceptions to lc or uc

  • Loading branch information...
commit 4d51ab7f6d4e25b03009543070fb1346ef3ef301 1 parent e17e4d4
@TimToady TimToady authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 S32-setting-library/Str.pod
View
10 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.
Please sign in to comment.
Something went wrong with that request. Please try again.