AsciiTable: Improves triggering (#4124)
* AsciiTable: Triggering now for 'list of' * AsciiTable: Add more triggers * AsciiTable: Tests updated with new triggersmaster
parent
aa882165fa
commit
67f6e084f2
|
@ -10,12 +10,19 @@ zci answer_type => 'ascii_table';
|
||||||
|
|
||||||
zci is_cached => 1;
|
zci is_cached => 1;
|
||||||
|
|
||||||
triggers start => share('triggers.txt')->slurp;
|
my @triggers = share("triggers.txt")->slurp;
|
||||||
|
|
||||||
|
triggers startend => @triggers;
|
||||||
|
|
||||||
|
chomp(@triggers);
|
||||||
|
my $keywords = join("|", map(quotemeta, @triggers));
|
||||||
|
|
||||||
my $ascii = LoadFile(share('data.yml'));
|
my $ascii = LoadFile(share('data.yml'));
|
||||||
|
|
||||||
handle remainder => sub {
|
handle query_lc => sub {
|
||||||
return unless $_ eq '';
|
s/^list of\b//;
|
||||||
|
|
||||||
|
return unless m/$keywords/;
|
||||||
|
|
||||||
return '',
|
return '',
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
|
|
|
@ -19,4 +19,9 @@ ascii characters table
|
||||||
ascii chart
|
ascii chart
|
||||||
ascii codes chart
|
ascii codes chart
|
||||||
ascii characters chart
|
ascii characters chart
|
||||||
ascii reference chart
|
ascii reference chart
|
||||||
|
ascii character list
|
||||||
|
ascii characters list
|
||||||
|
ascii characters lookup
|
||||||
|
ascii character map
|
||||||
|
ascii character set table
|
|
@ -13,6 +13,7 @@ zci is_cached => 1;
|
||||||
my $ascii = LoadFile('share/goodie/ascii_table/data.yml');
|
my $ascii = LoadFile('share/goodie/ascii_table/data.yml');
|
||||||
|
|
||||||
sub build_structured_answer {
|
sub build_structured_answer {
|
||||||
|
|
||||||
my $result = {
|
my $result = {
|
||||||
title => 'ASCII Table',
|
title => 'ASCII Table',
|
||||||
table => $ascii
|
table => $ascii
|
||||||
|
@ -81,6 +82,12 @@ ddg_goodie_test(
|
||||||
'ascii reference' => build_test(),
|
'ascii reference' => build_test(),
|
||||||
'ascii characters' => build_test(),
|
'ascii characters' => build_test(),
|
||||||
'character codes' => build_test(),
|
'character codes' => build_test(),
|
||||||
|
'ascii character map' => build_test(),
|
||||||
|
'list of ascii characters' => build_test(),
|
||||||
|
'list of ascii codes' => build_test(),
|
||||||
|
'list of char codes' => build_test(),
|
||||||
|
'list of vegetables' => undef,
|
||||||
|
'list of ascii' => undef,
|
||||||
'ascii convertor' => undef,
|
'ascii convertor' => undef,
|
||||||
'ascii conversion' => undef,
|
'ascii conversion' => undef,
|
||||||
'convert ascii' => undef,
|
'convert ascii' => undef,
|
||||||
|
|
Loading…
Reference in New Issue