Skip to content

Commit 47076ff

Browse files
committed
Update QueryProcessor.tsx
1 parent 5bf3efc commit 47076ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/QueryProcessor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export default function QueryProcessor(query: string): string {
2+
// const extract_int = (str) => {
3+
// return str.replace("?", "").replace(","," ").split(" ")
4+
// }
25
if (query.toLowerCase().includes("shakespeare")) {
36
return (
47
"William Shakespeare (26 April 1564 - 23 April 1616) was an " +
@@ -27,7 +30,7 @@ export default function QueryProcessor(query: string): string {
2730

2831
if (query.toLowerCase().includes("what is") && query.toLowerCase().includes("multiplied by")) {
2932
let numbers = query.replace("?", "").split(" ");
30-
return (parseInt(numbers[2]) * parseInt(numbers[4])).toString()
33+
return (parseInt(numbers[2]) * parseInt(numbers[5])).toString()
3134
}
3235

3336
return "";

0 commit comments

Comments
 (0)