duckduckgo / zeroclickinfo-goodies

DuckDuckGo Instant Answers based on Perl & JavaScript
https://duckduckhack.com/
Other
979 stars 1.76k forks source link

Make "flip" (FlipText) reversable #121

Closed rpicard closed 12 years ago

rpicard commented 12 years ago

"flip abc" gives ɔqɐ so "flip ɔqɐ" should give "abc."

If you take a look at the fliptext-reverse branch, I've extended the hash to include reversed elements for each of the unicode characters.

This isn't enough though; it's still not working in duckpan query. If you can make it work, please submit a pull request with your changes.

majuscule commented 12 years ago

I'm not sure why yours wasn't working, I think possibly something about the ordering? The hash keys need to be searched before the values. I used reverse which reverses the hash and added an extra elsif clause to search the new hash. It seems to have solved the problem :-)

rpicard commented 12 years ago

Great! Thanks for picking this one up.