Acme-Yoda

 view release on metacpan or  search on metacpan

lib/Acme/Yoda.pm  view on Meta::CPAN

		$sentence =~ s/\b\Q$_\E\b/$contractions{$_}/ige;
	    }
	}
    }

    # Find out if I have a pivot word and grab the one with the lowest index
    my $pivot = $self->_get_pivot();

    return $sentence if (!$pivot);
    if (index(lc($sentence),$pivot) == 0) {
	$sentence = substr($sentence,,length($pivot)+1);
	$ending = '?';
    } else {
	return $sentence unless ($sentence=~/\b$pivot\b/);
	$sentence="$' $`$&";
    }
    # Clear leading spaces
    $sentence =~ s/^\s+//;

    # Sentence case
    $sentence = ucfirst(lc($sentence));



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