how to search in tinydb? #491
-
https://pastebin.com/embed_js/fFksPTm8?theme=dark This is my pastebin of json and I want to search element inside "patterns" using tinyDB. Also if search item found then it will return me index of object |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @elamandeep, your pastebin link seems to have expired. Could you post the JSON here? Either in a comment or you can upload it as an attachment |
Beta Was this translation helpful? Give feedback.
-
Here's the json file. I want to search inside Suppose a user enter a sentence {
"_default": {
"1": {
"tag": "greeting",
"patterns": [
"Hi",
"How are you",
"Is anyone there?",
"Hello",
"Good day",
"Whats up",
"Hey",
"greetings",
"hloo"
],
"responses": [
"Hello!",
"Good to see you again!",
"Hi there, how can I help?"
]
},
"2": {
"tag": "help",
"patterns": [
"help",
"?",
"need help",
"aman",
"amit"
],
"responses": [
"I am forwarding your message to core team @Core.",
"@elamandeep is not online . But I will notify him."
]
},
"3": {
"tag": "goodbye",
"patterns": [
"cya",
"See you later",
"Goodbye",
"I am Leaving",
"Have a Good day",
"bye",
"cao",
"see ya"
],
"responses": [
"Sad to see you go :(",
"Talk to you later",
"Goodbye!"
]
}
}
}
|
Beta Was this translation helpful? Give feedback.
Here's the json file. I want to search inside
patterns
when user enters a desired sentence return back me random response .Suppose a user enter a sentence
Hi! I am Aman Deep.
Then It will search every word from that sentence and try to match each word with
patterns
of json.And if it finds then generate random response. Are you getting my points or not?