| 1 | package Decaptcha::TextCaptcha; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Exporter qw(import); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Lingua::EN::Words2Nums; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use List::Util qw(first max min); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | $VERSION = eval $VERSION; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | our @EXPORT = qw(decaptcha); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | my %body_part = map { $_ => 1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ankle arm brain chest chin ear elbow eye face finger foot hair hand head | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | heart knee leg nose stomach thumb toe tongue tooth waist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | my %head_part = map { $_ => 1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | brain chin ear eye face hair head mouth nose tooth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | my %multiple_part = map { $_ => 1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | ankle arm ear elbow eye finger foot hand knee leg thumb toe tooth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | my %part_above_waist = map { $_ => 1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | arm brain chest chin ear elbow eye face finger foot hair hand head heart | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | mouth nose stomach thumb tongue tooth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 2 | my %part_below_waist = map {$_ => 1} qw( ankle foot knee leg toe ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | my %colors = map { $_ => 1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | black blue brown green pink purple red white yellow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | my @days = qw(sunday monday tuesday wednesday thursday friday saturday); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | my %days; @days{@days} = (0 .. @days); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | my %weekend = map { $_ => 1 } @days[0,6]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 120 | ▶ | sub decaptcha { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
decaptcha: called CC=101 SCAR=46.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 120 | ▶ | my $q = shift or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 118 | my $lq = lc $q; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | # Words and letters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 118 | ▶ | if ($lq eq 'which word in this sentence is all in capitals?') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | ▶ | my $word = first { ! tr/a-z// } split /\W+/, $q; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 2 | ▶ | return $word ? lc $word : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 116 | ▶ | if ($lq =~ /^(?:the word )?"(.*?)" has how many letters\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$lq =~ /^(?:the word )?"(.*?)" has how many letters\?$/ or $lq =~ /^how many letters in (?:the word )?"(.*?)"\?$/
MC/DC100%2/2
$lq =~ /^(?:the word )?"(.*?)" has how many letters\?$/ or $lq =~ /^how many letters in (?:the word )?"(.*?)"\?$/
$lq =~ /^(?:the word )?"(.*?)" has how many letters\?$/
$lq =~ /^how many letters in (?:the word )?"(.*?)"\?$/
Truth table100%3/3
A or B
A= $lq =~ /^(?:the word )?"(.*?)" has how many letters\?$/B= $lq =~ /^how many letters in (?:the word )?"(.*?)"\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | or $lq =~ /^how many letters in (?:the word )?"(.*?)"\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 2 | return length $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 114 | ▶ | if ($q =~ /^The word in capitals from (.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$q =~ /^The word in capitals from (.*?) is\?$/ or $q =~ /^Which word is all in capitals: (.*?)\?$/ or $q =~ /^Which of (.*?) is in capitals\?$/
$q =~ /^The word in capitals from (.*?) is\?$/ or $q =~ /^Which word is all in capitals: (.*?)\?$/
MC/DC100%3/3
$q =~ /^The word in capitals from (.*?) is\?$/ or $q =~ /^Which word is all in capitals: (.*?)\?$/ or $q =~ /^Which of (.*?) is in capitals\?$/
$q =~ /^The word in capitals from (.*?) is\?$/
$q =~ /^Which word is all in capitals: (.*?)\?$/
$q =~ /^Which of (.*?) is in capitals\?$/
Truth table100%4/4
A or B or C
A= $q =~ /^The word in capitals from (.*?) is\?$/B= $q =~ /^Which word is all in capitals: (.*?)\?$/C= $q =~ /^Which of (.*?) is in capitals\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | or $q =~ /^Which word is all in capitals: (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | or $q =~ /^Which of (.*?) is in capitals\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 4 | ▶ | my $word = first { ! tr/a-z// } split /(?:,\s*| or )/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 4 | ▶ | return $word ? lc $word : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 110 | ▶ | if ($lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/ or $lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/ or $lq =~ /^what word from "(?<l>.*?)" begins with "(?<c>.)"\?$/ or $lq =~ /^(?<l>.*?): the word starting with "(?<c>.)" is\?$/
$lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/ or $lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/ or $lq =~ /^what word from "(?<l>.*?)" begins with "(?<c>.)"\?$/
$lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/ or $lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/
MC/DC100%4/4
$lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/ or $lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/ or $lq =~ /^what word from "(?<l>.*?)" begins with "(?<c>.)"\?$/ or $lq =~ /^(?<l>.*?): the word starting with "(?<c>.)" is\?$/
$lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/
$lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/
$lq =~ /^what word from "(?<l>.*?)" begins with "(?<c>.)"\?$/
$lq =~ /^(?<l>.*?): the word starting with "(?<c>.)" is\?$/
Truth table100%5/5
A or B or C or D
A= $lq =~ /^which word starts with "(?<c>.)" from the list: (?<l>.*?)\?$/B= $lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/C= $lq =~ /^what word from "(?<l>.*?)" begins with "(?<c>.)"\?$/D= $lq =~ /^(?<l>.*?): the word starting with "(?<c>.)" is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | or $lq =~ /which word from list "(?<l>.*?)" has "(?<c>.)" as a first letter\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | or $lq =~ /^what word from "(?<l>.*?)" begins with "(?<c>.)"\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | or $lq =~ /^(?<l>.*?): the word starting with "(?<c>.)" is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 6 | ▶ | return first { $+{c} eq substr $_, 0, 1 } split /,\s*/, $+{l}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 104 | ▶ | if ($lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/ or $lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/ or $lq =~ /^what word from "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/ or $lq =~ /^which word from list "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/
$lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/ or $lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/ or $lq =~ /^what word from "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/
$lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/ or $lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/
MC/DC100%4/4
$lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/ or $lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/ or $lq =~ /^what word from "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/ or $lq =~ /^which word from list "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/
$lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/
$lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/
$lq =~ /^what word from "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/
$lq =~ /^which word from list "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/
Truth table100%5/5
A or B or C or D
A= $lq =~ /^which word contains "(?<c>[a-z])" from the list: (?<l>.*?)\?$/B= $lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/C= $lq =~ /^what word from "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/D= $lq =~ /^which word from list "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | or $lq =~ /^(?<l>.*?): the word containing the letter "(?<c>[a-z])" is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | or $lq =~ /^what word from "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | or $lq =~ /^which word from list "(?<l>.*?)" contains the letter "(?<c>[a-z])"\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 5 | ▶ | return first { 0 <= index $_, $+{c} } split /,\s*/, $+{l}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 99 | ▶ | return $1 if $lq =~ /^the word "(.).*?" starts with which letter\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%12/12
$lq =~ /^the word "(.).*?" starts with which letter\?$/ or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/ or $lq =~ /^the word "(.).*?" has which letter at the start\?$/ or $lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/ or $lq =~ /^the word ".*?(.)" has which letter at the end\?$/
$lq =~ /^the word "(.).*?" starts with which letter\?$/ or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/ or $lq =~ /^the word "(.).*?" has which letter at the start\?$/ or $lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/
$lq =~ /^the word "(.).*?" starts with which letter\?$/ or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/ or $lq =~ /^the word "(.).*?" has which letter at the start\?$/
$lq =~ /^the word "(.).*?" starts with which letter\?$/ or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/
MC/DC100%5/5
$lq =~ /^the word "(.).*?" starts with which letter\?$/ or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/ or $lq =~ /^the word "(.).*?" has which letter at the start\?$/ or $lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/ or $lq =~ /^the word ".*?(.)" has which letter at the end\?$/
$lq =~ /^the word "(.).*?" starts with which letter\?$/
$lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/
$lq =~ /^the word "(.).*?" has which letter at the start\?$/
$lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/
$lq =~ /^the word ".*?(.)" has which letter at the end\?$/
Truth table100%6/6
A or B or C or D or E
A= $lq =~ /^the word "(.).*?" starts with which letter\?$/B= $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/C= $lq =~ /^the word "(.).*?" has which letter at the start\?$/D= $lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/E= $lq =~ /^the word ".*?(.)" has which letter at the end\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | or $lq =~ /^the word "(.).*?" has which letter at the start\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | or $lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | or $lq =~ /^the word ".*?(.)" has which letter at the end\?$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 93 | ▶ | if ($lq =~ /^the (?<p>\d+)\S+ letter in (?:the word )?"(?<w>.*?)" is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$lq =~ /^the (?<p>\d+)\S+ letter in (?:the word )?"(?<w>.*?)" is\?$/ or $lq =~ /^the word "(?<w>.*?)" has which letter in (?<p>\d+)\S+ position\?$/
MC/DC100%2/2
$lq =~ /^the (?<p>\d+)\S+ letter in (?:the word )?"(?<w>.*?)" is\?$/ or $lq =~ /^the word "(?<w>.*?)" has which letter in (?<p>\d+)\S+ position\?$/
$lq =~ /^the (?<p>\d+)\S+ letter in (?:the word )?"(?<w>.*?)" is\?$/
$lq =~ /^the word "(?<w>.*?)" has which letter in (?<p>\d+)\S+ position\?$/
Truth table100%3/3
A or B
A= $lq =~ /^the (?<p>\d+)\S+ letter in (?:the word )?"(?<w>.*?)" is\?$/B= $lq =~ /^the word "(?<w>.*?)" has which letter in (?<p>\d+)\S+ position\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | or $lq =~ /^the word "(?<w>.*?)" has which letter in (?<p>\d+)\S+ position\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 3 | ▶ | return $+{p} > length $+{w} ? undef : substr $+{w}, $+{p} - 1, 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | # Days of week | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 90 | ▶ | if ($lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if tomorrow is (\w+), what day is today\?$/ or $lq =~ /^what day is today, if tomorrow is (\w+)\?$/
$lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if tomorrow is (\w+), what day is today\?$/
MC/DC100%3/3
$lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if tomorrow is (\w+), what day is today\?$/ or $lq =~ /^what day is today, if tomorrow is (\w+)\?$/
$lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/
$lq =~ /^if tomorrow is (\w+), what day is today\?$/
$lq =~ /^what day is today, if tomorrow is (\w+)\?$/
Truth table100%4/4
A or B or C
A= $lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/B= $lq =~ /^if tomorrow is (\w+), what day is today\?$/C= $lq =~ /^what day is today, if tomorrow is (\w+)\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | or $lq =~ /^if tomorrow is (\w+), what day is today\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | or $lq =~ /^what day is today, if tomorrow is (\w+)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 4 | ▶ | return exists $days{$1} ? $days[ ($days{$1} - 1) % 7 ] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 86 | ▶ | if ($lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if yesterday was (\w+), what day is today\?$/ or $lq =~ /^what day is today, if yesterday was (\w+)\?$/
$lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if yesterday was (\w+), what day is today\?$/
MC/DC100%3/3
$lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if yesterday was (\w+), what day is today\?$/ or $lq =~ /^what day is today, if yesterday was (\w+)\?$/
$lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/
$lq =~ /^if yesterday was (\w+), what day is today\?$/
$lq =~ /^what day is today, if yesterday was (\w+)\?$/
Truth table100%4/4
A or B or C
A= $lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/B= $lq =~ /^if yesterday was (\w+), what day is today\?$/C= $lq =~ /^what day is today, if yesterday was (\w+)\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | or $lq =~ /^if yesterday was (\w+), what day is today\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | or $lq =~ /^what day is today, if yesterday was (\w+)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 4 | ▶ | return exists $days{$1} ? $days[ ($days{$1} + 1) % 7 ] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 82 | ▶ | if ($lq =~ /^which of these is a day of the week: (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%12/12
$lq =~ /^which of these is a day of the week: (.*?)\?$/ or $lq =~ /^which of (.*?) is a day of the week\?$/ or $lq =~ /^which of (.*?) is the name of a day\?$/ or $lq =~ /^the day of the week in (.*?) is\?$/ or $lq =~ /^(.*?): the day of the week is\?$/
$lq =~ /^which of these is a day of the week: (.*?)\?$/ or $lq =~ /^which of (.*?) is a day of the week\?$/ or $lq =~ /^which of (.*?) is the name of a day\?$/ or $lq =~ /^the day of the week in (.*?) is\?$/
$lq =~ /^which of these is a day of the week: (.*?)\?$/ or $lq =~ /^which of (.*?) is a day of the week\?$/ or $lq =~ /^which of (.*?) is the name of a day\?$/
$lq =~ /^which of these is a day of the week: (.*?)\?$/ or $lq =~ /^which of (.*?) is a day of the week\?$/
MC/DC100%5/5
$lq =~ /^which of these is a day of the week: (.*?)\?$/ or $lq =~ /^which of (.*?) is a day of the week\?$/ or $lq =~ /^which of (.*?) is the name of a day\?$/ or $lq =~ /^the day of the week in (.*?) is\?$/ or $lq =~ /^(.*?): the day of the week is\?$/
$lq =~ /^which of these is a day of the week: (.*?)\?$/
$lq =~ /^which of (.*?) is a day of the week\?$/
$lq =~ /^which of (.*?) is the name of a day\?$/
$lq =~ /^the day of the week in (.*?) is\?$/
$lq =~ /^(.*?): the day of the week is\?$/
Truth table100%6/6
A or B or C or D or E
A= $lq =~ /^which of these is a day of the week: (.*?)\?$/B= $lq =~ /^which of (.*?) is a day of the week\?$/C= $lq =~ /^which of (.*?) is the name of a day\?$/D= $lq =~ /^the day of the week in (.*?) is\?$/E= $lq =~ /^(.*?): the day of the week is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | or $lq =~ /^which of (.*?) is a day of the week\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | or $lq =~ /^which of (.*?) is the name of a day\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | or $lq =~ /^the day of the week in (.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | or $lq =~ /^(.*?): the day of the week is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 6 | ▶ | return first { exists $days{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 76 | ▶ | if ($lq =~ /^(.*?) is part of the weekend\?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 4 | ▶ | return first { $weekend{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | # Names | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 72 | ▶ | return $1 if $lq =~ /^(\w+)'s? name is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$lq =~ /^(\w+)'s? name is\?$/ or $lq =~ /^what is (\w+)'s? name\?$/ or $lq =~ /^the name of (\w+) is\?$/ or $lq =~ /^if a person is called (\w+), what is their name\?$/
$lq =~ /^(\w+)'s? name is\?$/ or $lq =~ /^what is (\w+)'s? name\?$/ or $lq =~ /^the name of (\w+) is\?$/
$lq =~ /^(\w+)'s? name is\?$/ or $lq =~ /^what is (\w+)'s? name\?$/
MC/DC100%4/4
$lq =~ /^(\w+)'s? name is\?$/ or $lq =~ /^what is (\w+)'s? name\?$/ or $lq =~ /^the name of (\w+) is\?$/ or $lq =~ /^if a person is called (\w+), what is their name\?$/
$lq =~ /^(\w+)'s? name is\?$/
$lq =~ /^what is (\w+)'s? name\?$/
$lq =~ /^the name of (\w+) is\?$/
$lq =~ /^if a person is called (\w+), what is their name\?$/
Truth table100%5/5
A or B or C or D
A= $lq =~ /^(\w+)'s? name is\?$/B= $lq =~ /^what is (\w+)'s? name\?$/C= $lq =~ /^the name of (\w+) is\?$/D= $lq =~ /^if a person is called (\w+), what is their name\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | or $lq =~ /^what is (\w+)'s? name\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | or $lq =~ /^the name of (\w+) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | or $lq =~ /^if a person is called (\w+), what is their name\?$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 68 | ▶ | if ($q =~ /^The person's firstname in (.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition91%11/12
$q =~ /^The person's firstname in (.*?) is\?$/ or $q =~ /^Which in this list is the name of a person: (.*?)\?$/ or $q =~ /^(.*?): the person's name is\?$/ or $q =~ /^Which of (.*?) is the name of a person\?$/ or $q =~ /^Which of (.*?) is a person's name\?$/
$q =~ /^The person's firstname in (.*?) is\?$/ or $q =~ /^Which in this list is the name of a person: (.*?)\?$/ or $q =~ /^(.*?): the person's name is\?$/ or $q =~ /^Which of (.*?) is the name of a person\?$/
$q =~ /^The person's firstname in (.*?) is\?$/ or $q =~ /^Which in this list is the name of a person: (.*?)\?$/ or $q =~ /^(.*?): the person's name is\?$/
$q =~ /^The person's firstname in (.*?) is\?$/ or $q =~ /^Which in this list is the name of a person: (.*?)\?$/
MC/DC80%4/5
$q =~ /^The person's firstname in (.*?) is\?$/ or $q =~ /^Which in this list is the name of a person: (.*?)\?$/ or $q =~ /^(.*?): the person's name is\?$/ or $q =~ /^Which of (.*?) is the name of a person\?$/ or $q =~ /^Which of (.*?) is a person's name\?$/
$q =~ /^The person's firstname in (.*?) is\?$/
$q =~ /^Which in this list is the name of a person: (.*?)\?$/
$q =~ /^(.*?): the person's name is\?$/
$q =~ /^Which of (.*?) is the name of a person\?$/
$q =~ /^Which of (.*?) is a person's name\?$/
Truth table83%5/6
A or B or C or D or E
A= $q =~ /^The person's firstname in (.*?) is\?$/B= $q =~ /^Which in this list is the name of a person: (.*?)\?$/C= $q =~ /^(.*?): the person's name is\?$/D= $q =~ /^Which of (.*?) is the name of a person\?$/E= $q =~ /^Which of (.*?) is a person's name\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | or $q =~ /^Which in this list is the name of a person: (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | or $q =~ /^(.*?): the person's name is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | or $q =~ /^Which of (.*?) is the name of a person\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | or $q =~ /^Which of (.*?) is a person's name\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 6 | ▶ | my $name = first { /^[A-Z][a-z]+$/ } reverse split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 6 | ▶ | return $name ? lc $name : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | # Colors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 62 | ▶ | return $1 if $lq =~ /^the colour of a (\w+) \S+ is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$lq =~ /^the colour of a (\w+) \S+ is\?$/ or $lq =~ /^the (\w+) \S+ is what colour\?$/ or $lq =~ /^if the \S+ is (\w+), what colour is it\?$/
$lq =~ /^the colour of a (\w+) \S+ is\?$/ or $lq =~ /^the (\w+) \S+ is what colour\?$/
MC/DC100%3/3
$lq =~ /^the colour of a (\w+) \S+ is\?$/ or $lq =~ /^the (\w+) \S+ is what colour\?$/ or $lq =~ /^if the \S+ is (\w+), what colour is it\?$/
$lq =~ /^the colour of a (\w+) \S+ is\?$/
$lq =~ /^the (\w+) \S+ is what colour\?$/
$lq =~ /^if the \S+ is (\w+), what colour is it\?$/
Truth table100%4/4
A or B or C
A= $lq =~ /^the colour of a (\w+) \S+ is\?$/B= $lq =~ /^the (\w+) \S+ is what colour\?$/C= $lq =~ /^if the \S+ is (\w+), what colour is it\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | or $lq =~ /^the (\w+) \S+ is what colour\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | or $lq =~ /^if the \S+ is (\w+), what colour is it\?$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 59 | ▶ | if ($lq =~ /^how many colours in the list (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$lq =~ /^how many colours in the list (.*?)\?$/ or $lq =~ /^the list (.*?) contains how many colours\?$/ or $lq =~ /^(.*?): how many colours in the list\?$/
$lq =~ /^how many colours in the list (.*?)\?$/ or $lq =~ /^the list (.*?) contains how many colours\?$/
MC/DC100%3/3
$lq =~ /^how many colours in the list (.*?)\?$/ or $lq =~ /^the list (.*?) contains how many colours\?$/ or $lq =~ /^(.*?): how many colours in the list\?$/
$lq =~ /^how many colours in the list (.*?)\?$/
$lq =~ /^the list (.*?) contains how many colours\?$/
$lq =~ /^(.*?): how many colours in the list\?$/
Truth table100%4/4
A or B or C
A= $lq =~ /^how many colours in the list (.*?)\?$/B= $lq =~ /^the list (.*?) contains how many colours\?$/C= $lq =~ /^(.*?): how many colours in the list\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | or $lq =~ /^the list (.*?) contains how many colours\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | or $lq =~ /^(.*?): how many colours in the list\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 4 | return 0 + grep { $colors{$_} } split /\W+/, $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 55 | ▶ | if ($lq =~ /^which of these is a colour: (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$lq =~ /^which of these is a colour: (.*?)\?$/ or $lq =~ /^which of (.*?) is a colour\?$/ or $lq =~ /^(.*?): the colour is\?$/ or $lq =~ /^the colour in the list (.*?) is\?$/
$lq =~ /^which of these is a colour: (.*?)\?$/ or $lq =~ /^which of (.*?) is a colour\?$/ or $lq =~ /^(.*?): the colour is\?$/
$lq =~ /^which of these is a colour: (.*?)\?$/ or $lq =~ /^which of (.*?) is a colour\?$/
MC/DC100%4/4
$lq =~ /^which of these is a colour: (.*?)\?$/ or $lq =~ /^which of (.*?) is a colour\?$/ or $lq =~ /^(.*?): the colour is\?$/ or $lq =~ /^the colour in the list (.*?) is\?$/
$lq =~ /^which of these is a colour: (.*?)\?$/
$lq =~ /^which of (.*?) is a colour\?$/
$lq =~ /^(.*?): the colour is\?$/
$lq =~ /^the colour in the list (.*?) is\?$/
Truth table100%5/5
A or B or C or D
A= $lq =~ /^which of these is a colour: (.*?)\?$/B= $lq =~ /^which of (.*?) is a colour\?$/C= $lq =~ /^(.*?): the colour is\?$/D= $lq =~ /^the colour in the list (.*?) is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | or $lq =~ /^which of (.*?) is a colour\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | or $lq =~ /^(.*?): the colour is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | or $lq =~ /^the colour in the list (.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 5 | ▶ | return first { $colors{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 50 | ▶ | if ($lq =~ /^what is the (?<p>\d+)\S+ colour in the list (?<l>.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$lq =~ /^what is the (?<p>\d+)\S+ colour in the list (?<l>.*?)\?$/ or $lq =~ /^the (?<p>\d+)\S+ colour in (?<l>.*?) is\?$/ or $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ colour is\?$/
$lq =~ /^what is the (?<p>\d+)\S+ colour in the list (?<l>.*?)\?$/ or $lq =~ /^the (?<p>\d+)\S+ colour in (?<l>.*?) is\?$/
MC/DC66%2/3
$lq =~ /^what is the (?<p>\d+)\S+ colour in the list (?<l>.*?)\?$/ or $lq =~ /^the (?<p>\d+)\S+ colour in (?<l>.*?) is\?$/ or $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ colour is\?$/
$lq =~ /^what is the (?<p>\d+)\S+ colour in the list (?<l>.*?)\?$/
$lq =~ /^the (?<p>\d+)\S+ colour in (?<l>.*?) is\?$/
$lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ colour is\?$/
Truth table75%3/4
A or B or C
A= $lq =~ /^what is the (?<p>\d+)\S+ colour in the list (?<l>.*?)\?$/B= $lq =~ /^the (?<p>\d+)\S+ colour in (?<l>.*?) is\?$/C= $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ colour is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | or $lq =~ /^the (?<p>\d+)\S+ colour in (?<l>.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | or $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ colour is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 4 | return (grep { $colors{$_} } split /\W+/, $+{l})[ $+{p} - 1 ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | # Body parts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 46 | ▶ | if ($lq =~ /^the number of body parts in the list (.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$lq =~ /^the number of body parts in the list (.*?) is\?$/ or $lq =~ /^the list (.*?) contains how many body parts\?$/ or $lq =~ /^(.*?): how many body parts in the list\?$/
$lq =~ /^the number of body parts in the list (.*?) is\?$/ or $lq =~ /^the list (.*?) contains how many body parts\?$/
MC/DC100%3/3
$lq =~ /^the number of body parts in the list (.*?) is\?$/ or $lq =~ /^the list (.*?) contains how many body parts\?$/ or $lq =~ /^(.*?): how many body parts in the list\?$/
$lq =~ /^the number of body parts in the list (.*?) is\?$/
$lq =~ /^the list (.*?) contains how many body parts\?$/
$lq =~ /^(.*?): how many body parts in the list\?$/
Truth table100%4/4
A or B or C
A= $lq =~ /^the number of body parts in the list (.*?) is\?$/B= $lq =~ /^the list (.*?) contains how many body parts\?$/C= $lq =~ /^(.*?): how many body parts in the list\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | or $lq =~ /^the list (.*?) contains how many body parts\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | or $lq =~ /^(.*?): how many body parts in the list\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 4 | return 0 + grep { $body_part{$_} } split /\W+/, $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 42 | ▶ | if ($lq =~ /^the body part in (.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%12/12
$lq =~ /^the body part in (.*?) is\?$/ or $lq =~ /^which of these is a body part: (.*?)\?$/ or $lq =~ /^which of (.*?) is a body part\?$/ or $lq =~ /^which of (.*?) is part of a person\?$/ or $lq =~ /^(.*?): the body part is\?$/
$lq =~ /^the body part in (.*?) is\?$/ or $lq =~ /^which of these is a body part: (.*?)\?$/ or $lq =~ /^which of (.*?) is a body part\?$/ or $lq =~ /^which of (.*?) is part of a person\?$/
$lq =~ /^the body part in (.*?) is\?$/ or $lq =~ /^which of these is a body part: (.*?)\?$/ or $lq =~ /^which of (.*?) is a body part\?$/
$lq =~ /^the body part in (.*?) is\?$/ or $lq =~ /^which of these is a body part: (.*?)\?$/
MC/DC100%5/5
$lq =~ /^the body part in (.*?) is\?$/ or $lq =~ /^which of these is a body part: (.*?)\?$/ or $lq =~ /^which of (.*?) is a body part\?$/ or $lq =~ /^which of (.*?) is part of a person\?$/ or $lq =~ /^(.*?): the body part is\?$/
$lq =~ /^the body part in (.*?) is\?$/
$lq =~ /^which of these is a body part: (.*?)\?$/
$lq =~ /^which of (.*?) is a body part\?$/
$lq =~ /^which of (.*?) is part of a person\?$/
$lq =~ /^(.*?): the body part is\?$/
Truth table100%6/6
A or B or C or D or E
A= $lq =~ /^the body part in (.*?) is\?$/B= $lq =~ /^which of these is a body part: (.*?)\?$/C= $lq =~ /^which of (.*?) is a body part\?$/D= $lq =~ /^which of (.*?) is part of a person\?$/E= $lq =~ /^(.*?): the body part is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | or $lq =~ /^which of these is a body part: (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | or $lq =~ /^which of (.*?) is a body part\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | or $lq =~ /^which of (.*?) is part of a person\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | or $lq =~ /^(.*?): the body part is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 6 | ▶ | return first { $body_part{$_} } split /(?:,\s*| or )/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 36 | ▶ | if ($lq =~ /^(.*?) is part of the head\?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 3 | ▶ | return first { $head_part{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 33 | ▶ | if ($lq =~ /^(.*?) is something each person has more than one of\?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 3 | ▶ | return first { $multiple_part{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 30 | ▶ | if ($lq =~ /^(.*?) is above the waist\?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 3 | ▶ | return first { $part_above_waist{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 27 | ▶ | if ($lq =~ /^(.*?) is below the waist\?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 3 | ▶ | return first { $part_below_waist{$_} } split /\W+/, $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | # Numbers and digits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 24 | ▶ | if ($lq =~ /^enter the number (.*?) in digits:$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$lq =~ /^enter the number (.*?) in digits:$/ or $lq =~ /^what is (.*?) as (?:digits|a number)\?$/
MC/DC50%1/2
$lq =~ /^enter the number (.*?) in digits:$/ or $lq =~ /^what is (.*?) as (?:digits|a number)\?$/
$lq =~ /^enter the number (.*?) in digits:$/
$lq =~ /^what is (.*?) as (?:digits|a number)\?$/
Truth table66%2/3
A or B
A= $lq =~ /^enter the number (.*?) in digits:$/B= $lq =~ /^what is (.*?) as (?:digits|a number)\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | or $lq =~ /^what is (.*?) as (?:digits|a number)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1 | return words2nums $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 23 | ▶ | if ($lq =~ /^which digit is (?<p>\d+)\S+ in the number (?<n>\d+)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$lq =~ /^which digit is (?<p>\d+)\S+ in the number (?<n>\d+)\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ digit in (?<n>\d+)\?$/ or $lq =~ /^in the number (?<n>\d+), what is the (?<p>\d+)\S+ digit\?$/
$lq =~ /^which digit is (?<p>\d+)\S+ in the number (?<n>\d+)\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ digit in (?<n>\d+)\?$/
MC/DC66%2/3
$lq =~ /^which digit is (?<p>\d+)\S+ in the number (?<n>\d+)\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ digit in (?<n>\d+)\?$/ or $lq =~ /^in the number (?<n>\d+), what is the (?<p>\d+)\S+ digit\?$/
$lq =~ /^which digit is (?<p>\d+)\S+ in the number (?<n>\d+)\?$/
$lq =~ /^what is the (?<p>\d+)\S+ digit in (?<n>\d+)\?$/
$lq =~ /^in the number (?<n>\d+), what is the (?<p>\d+)\S+ digit\?$/
Truth table75%3/4
A or B or C
A= $lq =~ /^which digit is (?<p>\d+)\S+ in the number (?<n>\d+)\?$/B= $lq =~ /^what is the (?<p>\d+)\S+ digit in (?<n>\d+)\?$/C= $lq =~ /^in the number (?<n>\d+), what is the (?<p>\d+)\S+ digit\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | or $lq =~ /^what is the (?<p>\d+)\S+ digit in (?<n>\d+)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | or $lq =~ /^in the number (?<n>\d+), what is the (?<p>\d+)\S+ digit\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 4 | ▶ | return $+{p} > length $+{n} ? undef : substr $+{n}, $+{p} - 1, 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 19 | ▶ | if ($lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/ or $lq =~ /^what number is (?<p>\d+)\S+ in the series (?<l>.*?)\?$/ or $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ number is\?$/
$lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/ or $lq =~ /^what number is (?<p>\d+)\S+ in the series (?<l>.*?)\?$/
$lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/
MC/DC100%4/4
$lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/ or $lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/ or $lq =~ /^what number is (?<p>\d+)\S+ in the series (?<l>.*?)\?$/ or $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ number is\?$/
$lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/
$lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/
$lq =~ /^what number is (?<p>\d+)\S+ in the series (?<l>.*?)\?$/
$lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ number is\?$/
Truth table100%5/5
A or B or C or D
A= $lq =~ /^the (?<p>\d+)\S+ number from (?<l>.*?) is\?$/B= $lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/C= $lq =~ /^what number is (?<p>\d+)\S+ in the series (?<l>.*?)\?$/D= $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ number is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | or $lq =~ /^what is the (?<p>\d+)\S+ number in the list (?<l>.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | or $lq =~ /^what number is (?<p>\d+)\S+ in the series (?<l>.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | or $lq =~ /^(?<l>.*?): the (?<p>\d+)\S+ number is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 5 | my @nums = map { words2nums $_ } split /(?:,\s*| and )/, $+{l}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 5 | return $nums[ $+{p} - 1 ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 14 | state $biggest_re = qr/(?:biggest | largest | highest)/x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 14 | ▶ | if ($lq =~ /^enter the $biggest_re number of (.*?):$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%12/12
$lq =~ /^enter the $biggest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/ or $lq =~ /^which of (.*?) is the $biggest_re\?$/ or $lq =~ /^(.*?): which of these is the $biggest_re\?$/ or $lq =~ /^(.*?): the $biggest_re is\?$/
$lq =~ /^enter the $biggest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/ or $lq =~ /^which of (.*?) is the $biggest_re\?$/ or $lq =~ /^(.*?): which of these is the $biggest_re\?$/
$lq =~ /^enter the $biggest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/ or $lq =~ /^which of (.*?) is the $biggest_re\?$/
$lq =~ /^enter the $biggest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/
MC/DC100%5/5
$lq =~ /^enter the $biggest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/ or $lq =~ /^which of (.*?) is the $biggest_re\?$/ or $lq =~ /^(.*?): which of these is the $biggest_re\?$/ or $lq =~ /^(.*?): the $biggest_re is\?$/
$lq =~ /^enter the $biggest_re number of (.*?):$/
$lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/
$lq =~ /^which of (.*?) is the $biggest_re\?$/
$lq =~ /^(.*?): which of these is the $biggest_re\?$/
$lq =~ /^(.*?): the $biggest_re is\?$/
Truth table100%6/6
A or B or C or D or E
A= $lq =~ /^enter the $biggest_re number of (.*?):$/B= $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/C= $lq =~ /^which of (.*?) is the $biggest_re\?$/D= $lq =~ /^(.*?): which of these is the $biggest_re\?$/E= $lq =~ /^(.*?): the $biggest_re is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | or $lq =~ /^which of (.*?) is the $biggest_re\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | or $lq =~ /^(.*?): which of these is the $biggest_re\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | or $lq =~ /^(.*?): the $biggest_re is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 5 | return max map { words2nums $_ } split /(?:,\s*| or )/, $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 9 | state $smallest_re = qr/(?:smallest | lowest)/x; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 9 | ▶ | if ($lq =~ /^enter the $smallest_re number of (.*?):$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%12/12
$lq =~ /^enter the $smallest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/ or $lq =~ /^which of (.*?) is the $smallest_re\?$/ or $lq =~ /^(.*?): which of these is the $smallest_re\?$/ or $lq =~ /^(.*?): the $smallest_re is\?$/
$lq =~ /^enter the $smallest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/ or $lq =~ /^which of (.*?) is the $smallest_re\?$/ or $lq =~ /^(.*?): which of these is the $smallest_re\?$/
$lq =~ /^enter the $smallest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/ or $lq =~ /^which of (.*?) is the $smallest_re\?$/
$lq =~ /^enter the $smallest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/
MC/DC100%5/5
$lq =~ /^enter the $smallest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/ or $lq =~ /^which of (.*?) is the $smallest_re\?$/ or $lq =~ /^(.*?): which of these is the $smallest_re\?$/ or $lq =~ /^(.*?): the $smallest_re is\?$/
$lq =~ /^enter the $smallest_re number of (.*?):$/
$lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/
$lq =~ /^which of (.*?) is the $smallest_re\?$/
$lq =~ /^(.*?): which of these is the $smallest_re\?$/
$lq =~ /^(.*?): the $smallest_re is\?$/
Truth table100%6/6
A or B or C or D or E
A= $lq =~ /^enter the $smallest_re number of (.*?):$/B= $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/C= $lq =~ /^which of (.*?) is the $smallest_re\?$/D= $lq =~ /^(.*?): which of these is the $smallest_re\?$/E= $lq =~ /^(.*?): the $smallest_re is\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | or $lq =~ /^which of (.*?) is the $smallest_re\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | or $lq =~ /^(.*?): which of these is the $smallest_re\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | or $lq =~ /^(.*?): the $smallest_re is\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 5 | return min map { words2nums $_ } split /(?:,\s*| or )/, $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 4 | ▶ | if ($lq =~ /^(.*?) (?:= |equals |is what)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$lq =~ /^(.*?) (?:= |equals |is what)\?$/ or $lq =~ /^what(?:'s| is) (.*?)\?$/
MC/DC0%0/2
$lq =~ /^(.*?) (?:= |equals |is what)\?$/ or $lq =~ /^what(?:'s| is) (.*?)\?$/
$lq =~ /^(.*?) (?:= |equals |is what)\?$/
$lq =~ /^what(?:'s| is) (.*?)\?$/
Truth table33%1/3
A or B
A= $lq =~ /^(.*?) (?:= |equals |is what)\?$/B= $lq =~ /^what(?:'s| is) (.*?)\?$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | or $lq =~ /^what(?:'s| is) (.*?)\?$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 4 | my $expr = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 4 | ▶ | s/\b(?:add|plus)\b/+/ or s/\bminus\b/-/ for $expr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 4 | ▶ | $expr =~ s{\b(\w+)\b}{ words2nums($1) // $1 }eg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
&words2nums($1) // $1
MC/DC0%0/2
&words2nums($1) // $1
&words2nums($1)
$1
Truth table33%1/3
A // B
A= &words2nums($1)B= $1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 4 | ▶ | return eval $expr if $expr =~ /^[ \d+-]+$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||