openelections / openelections-data-wi

Pre-processed election results for Wisconsin elections
9 stars 9 forks source link

Fix capitalization in results data #50

Open davipo opened 5 years ago

davipo commented 5 years ago

Currently we titlecase all text fields (county, office, ward, candidate). This corrupts many spellings: county: Fond du Lac ward: McFarland, McKinley, Prairie du Sac, Prairie du Chien, Fond du Lac, ... candidate: McCain, de Felice, VanDierendonck, LaDuke, FitzGerald, MaryAnn, "Ben Olson, III", ...

Our test data also has inconsistent capitalization. Current test code titlecases test data before comparing to results. When results capitalization is corrected, titlecasing should be removed, and test data corrected so it tests proper capitalization of results.

davipo commented 5 years ago

Capitalization is now corrected in candidate and county fields. Ward looks more difficult. Capitalization probably not important in office field. (Titlecase is fine, though "of" could be lower case.)

davipo commented 5 years ago

Lowercased "of" in office names. (Updated tests, and run_spot_tests.py to not titlecase them.) (Commit 4d44d34)

davipo commented 5 years ago

Ward is now the only field with undesirable capitalization. The results ward data is titlecased (wrong for some locales listed above). The capitalization of ward in the current test data is inconsistent, so run_spot_tests.py titlecases it before searching results.