Reverse the gender of a string
Mechanically, this task is trivial. Raku provides several flexible and powerful methods to wrangle text. Linguistically, this task is impossible (and laughable). Mappings are non-regular and in many cases, non-deterministic without semantic analysis of the content and context, which is WAY beyond what anyone is going to invest in a Rosettacode task. Whatever.
For extremely limited circumstances such as this example, this should suffice. Notice case matching and replication. Handles contractions, but ignores embedded matching text.
Output:
PreviousReverse a stringNextReverse the order of lines in a text file while preserving the contents of each line
Last updated