Acme-Text-Shorten-ForTwitter

 view release on metacpan or  search on metacpan

lib/Acme/Text/Shorten/ForTwitter/Plugin/Contractions.pm  view on Meta::CPAN

      "you all could have"  => "y'all'd've",
      "you all would have"  => "y'all'd've",
      "you had"             => "you'd",
      "you would"           => "you'd",
      "you shall"           => "you'll",
      "you will"            => "you'll",
      "you are"             => "you're",
      "you have"            => "you've",
    );

    for my $c (reverse sort { length $a <=> length $b } keys %contractions) {
      $$text =~ s/(\b)$c(\b)/$contractions{$c}/g;
    }
  };

  return;
}

1;
__END__

lib/Acme/Text/Shorten/ForTwitter/Plugin/Texting.pm  view on Meta::CPAN

    my %textisms = (
      "your" => "ur",
      "you're" => "ur",
      "you are" => "ur",
      "why" => "y",
      "you" => "u",
      "what" => "wut",
      
    );

    for my $c (reverse sort { length $a <=> length $b } keys %textisms) {
      $$text =~ s/(\b)$c(\b)/$textisms{$c}/g;
    }
  };

  return;
}

1;
__END__



( run in 0.633 second using v1.01-cache-2.11-cpan-65fba6d93b7 )