Skip to content

how to search in tinydb? #491

Answered by elamandeep
elamandeep asked this question in Q&A
Discussion options

You must be logged in to vote

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?

{
    "_default": {
        "1": {
            "tag": "greeting",
            "patterns": [
                "Hi",
                "How are you",
                "Is anyone there?",
                "Hello",
                "Good day",
                "Whats up",
                "Hey",
                "greetings",
                "hloo"

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@msiemens
Comment options

Answer selected by elamandeep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants