Project 1: How Many Lines? (code available on Github)
One thing I’d like to do, if possible, is to use these mini-programming projects to solve problems that are interesting to me. In this case: how many lines does each Shakespeare character in any given play have to say?
I looked around for well-formatted versions of the play texts that I could use, and found these complete and attractively marked-up versions made available by MIT.
Scope:
Keeping it simple. Take an external file of a Shakespeare play, determine how many lines each character gets, and display those values.
What I Learned:
- Javascript and a little jQuery. I hadn’t played much with Javascript before, but was happy to learn it shared a lot syntax-wise with the C languages.
- How to traverse the DOM.
- Bootstrap. That is, how to display the results in semi-attractive fashion. I really appreciate Anna Powell-Smith’s great article How to Make Your Site Look Half-Decent in Half an Hour. Using Bootstrap is a quick and effective way to make things look decent, and that’s all I really need right now.
What I Left:
- Rigorous checking of speaker names to avoid accidental duplication. Lady Capulet appears twice in the list of Romeo & Juliet characters, which means one is probably formatted slightly differently than the other, but I’m not going to do a lot of error-checking there. Or, for instance, “First Gentleman” and “First Gentlemen” appear as two different people, though they’re obviously the same.
- Optimization. This was established in my ground rules. I can see the results don’t display with lightening speed, but they display and that’s good enough for now.
Future Additions:
- I’m going to be learning D3.js next so I can add some attractive graphs!