Closed MatrixFrog closed 14 years ago
Yes, you're absolutely right, this is a bad solution - but there's no good programmatic way to do it that I can think of.
I added this in a very early version of the app, when it became clear that news articles only use the term "Speaker" to refer to Pelosi, and that Eleanor Holmes Norton is always referred to with her middle name. If I'd run up against other exceptions, I'd have added them, doesn't have anything to do with the people themselves.
The issue is that from a data standpoint, the information comes from the Sunlight Congress API, and there aren't any mistakes in the data. "Speaker" isn't her official title as a representative of her district (any more than Steny Hoyer or John Boehner's title is "Leader"), and we do have Del. Norton's middle name on record. She's just the only one (that I know of) whose middle name is used like that. I suppose we could make her first name "Eleanor" and her nickname "Eleanor Holmes", but that's awkward too, and any changes we make affect other consumers of the API.
Unfortunately, I'm also unwilling to let the News tab for Nancy Pelosi go empty, that's just not reasonable for an app about Congress. So I'm left with a bad solution. Any ideas?
Just to clarify, you're saying that lots of legislators have middle names listed, but Del. Norton is the only one whose middle name always shows up in the media?
As for Speaker Pelosi, it would be nice of the Sunlight Labs API provided some way of finding out who is currently Speaker of the House. So maybe you would get something like:
{"legislator": {"district": "8", "title": "Rep", "eventful_id": "P0-001-000016548-5", "in_office": true, "speaker_of_the_house": true, ...
although that admittedly seems silly.
Well, if we added any extra columns for this, the more general way to do it would be a "leadership_title" field, that might contain "Majority Whip", "Minority Leader", "Speaker", etc. Which is an interesting idea, and I'll bring it up internally, but I don't know if it's gonna happen. For now, let's assume it won't.
And yes, I'm saying that lots of legislators have middle names listed, but Del. Norton is the only one who actually uses it in her common name.
I had a good conversation today with the Open States project (http://openstates.sunlightlabs.com/) about how they're handling names, and their inclination is to use last_name, full_name (the original full name with all prefixes, names, and suffixes), and then canonical_name (the name a legislator "goes by").
I'll suggest adding a full_name field to the Congress API, but I don't have control over it, and it would add even more work to maintaining the data, which I consider a valid argument given how much work already goes into keeping it up to date. We should assume the name field structure isn't going to change.
Sounds good! I think that if this one little thing is the worst "hacky workaround" in the code, then we're in pretty good shape. =)
Currently, the method LegislatorTabs.correctExceptions, singles out Nancy Pelosi and Eleanor Holmes Norton for special treatment:
apparently because they are the Speaker of the House, and the delegate from Washington D.C., respectively? While I don't wish to debate here whether these women are worthy of being distinguished in this way, it seems to me that it would be better to do this programmatically somehow, so that when someone else becomes the Speaker, we don't have to manually change the code.