36
1
Because of this, you need a better way of working out if a phrase is an acronym of a word. You also think it would be worthwhile to see if the phrase and word in question are recursive acronyms.
Your task:
Given a word and then a phrase separated by a line, output if the phrase is an acronym and then if it is a recursive acronym. (The phrase contains what it stands for)
- The input will compose of alphabetical characters as well as spaces.
- Your program shouldn't be case sensitive.
Example Input/Output:
Case 1:
Input:
Acronyms
Acronyms can really obviously narrow your message sensors
Output:
True
True
Case 2:
Input:
FAQ
frequently asked questions
Output:
True
False
Case 3:
Input:
foo
bar baz
Output:
False
False
Case 4:
Input:
GNU
GNU is not Unix
Output:
False
False
Case 5:
Input:
Aha
A huge Aha
Output:
True
True
69Acronyms Can Recurse? Oh! Now You're Making Sense. – Geobits – 2015-10-19T17:04:21.340
Do the newlines need to be present in the output? – Morgan Thrapp – 2015-10-19T17:49:57.960
2No, just as long as it's clear what the output is – Blue – 2015-10-19T18:05:52.687
9
This reminds me of an XKCD: http://xkcd.com/917
– ETHproductions – 2015-10-19T18:14:31.0901Related. – Martin Ender – 2015-10-19T18:25:18.757
1New test case:
Lolcat
:Laughing over lolcat captions and tearing
. Is thisTrue/True
or do recursive acronyms need to recurse at the first or last word? – Not that Charles – 2015-10-19T18:44:25.290Yes it is True/True. – Blue – 2015-10-19T18:53:31.447
4ABCDE: Another basic clearly defined example. – John Dvorak – 2015-10-20T05:08:02.020
1What should be the output for
GNU
:Gnus nettle unicorns
? – DLosc – 2015-10-20T16:59:04.073True False. That probably breaks some stuff doesn't it? Let's say that case doesn't matter. – Blue – 2015-10-20T17:11:15.847
This reminds me of the Contracrostipunctus from Douglas Hofstadter's Gödel, Escher, Bach, which contains the acrostic "Hofstadter's Contracrostipunctus Acrostically Backwards Spells 'J.S. Bach'." – Neil – 2015-10-20T23:54:15.210
You should add the example
PHP -> PHP Hypertext Preprocessor
, since that's a real acronym. – mbomb007 – 2015-10-21T21:54:14.323