Popup Politicians - 2.0

This is version 2.0 of popuppoliticians. We have improved the functionality greatly over the first version of our autotagging code. Below are examples of the improvements and what we do and do not support.

Installation

To install you need to include only the following single line of JavaScript in the head of your webpage:

	<script src="http://sunlightlabs.com/widgets/sunlightlinks_autopop.js"></script>
	

Links

Popups will not tag a name if it is already a link inside a link . Thus, Rep. Nancy Pelosi used outside of a link is recognized and tagged, but a link to read about Rep. John Tester is ignored.

First Use

Popups only tags names the first time they are used on a page. This second mention of Rep. Nancy Pelosi is skipped because her name was previously tagged above.

Disambiguation

Popups will not tag a name if it is ambigiuous. Thus, representative Mike Rogers (which could be one of two people) will not be tagged but Rep. Mike Dennis Rogers is recognized and tagged.

Middle name checking

Previous versions might have tagged non-names as there was no strict middle name matching. However, this is now fixed. Example: There was representative that visited Israel (which was tagged in old code) but it was not Rep. Israel. This does mean that one must be strict in spelling out the official name in full: Sen. Hillary Rodham Clinton will be tagged but Sen. Hillary R. Clinton will not.

Nicknames

Popuppoliticians also supports well known nicknames such as those found in Sen. Timothy Peter (Tim) Johnson,
Representative Edwin (Ed) Perlmutter, Senator Jefferson Beauregard SESSIONS, Representative John J. H. (Joe) SCHWARZ, Senator Kathyrn Ann Bailey (Kay) HUTCHISON, and even Senator John Davison IV (Jay) ROCKEFELLER.

Two-word last names

Previous version of the popups would not have recognized people such as Rep. Van Hollen who has two words to his last name or representatives such as Rep. David Wu that has just two letters to his last name.

Foreign Characters

This new version will now support characters with foreign characters, e.g., á, é etc. Examples: Rep. Ellen O'Kane Tauscher, Rep. Edward López Pastor, Rep. Linda Sánchez, Rep. Raúl Grijalva, and Rep. Robert Menéndez.

Case insensitivity

Names can be a mix of upper and lower case letters and they will be tagged: REp. RoBeRt adERHolT, and rep. GabRIelle giffORDs.

Forms

Previous version of the popups would have tagged data within textareas, input fields an other form elements. Not any more. The code will tag the first occurrence of a name outside thes types of tags.

This is a form



or tag inside this checkbox

However, we will tag all of these names outside these form elements. Proof: Sen. John Kerry, Rep. Cathy McMorris, Representative Debbie WASSERMAN SCHULTZ, and Rep. Michael Turner

Finally, we will tag within spans: so long as there is some text around Sen. Lincoln Chafee