File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,20 @@ export default function QueryProcessor(query: string): string {
1515 return "cnk2024" ;
1616 }
1717
18+ // if (query.toLowerCase().includes("Which of the following numbers is the largest: ")) {
19+ // let numbers = query.split(" ");
20+ // return Math.max(parseInt(numbers[-1]), parseInt(numbers[-2]), parseInt(numbers[-1])).toString()
21+ // }
22+
23+ if ( query . toLowerCase ( ) . includes ( "what is" ) && query . toLowerCase ( ) . includes ( "plus" ) ) {
24+ let numbers = query . replace ( "?" , "" ) . split ( " " ) ;
25+ return ( parseInt ( numbers [ 2 ] ) + parseInt ( numbers [ 4 ] ) ) . toString ( )
26+ }
27+
28+ if ( query . toLowerCase ( ) . includes ( "what is" ) && query . toLowerCase ( ) . includes ( "multiplied by" ) ) {
29+ let numbers = query . replace ( "?" , "" ) . split ( " " ) ;
30+ return ( parseInt ( numbers [ 2 ] ) * parseInt ( numbers [ 4 ] ) ) . toString ( )
31+ }
32+
1833 return "" ;
1934}
You can’t perform that action at this time.
0 commit comments