duckduckgo/duckduckgo — pull request #56 by moollaza (2013-12-27 15:51:46+00:00)
Title: Words.pm - Simplified Words Triggering

//cc @yegg @nilnilnil @russellholt

While @yegg and I were trying to solve a potential triggering problem, we began refactoring a small portion of `Words.pm`.

The triple ternary used to check for trigger matches has been simplified and now allows a fallback check against other trigger types that also matches against the current word. Therefore if an IA has both a `start` and `any` trigger that match against the current word, if the `start` trigger fails to match, the `any` trigger still has an opportunity to match. Before, only the first type of trigger that partially matched was checked and upon failure, the next word was considered.

Most of this fix was written by @yegg, I've provided the comments.