16 # where blah is -> where is blah
17 s/ (where|what|who)\s+(\S+)\s+(is|are) / $1 $3 $2 /i;
19 # where blah is -> where is blah
20 s/ (where|what|who)\s+(.*)\s+(is|are) / $1 $3 $2 /i;
24 s/be tellin\'?g?/tell/i;
27 s/,? any(hoo?w?|ways?)/ /ig;
28 s/,?\s*(pretty )*please\??\s*$/\?/i;
32 s/wh(at|ich)\s+(add?res?s|country|place|net (suffix|domain))/wh$1 /ig) {
33 if ((length($in) == 2) && ($in !~ /^\./)) {
39 # profanity filters. just delete it
40 s/th(e|at|is) (((m(o|u)th(a|er) ?)?fuck(in\'?g?)?|hell|heck|(god-?)?damn?(ed)?) ?)+//ig;
42 s/this (.*) thingy?/ $1/gi;
43 s/this thingy? (called )?//gi;
44 s/ha(s|ve) (an?y?|some|ne) (idea|clue|guess|seen) /know /ig;
45 s/does (any|ne|some) ?(1|one|body) know //ig;
47 s/can (you|u|((any|ne|some) ?(1|one|body)))( please)? tell (me|us|him|her)//ig;
48 s/where (\S+) can \S+ (a|an|the)?//ig;
49 s/(can|do) (i|you|one|we|he|she) (find|get)( this)?/is/i; # where can i find
50 s/(i|one|we|he|she) can (find|get)/is/gi; # where i can find
51 s/(the )?(address|url) (for|to) //i; # this should be more specific
52 s/(where is )+/where is /ig;
55 if ($in =~ s/\s*[\/?!]*\?+\s*$//) {
61 s/^\s+|\s+$//g; # why twice, see Question.pl
73 s/(^|\W)\Q$who\Es\s+/$1${who}\'s /ig;
74 s/(^|\W)\Q$who\Es$/$1${who}\'s/ig;
75 s/(^|\W)\Q$who\E\'(\s|$)/$1${who}\'s$2/ig;
77 s/(^|\s)i\'m(\W|$)/$1$who is$2/ig;
78 s/(^|\s)i\'ve(\W|$)/$1$who has$2/ig;
79 s/(^|\s)i have(\W|$)/$1$who has$2/ig;
80 s/(^|\s)i haven\'?t(\W|$)/$1$who has not$2/ig;
81 s/(^|\s)i(\W|$)/$1$who$2/ig;
84 s/(^|\s)(me|myself)(\W|$)/$1$who$3/ig;
85 s/(^|\s)my(\W|$)/$1${who}\'s$2/ig; # turn 'my' into name's
86 s/(^|\W)you\'?re(\W|$)/$1you are$2/ig;
90 $mynick = $conn->nick() if ($conn);
91 # is it safe to remove $in from here, too?
92 $in =~ s/yourself/$mynick/i;
93 $in =~ s/(^|\W)are you(\W|$)/$1is $mynick$2/ig;
94 $in =~ s/(^|\W)you are(\W|$)/$1$mynick is$2/ig;
95 $in =~ s/(^|\W)you(\W|$)/$1$mynick$2/ig;
96 $in =~ s/(^|\W)your(\W|$)/$1$mynick\'s$2/ig;
105 # vim:ts=4:sw=4:expandtab:tw=80