How does automator know that the text that it receives, is an address?
OS X features NSDataDetector which has the ability to detect types of data.

More information regarding the NSDataDetector class can be found on Apple's developer site:


https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSDataDetector_Class/