Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oprah: make a slightly better guess at the article #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joostrijneveld
Copy link

Still far from perfect (e.g. for plurals and silent h's) but at least it's covering the most basic vowel case.

@@ -97,7 +97,8 @@
$dazeus->subscribe_command("oprah" => sub {
my ($self, $network, $sender, $channel, $command, $line) = @_;
$line = "car" if $line eq "";
reply("You get a $line! You get a $line! Everybody gets a $line!", $network, $sender, $channel);
$article = index("aeiou", substr($line, 0, 1)) != -1 ? "an" : "a";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my $article

Copy link
Member

@AaronVanGeffen AaronVanGeffen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patch! Looks like you forgot to declare $article (using my). Could you amend your patch?

Still far from perfect (e.g. for plurals and silent h's) but at least
it's covering the most basic vowel case.
@joostrijneveld
Copy link
Author

Right - I guess it was optimistic to think I could just write myself some Perl without properly testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants