#!/usr/local/bin/perl -w # Program to count minimal pairs by gender # Author: Katy # Last modified: December 2006 %Goodwords = ("mhm" => 1, "right" => 1, "well" => 1, "yeah" => 1, "sure" => 1, "good" => 1, "ah" => 1, "okay" => 1, "yep" => 1, "hm" => 1, "definitely" => 1, "alright" => 1, "'m'm" => 1, "oh" => 1, "my" => 1, "god" => 1, "wow" => 1, "uhuh" => 1, "exactly" => 1, "yup" => 1, "mkay" => 1, "i see" => 1, "ooh" => 1, "cool" => 1, "uh" => 1, "fine" => 1, "true" => 1, "hm'm" => 1, "hmm" => 1, "yes" => 1, "absolutely" => 1, "great" => 1, "um" => 1, "so" => 1, "mm" => 1, "weird" => 1, "ye-" => 1, "i mean" => 1, "i know" => 1, "i think so" => 1, "huh" => 1, "yay" => 1, "maybe" => 1, "eh" => 1, "obviously" => 1, "correct" => 1, "awesome" => 1, "really" => 1, "interesting" => 1,); while(<>){ if(/(S[\w\-]+):.*Gender:\s+(Male|Female)/i){ $speakerID = $1; $speaker{$1}=$2;} if($good){ $good = 1; $minresgen{$speaker{$speakerID}}++;} $_=~ /\[(S[\w\-]+):(.*?)\]/i; use diagnostics; $minres = $2; $speakerID = $1; $minres =~ s/<.*?>//g; $minres = lc($minres); $good = 1; while($minres =~ /(\w+)/g) { unless($Goodwords{$1}) { $good = 0; last; } } print "Male:"; print $minresgen {"Male"}; print "Female:"; print $minresgen {"Female"}; } #### S1: Native-Speaker Status: Native speaker, American English; Academic Role: Senior Undergraduate; Gender: Male; Age: 17-23; Restriction: None
S2: Native-Speaker Status: Native speaker, American English; Academic Role: Researcher; Gender: Male; Age: 31-50; Restriction: Cite
S3: Native-Speaker Status: Native speaker, American English; Academic Role: Junior Undergraduate; Gender: Female; Age: 17-23; Restriction: None
S4: Native-Speaker Status: Native speaker, American English; Academic Role: Senior Undergraduate; Gender: Female; Age: 17-23; Restriction: None
S5: Native-Speaker Status: Native speaker, American English; Academic Role: Junior Undergraduate; Gender: Female; Age: 17-23; Restriction: None
SS: Native-Speaker Status: Native speaker, American English; Academic Role: Unknown; Gender: Male; Age: Unknown; Restriction: None

S1: it was presented to them by Chuck D and Public Enemy. [S2: mhm ] and the rest of th- Public Enemy and you know and and Chuck D's f- publicly gets up and says you know they were with us from the beginning and, [S2: mhm ] all that now wheth- whether or not you know that he was reading a TelePrompTer, [S2: mhm ] or or not i i think is uh

S2: or if he was trying to make nice because of the fact that Public Enemy hasn't sold records lately, [S1: right ] and he doesn't wanna look like some kinda old sourpuss

##
## Use of uninitialized value in hash element at C:\Documents and Settings\Owner\Desktop\minres10.pl.txt line 62, <> line 557 (#1) Use of uninitialized value in substitution (s///) at C:\Documents and Settings\Owner\Desktop\minres10.pl.txt line 67, <> line 557 (#1) Use of uninitialized value in print at C:\Documents and Settings\Owner\Desktop\minres10.pl.txt line 78, <> line 557 (#1) Use of uninitialized value in print at C:\Documents and Settings\Owner\Desktop\minres10.pl.txt line 80, <> line 557 (#1) #### Variable "$speakerID" is not imported at C:\Documents and Settings\Owner\Desktop\minres10.pl.txt line 67 (#1) (F) While "use strict" in effect, you referred to a global variable that you apparently thought was imported from another module, because something else of the same name (usually a subroutine) is exported by that module. It usually means you put the wrong funny character on the front of your variable. Variable "$good" is not imported at ... line 70 (#1) Variable "%Goodwords" is not imported at ... line 72 (#1) Variable "$good" is not imported at ... line 73 (#1) Variable "%minresgen" is not imported at ... line 79 (#1) Variable "%minresgen" is not imported at ... line 81 (#1) Global symbol "$minres" requires explicit package name at ...line 66 ..."$speakerID" ...line 67 ..."$minres" ... line 68 ... "$minres" ... line 69 ... "$minres" ... line 69 ... "$good" ... line 70 ... "$minres" ... line 71 ..."%Goodwords" ... line 72 ..."$good" ... line 73 ..."%minresgen" ... line 79 ..."%minresgen" ... line 81 (F) You've said "use strict vars," which indicates that all variables must either be lexically scoped (using "my"), declared beforehand using "our," or explicitly qualified to say which package the global variable is in (using "::").