Acme-Text-Shorten-ForTwitter
view release on metacpan or search on metacpan
lib/Acme/Text/Shorten/ForTwitter/Plugin/Contractions.pm view on Meta::CPAN
"there has" => "there's",
"there is" => "there's",
"they had" => "they'd",
"they have" => "they'd",
"they would have" => "they'd've",
"they will" => "they'll",
"they shall" => "they'll",
"they are" => "they're",
"they have" => "they've",
"was not" => "wasn't",
"we had" => "we'd",
"we would" => "we'd",
"we would have" => "we'd've",
"we will" => "we'll",
"we are" => "we're",
"we have" => "we've",
"were not" => "weren't",
"what shall" => "what'll",
"what will" => "what'll",
"what are" => "what're",
"what has" => "what's",
"what is" => "what's",
"what does" => "what's",
"what did" => "what'd",
"what have" => "what've",
"when has" => "when's",
"when is" => "when's",
"where did" => "where'd",
"where has" => "where's",
"where is" => "where's",
"where have" => "where've",
"who would" => "who'd",
"who had" => "who'd",
"who would have" => "who'd've",
"who shall" => "who'll",
"who will" => "who'll",
"who are" => "who're",
"who has" => "who's",
"who is" => "who's",
"who have" => "who've",
"why will" => "why'll",
"why are" => "why're",
"why has" => "why's",
"why is" => "why's",
"will not" => "won't",
"would have" => "would've",
"would not" => "wouldn't",
"would not have" => "wouldn't've",
"you all" => "y'all",
"you all should have" => "y'all'd've",
"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__
=head1 NAME
Acme::Text::Shorten::ForTwitter::Plugin::Contractions - Common English contractions
=head1 DESCRIPTION
Adds shorteners for things like:
"I am" -> "I'm",
"I would have" => "I'd've",
etc...
=head1 AUTHOR
Matthew Horsfall (alh) - <wolfsage@gmail.com>
=cut
( run in 1.377 second using v1.01-cache-2.11-cpan-5511b514fd6 )