Microfoundations and measurement for ambiguity in communication with application to social networks