Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Goodie LOLCAT Translator #740

Closed
wants to merge 5 commits into from
Closed

Goodie LOLCAT Translator #740

wants to merge 5 commits into from

Conversation

JohnCarlosReed
Copy link
Contributor

screenshot from 2014-11-10 21 47 07

What does your Instant Answer do?
Converts text into the LOLCAT language

What problem does your Instant Answer solve (Why is it better than organic links)?
It is a dynamic translator

What is the data source for your Instant Answer? (Provide a link if possible)
The Goodie PM file source code
https://github.com/JohnCarlosReed/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/LOLCAT.pm

What are some example queries that trigger this Instant Answer?
lolcat followed by any text

Which communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)
meme lovers, cat people, geeks

Is this Instant Answer connected to a DuckDuckHack Instant Answer idea?
Yes: https://duck.co/ideas/idea/4595/lolcat-translator-goodie

Which existing Instant Answers will this one supercede/overlap with?
None

Are you having any problems? Do you need our help with anything?
No

Where did you hear about DuckDuckHack? (For first time contributors)
Searched for Perl open source projects

Checklist

Please place an 'X' where appropriate.

[X] Added metadata and attribution information (https://duck.co/duckduckhack/metadata)
[X] Wrote test file and added to t/ directory (https://duck.co/duckduckhack/goodie_tests)
[X] Verified that instant answer adheres to design guidelines (https://duck.co/duckduckhack/design_styleguide)
[] Verified that instant answer adheres to code styleguide (https://duck.co/duckduckhack/code_styleguide)
[] Tested cross-browser compatibility

    Please let us know which browsers/devices you've tested on:
    - Ubuntu 14
        [X] Firefox

# Metadata.
name "LOLCAT";
description "Convert text to LOLCAT language";
primary_example_queries "lolcat have cheeseburger";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you ensure there's a test for the primary_example_query ?

@mintsoft
Copy link
Collaborator

@JohnCarlosReed Thanks for the contribution! I've put some minor bits of feedback on for you.

@JohnCarlosReed
Copy link
Contributor Author

@mintsoft Thanks Rob. I've addressed your points. Could you please re-review whenever you get a chance?

attribution github => ["JohnCarlosReed", "John Reed"],
twitter => "johnnycarlos";

my %repl = (
Copy link
Member

Choose a reason for hiding this comment

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

I think @mwmiller might suggest here that using some sort of JSON/YAML file that can be slurped would be the best way to build this kind of static hash.

That way it would be easier to read and update too imo. The 2 columns are a little funny.

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively moving it below the handle and switching to a single column might be just as good.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively moving it below the handle and switching to a single column might be just as good.

I don't think that's quite as good. One supposed advantage of the serialized data files is that non-perl folks can see where and how to contribute.

@mwmiller
Copy link
Contributor

This is a great candidate for one of the first auto-templated goodies. I am completely unable to find the documentation I created on this! Here's the short version. You need three bits of information. The operation you are performing ("LOLcat translation"), the input to the operation ("may I have a cheeseburger?") and the result of performing the operation ("I CAN HAZ CHEEZEBUGER?")

Then, where you're returning the translate, you add a little magic to get a styled answer:

my $input = $_;
return unless $input;
my $result = translate($input);
return $result, structured_answer => { input => [html_enc($input)], operation => 'LOLcat translation', result => html_enc($result);

@mintsoft
Copy link
Collaborator

@JohnCarlosReed Hey, just catching up; are you OK to limit the output only if all the words can be converted as @moollaza agreed? Just ping if you need any help

@zekiel
Copy link
Member

zekiel commented Jan 4, 2015

@JohnCarlosReed updates? here to help if you need anything.

@jagtalon
Copy link
Member

@JohnCarlosReed Any updates? Would love to see this out! Really cool IA. :)

@jagtalon
Copy link
Member

Closing this for now. Can always open it again!

@moollaza
Copy link
Member

Labelling as abandoned, perhaps someone from the community can finish this one up

@moollaza moollaza added this to the Abandoned PR's milestone Jan 30, 2015
@puskin94
Copy link
Collaborator

puskin94 commented Feb 4, 2015

@moollaza @jagtalon Which changes can I make, helping finishing this ??

@moollaza
Copy link
Member

moollaza commented Feb 4, 2015

@puskin94 please take a look at the feedback given here: https://github.com/duckduckgo/zeroclickinfo-goodies/pull/740/files and make sure everything has been addressed.

I'm not sure what the current state of this IA is but once those are addressed and the above comments, we can give this one another look.

@mintsoft
Copy link
Collaborator

mintsoft commented Feb 4, 2015

@moollaza @puskin94 IIRC it's just a case of making it so that it's not triggering too broadly etc

@francisbrito
Copy link
Contributor

A "quick and dirty" way to narrow down the trigger could be changing the trigger word to be lolcat say as in: lolcat say i'd like to have a cheeseburger. Maybe have the trigger word be a post-fix like this: i'd like to have a cheeseburger in lolcat. Any thoughts?

@mintsoft
Copy link
Collaborator

@francisbrito that would work to reduce the query space somewhat; however if I searched for memes related to lolcat it'd still trigger.

I think unless the query contains words that can be "lolcatted" i.e. (keys %repl) then the goodie should return.

@francisbrito Are you looking at finishing this off? Much appreciated if you are!

@moollaza
Copy link
Member

@francisbrito @mintsoft a similar IA would be the "DuckSay" Spice where we've only allowed the trigger to come at the start of the IA: https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/DuckSay.pm#L15

I think that would work in this case as well. We could also then check to make sure the words exist in the "lolcat dictionary" so that they can be translated.

@francisbrito
Copy link
Contributor

@mintsoft I didn't make clear the trigger in the post-fix example was in lolcat, meaning memes related to lolcat wouldn't return, sorry about that. Nevertheless, I understand your point, the query should only be triggered if it contains "lolcattable" (lol?) words. As for coding it, yes, I'm interested in helping finish this and other unfinished IAs to get used developing them. That being said, I have no previous expertise in Perl so any guide, tutorial or pointer is much appreciated. :)

@moollaza I agree. I'm thinking about using "lolcatsay" but it seems a little wordy. Maybe "lolsay" or "catsay" (all cats speak lolspeak after all ;))?

@mintsoft
Copy link
Collaborator

@francisbrito Both approaches sound viable to me; we can have a review about which will work most effectively on the PR 👍

With regards to getting started etc, have you run through the quickstart (https://duck.co/duckduckhack/goodie_quickstart)? It's a pretty speedy introduction to the DDH architecture that should give you a good grounding. If you are having any problems you can always post to duckduckhack@listbox.com or open a PR and we'll help you out.

@puskin94
Copy link
Collaborator

@francisbrito @mintsoft If there is any kind of problem I can help finishing it :)

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

Successfully merging this pull request may close these issues.

None yet

8 participants