├── .gitignore ├── img └── chanakya-screen.png ├── config └── prog.config ├── data ├── chennai.json ├── shopsample.chat ├── bengaltiger.chat ├── tajmahal.chat ├── knowledgebase.chat └── chennaisuperkings.chat ├── include ├── plugins │ ├── plugin.h │ └── plugins.h ├── knowledge-transformation │ └── knowledgetransformer.cpp ├── knowledge-tree │ ├── treebuilder.h │ ├── stringmatcher.h │ └── infotrees.h ├── file-validation │ ├── config │ │ └── validate.h │ └── knowledge-base │ │ └── validate.h ├── user-input │ └── inputscanner.h └── utilities │ └── utilities.h ├── src └── chanakya.cpp ├── README.md └── plugins └── movies └── movies-plugin.h /.gitignore: -------------------------------------------------------------------------------- 1 | *a.out 2 | *data.txt 3 | *DS_Store 4 | -------------------------------------------------------------------------------- /img/chanakya-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArjArav98/Chanakya/HEAD/img/chanakya-screen.png -------------------------------------------------------------------------------- /config/prog.config: -------------------------------------------------------------------------------- 1 | name = Chanakya 2 | field = CSK 2019 3 | knowledge_file = ../data/chennaisuperkings.chat 4 | knowledge_type = chat -------------------------------------------------------------------------------- /data/chennai.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": { 3 | "children": { 4 | 5 | "what-chennai": { 6 | "keywords": "what|ennadhu is chennai|madras", 7 | "value": "Chennai is a coastal city on the Indian Coromandel coast." 8 | }, 9 | "when-chennai": { 10 | "keywords": "when founded|found|start chennai|madras", 11 | "value": "Chennai was established by the British on 22nd August, 1639." 12 | }, 13 | "who-chennai": { 14 | "keywords": "who start|founded|found chennai|madras", 15 | "value": "The city was founded by the British." 16 | } 17 | 18 | }, 19 | "keywords": "" 20 | } 21 | } -------------------------------------------------------------------------------- /include/plugins/plugin.h: -------------------------------------------------------------------------------- 1 | /* This class describes an interface which is used to implement a Plugin. */ 2 | /* Plugins must report live data and not hardcoded. */ 3 | class Plugin { 4 | public: 5 | virtual string getName() = 0; 6 | virtual bool canGiveAnAnswer(vector input) = 0; 7 | virtual void displayAnswer(vector input, string name, bool pluginsOnly) = 0; 8 | 9 | private: 10 | virtual vector parseOptionsFromInput(vector input) = 0; 11 | virtual string getRequestURL(vector options) = 0; 12 | virtual void saveHTMLFromURL(string url) = 0; 13 | virtual vector getDataFromHTML() = 0; 14 | }; 15 | -------------------------------------------------------------------------------- /include/plugins/plugins.h: -------------------------------------------------------------------------------- 1 | #include"../../plugins/movies/movies-plugin.h" 2 | 3 | class Plugins { 4 | 5 | Movies movies; 6 | 7 | public: 8 | bool areMainTopic; 9 | int previousTopic; 10 | 11 | Plugins() { areMainTopic = false; previousTopic = -1; } 12 | 13 | void displayAnswers(vector input, string name, bool pluginsOnly) { 14 | /* Plugin functions go here. */ 15 | if(movies.canGiveAnAnswer(input) == 1) { 16 | movies.displayAnswer(input,name,pluginsOnly); 17 | previousTopic = 1; 18 | } 19 | else { 20 | if(previousTopic == 1) movies.displayAnswer(input,name,pluginsOnly); 21 | else { 22 | if(pluginsOnly) cout< input) { 28 | int size = input.size(); 29 | for(int iter=0; iter input) { 36 | int size = input.size(); 37 | for(int iter=0; iter 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | class KnowledgeTransformer { 8 | 9 | public: 10 | static void transformData() { 11 | string filename = "../../data/chennai.json"; 12 | string filetype = "json"; 13 | 14 | if(filetype == "chat") ChatTransformer::transformData(); 15 | else if(filetype == "json") JsonTransformer::transformData(); 16 | } 17 | 18 | }; 19 | 20 | class ChatTransformer { 21 | 22 | public: 23 | static void transformData() { 24 | string filename = "../../data/chennaisuperkings.chat"; 25 | ifstream original_file(filename); 26 | 27 | ofstream new_file("../../data/knowledgebase.chat"); 28 | new_file << original_file.rdbuf(); 29 | 30 | original_file.close(); 31 | new_file.close(); 32 | } 33 | 34 | }; 35 | 36 | class JsonTransformer { 37 | 38 | public: 39 | static void transformData() { 40 | /* 41 | if its the first string and its not a keyword, then its a node name. 42 | if its the first string and its a keyword, then its okay. 43 | 44 | the string encountered after the first string is the result we want. 45 | we need to set the parent node for every iteration and a current node also. 46 | 47 | once we encounter the children keyword, we change 48 | */ 49 | } 50 | 51 | }; 52 | 53 | int main() { 54 | 55 | KnowledgeTransformer::transformData(); 56 | 57 | return 0; 58 | } -------------------------------------------------------------------------------- /data/shopsample.chat: -------------------------------------------------------------------------------- 1 | startmenu < root 2 | startmenu : introduction|intro|brief|about|help tell|what . 3 | startmenu = We are a bookstore located in XYZ, Wakanda. We sell books in many genres such as adventure/action, crime, mystery and fantasy. Choose the genre you would like to browse . 4 | 5 | adventure < root 6 | adventure : adventure|action . 7 | adventure = The store contains books in this genre from authors Tom Clancy and Michael Crichton. Enter the names of an author to view a list of his/her books . 8 | 9 | crime < root 10 | crime : crime|murder|kill|violence . 11 | crime = The store contains books in this genre from author John Grisham. Enter the names of an author to view a list of his/her books . 12 | 13 | mystery < root 14 | mystery : mystery|mysteries|case|detective|puzzle . 15 | mystery = The store contains books in this genre from authors such as Arthur Conan Doyle and Dan Brown. Enter the names of an author to view a list of his/her books . 16 | 17 | fantasy < root 18 | fantasy : fantasy|magic|monster|monsters . 19 | fantasy = The store contains books in this genre from authors JK Rowling and George RR Martin. Enter the namesof an author to view a list of his/her books . 20 | 21 | books < root 22 | books : tom|clancy|michael|crichton|john|grisham|arthur|conan|doyle|dan|brown|jk|rowling|george|rr|martin . 23 | 24 | clancy < books 25 | clancy : tom|clancy . 26 | clancy = The Hunt For Red October (1984), Patriot Games (1987), Clear and Present Danger (1989) . 27 | 28 | crichton < books 29 | crichton : michael|crichton . 30 | crichton = Jurassic Park (1990), Timeline(1999) and Sphere (1987) . 31 | 32 | grisham < books 33 | grisham : john|grisham . 34 | grisham = The Firm (1991), The Pelican Brief (1992) . 35 | 36 | doyle < books 37 | doyle : arthur|conan|doyle . 38 | doyle = Sherlock Holmes - The Complete Collection (1893-1920) . 39 | 40 | brown < books 41 | brown : dan|brown . 42 | brown = Da Vinci Code (2003) . 43 | 44 | rowling < books 45 | rowling : jk|rowling . 46 | rowling = Harry Potter and the Deathly Hallows (2007) . 47 | 48 | rrmartin < books 49 | rrmartin : george|rr|martin . 50 | rrmartin = A Dance of Dragons (2011) . 51 | -------------------------------------------------------------------------------- /include/knowledge-tree/treebuilder.h: -------------------------------------------------------------------------------- 1 | /* Reads data from knowledge file and builds the tree.*/ 2 | class TreeBuilder { 3 | 4 | public: 5 | 6 | /*================*/ 7 | /* USER FUNCTIONS */ 8 | /*================*/ 9 | 10 | /* Reads input file, generates tree with values and returns the tree. */ 11 | static InformationTree generateTree() { 12 | 13 | /* We open the file in a filestream. */ 14 | string filename = getConfigProperty("knowledge_file"); 15 | string filetype = getConfigProperty("knowledge_type"); 16 | 17 | ifstream file(filename.c_str()); 18 | InformationTree infotree; 19 | 20 | /* Loop until file ends. */ 21 | while(!file.eof()) { 22 | 23 | /* First string on line is node to be manipulated. */ 24 | string current_node; 25 | file >> current_node; 26 | 27 | string op; 28 | file >> op; 29 | 30 | /* If the operator is '<', meaning adding nodes. */ 31 | if(op == "<") { 32 | string parent; 33 | file >> parent; 34 | infotree.add(parent,current_node); 35 | } 36 | /* If the operator is ':', meaning adding keywords. */ 37 | else if(op == ":") { 38 | 39 | /* Instead of storing keywords, we store file cursor pos. */ 40 | /* We read file from this pos when retrieving keywords. */ 41 | /* This saves memory! */ 42 | 43 | int position = file.tellg() + (long long) 2; 44 | infotree.setKeywordPosition(current_node, position-1); 45 | 46 | /* We then have to navigate to the end of the line. */ 47 | string word; 48 | file >> word; 49 | 50 | while(word != ".") file >> word; 51 | } 52 | /* If the operator is '=', meaning assigning values. */ 53 | else if(op == "=") { 54 | 55 | /* Instead of storing values, we store the file cursor pos. */ 56 | /* We read file from this pos when retrieving values. */ 57 | /* This saves memory! */ 58 | 59 | int position = file.tellg() + (long long) 2; 60 | infotree.setValuePosition(current_node, position-1); 61 | 62 | /* We then have to navigate to the end of the line. */ 63 | string word; 64 | file >> word; 65 | 66 | while(word != ".") file >> word; 67 | } 68 | 69 | } 70 | 71 | file.close(); 72 | return infotree; 73 | 74 | } 75 | 76 | }; -------------------------------------------------------------------------------- /include/file-validation/config/validate.h: -------------------------------------------------------------------------------- 1 | /* Class which validates the config file. */ 2 | class ConfigValidator { 3 | 4 | public: 5 | static int error_line; 6 | static string error_msg; 7 | 8 | public: 9 | /*===========*/ 10 | /* FUNCTIONS */ 11 | /*===========*/ 12 | 13 | static bool successfullyValidated() { 14 | if(!syntaxIsValid()) return false; 15 | else if(!allPropertiesPresent()) return false; 16 | else if(!knowledgeFilePresent()) return false; 17 | else return true; 18 | } 19 | 20 | /* For logic explanation, refer knowledgeLinesAreValid() in KnowledgeValidate class. */ 21 | static bool syntaxIsValid() { 22 | ifstream filename("../config/prog.config"); 23 | string line; 24 | 25 | regex expression("(.)+( )+=( )+(.)+( )*"); 26 | regex expression_two("( )*"); 27 | 28 | getline(filename, line); 29 | 30 | while(true) { 31 | error_line++; 32 | if(!regex_match(line,expression)) { 33 | if(!regex_match(line,expression_two)) { 34 | filename.close(); 35 | error_msg = "Syntax for config file is wrong"; 36 | return false; 37 | } 38 | } 39 | getline(filename, line); 40 | if(filename.eof()) break; 41 | } 42 | 43 | filename.close(); 44 | return true; 45 | 46 | } 47 | 48 | /* Checks if all properties are present in config file. */ 49 | static bool allPropertiesPresent() { 50 | 51 | if(getConfigProperty("name") == "name") error_line = 1; 52 | else if(getConfigProperty("field") == "field") error_line = 2; 53 | else if(getConfigProperty("knowledge_file") == "knowledge_file") error_line = 3; 54 | else if(getConfigProperty("knowledge_type") == "knowledge_type") error_line = 4; 55 | else return true; 56 | 57 | error_msg = "Required properties are missing"; 58 | return false; 59 | 60 | } 61 | 62 | /* Checks if knowledge file is present at path specified. */ 63 | static bool knowledgeFilePresent() { 64 | try { 65 | ifstream file(getConfigProperty("knowledge_file")); 66 | if(!file.is_open()) throw -1; 67 | file.close(); 68 | } 69 | catch (const int exception) { 70 | error_line = 3; 71 | error_msg = "Cannot find knowledge file matching the name provided"; 72 | return false; 73 | } 74 | 75 | return true; 76 | } 77 | 78 | static int errorLine() { return error_line; } 79 | static string errorMsg() { return error_msg; } 80 | 81 | }; 82 | 83 | int ConfigValidator::error_line = 0; 84 | string ConfigValidator::error_msg = ""; -------------------------------------------------------------------------------- /data/bengaltiger.chat: -------------------------------------------------------------------------------- 1 | intro < root 2 | info < root 3 | threat < root 4 | help < root 5 | 6 | intro : tell introduction|introduce|info|brief|short|about . 7 | info : where|which|what|how found|find|located|location|place|area|eat|prey|diet|food|reproduce|reproduction|birth|cubs|children|scientific|name|genus|species|family|sub|subfamily|class|order|phylum|kingdom . 8 | threat : what|done threat|danger|endangered|status|poaching|human|conserve|conserving|conservation|protection|protect|efforts|effort|population|numbers . 9 | help : help|h|helpme . 10 | 11 | intro = The Bengal Tiger is a mammal belonging to the Panthera Tigris family of Tigers. It is primarily found in the Sundarbans region of India, Bangladesh and in Nepal and Bhutan. It is listed as 'Endangered' in the IUCN Red List since 2008 . 12 | 13 | help = Not to worry! You can ask questions on the Bengal Tiger's diet, habitat, birting and mating patterns, scientific name, genus, kingdom, etc. You can also ask questions related to the conservation efforts for the tiger . 14 | 15 | where < info 16 | where : found|find|location|place|area|located . 17 | where = The Bengal Tiger is found in India, Bangladesh, Bhutan and Nepal . 18 | 19 | eat < info 20 | eat : eat|prey|diet|food . 21 | eat = The tiger is carnivorous. It prefers hunting large ungulates such as deer, chital, sambar and even water buffaloes. Medium-sized prey include wild boars and langurs. Due to human encroachment, it also preys on human livestock . 22 | 23 | rep < info 24 | rep : reproduce|reproduction|birth|cubs|children . 25 | rep = The Bengal Tiger has no definite mating and birth seasons. Males reach maturity at 3-5 years old and females at 3-4. Tiger cubs are born in caves or areas with tall grass. Their eyes and ears are closed. They begin to eat solid food at around 2 months of age and hunt at around 5-6 months of age. At 2-3 years, they start to separate from their family . 26 | 27 | scname < info 28 | scname : scientific|name . 29 | scname = Panthera tigris tigris . 30 | 31 | genus < info 32 | genus : genus . 33 | genus = Panthera . 34 | 35 | species < info 36 | species : species . 37 | species = Panthera tigris . 38 | 39 | family < info 40 | family : family|subfamily|sub|class|order|phylum|kingdom . 41 | family = Kingdom is Animalia. Phylum is Chordata. Class is Mammalia. Order is Carnivora. Family is Felidae. Subfamily is Pantherinae . 42 | 43 | status < threat 44 | status : status|endangered . 45 | status = The Bengal Tiger has been endangered as per the IUCN Red List from 2008. Human encroachment, deforestation, poaching and habitat deforestation have led to this . 46 | 47 | conserve < threat 48 | conserve : conserve|conserving|conservation|protection|efforts|protect|help . 49 | conserve = There have been multiple conservation efforts, the most famous being, Project Tiger in India. The Indian government has set up 8 new tiger reserves to combat the endangerment of tigers . 50 | 51 | pop < threat 52 | pop : population|numbers . 53 | pop = There are 2,226 individuals in India, 440 in Bangladesh, 163-253 in Nepal and 103 in Bhutan . 54 | -------------------------------------------------------------------------------- /data/tajmahal.chat: -------------------------------------------------------------------------------- 1 | history < root 2 | info < root 3 | intro < root 4 | help < root 5 | 6 | history : when|date|year|who|why|reason built|constructed|construction|commissioned|shah|jahan|mumtaz|husband|wife|empress|emperor|queen|king . 7 | info : what|which|where|area|place architecture|architectural|design|materials|location|located|used|using . 8 | intro : about|information|info|introduction|introduce|brief|general|short . 9 | help : help|h|helpme . 10 | 11 | intr < intro 12 | intr : introduction|introduce . 13 | intr = The Taj Mahal is one of the seven wonders of the world. It is located in Agra, India. It was designated a UNESCO World Heritage Site in 1983. Ask Chanakya for more detailed information on the architecture, materials used, design and history of the Taj Mahal! Have fun . 14 | 15 | date < history 16 | date : when|date|year . 17 | date = The Taj Mahal was commissioned in 1631 and finished in 1643 . 18 | 19 | who < history 20 | who : built|build|constructed|commissioned|commission . 21 | who = The Taj Mahal was commissioned by Shah Jahan . 22 | 23 | why < history 24 | why : why|reason . 25 | why = Shah Jahan built the Taj Mahal in memory of his wife, Mumtaz Mahal, who tragically died while giving birth to a baby . 26 | 27 | shah < history 28 | shah : shah|jahan|emperor|king|husband . 29 | shah = Shah Jahan (1592-1666) was the fifth emperor of the Mughal dynasty and ruled most of northern India from 1628 to 1658. He was the son of the previous Mughal emperor, Jahangir. An able military commander, he is more known for his architectural achievements. He is considered to be one of the greatest Mughal emperors . 30 | 31 | mumtaz < history 32 | mumtaz : mumtaz|queen|empress|wife . 33 | mumtaz = Mumtaz Mahal (1593-1631) (born Arjumand Banu) was the Empress consort of the Mughal Empire from 1628 to 1631. She was married at the age of 19 to Prince Khurram, later Shah Jahan. She was the niece of Emperor Jahangir's wife, Nur Jahan. She mothered fourteen children with the Emperor. The Taj Mahal was built to commemorate Shah Jahan's love for her . 34 | 35 | arch < info 36 | arch : architecture|architectural|design . 37 | arch = The Taj Mahal incorporates Persian and earlier Mughal architectural styles. It was built using white marble with inlaid semi-precious stones. This broke away from usual Mughal-era structures which were built with red sandstone . 38 | 39 | materials < info 40 | materials : materials|used|using . 41 | materials = Materials from all over India and Asia were transported to Agra. It is believed that over 10,000 elephants were used. Materials used included:- White Marble from Rajasthan, Jade and Crystal from China, Turquoise from Tibet, Lapis Lazuli from Afghanistan, Sapphire from Sri Lanka and Carnelian from Arabia . 42 | 43 | location < info 44 | location : location|located|area|place|city|town . 45 | location = It is located in the Indian city of Agra, on the southern bank of the Yamuna river . 46 | 47 | help = Not to worry. You can ask questions relating the history, architecture, materials used and location of the Taj Mahal. You can even get to know a bit about Shah Jahan and his beloved, Mumtaz Mahal . 48 | -------------------------------------------------------------------------------- /include/knowledge-tree/stringmatcher.h: -------------------------------------------------------------------------------- 1 | typedef vector Words; 2 | 3 | /* Class which compares strings inside nodes in the tree. */ 4 | class StringMatcher { 5 | 6 | public: 7 | /* Compares the user sentence input with a node and returns a comparison score. */ 8 | static int getComparisonScore(const Words &node_keywords, const Words &sentence_words) { 9 | int score = 0; 10 | 11 | int sentenceLen = sentence_words.size(); 12 | int keywordsLen = node_keywords.size(); 13 | 14 | /*=====================================*/ 15 | /* Here, we iterate over the keywords. */ 16 | for(int iter=0; iter>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ 27 | /* Here, we iterate over the alternatives. */ 28 | int alternativesLen = alternatives.size(); 29 | for(int jiter=0; jiter= '!' && current <= '/'); 16 | else if(current >= ':' && current <= '@'); 17 | else if(current >= '[' && current <= '`'); 18 | else if(current >= '{' && current <= '~'); 19 | else new_question.push_back(current); 20 | } 21 | 22 | return new_question; 23 | } 24 | 25 | /* Checks if there are upper-case characters. */ 26 | bool upperCaseExists(string original) { 27 | int len = original.length(); 28 | 29 | for(int iter=0; iter= 'A' && original[iter] <= 'Z') return true; 31 | } 32 | 33 | return false; 34 | } 35 | 36 | /* Makes every character lower-case. */ 37 | string toLowerCase(string original_question) { 38 | 39 | if(upperCaseExists(original_question)) { 40 | 41 | int len = original_question.length(); 42 | int difference = 'a' - 'A'; 43 | string new_question; 44 | 45 | for(int iter=0;iter= 'A' && original_question[iter] <= 'Z') { 48 | new_question.push_back(original_question[iter] + difference); 49 | } 50 | else new_question.push_back(original_question[iter]); 51 | } 52 | 53 | return new_question; 54 | 55 | } 56 | 57 | return original_question; 58 | } 59 | 60 | /*===================*/ 61 | /* UTILITY FUNCTIONS */ 62 | /*===================*/ 63 | 64 | /* Removes leading and trailing whitespaces from strings. */ 65 | string trimString(string original_question) { 66 | string new_string; 67 | int originalLen = original_question.length(); 68 | 69 | bool leadingSpaceExists = original_question[0] == ' '; 70 | bool trailingSpaceExists = original_question[originalLen-1] == ' '; 71 | 72 | if(leadingSpaceExists || trailingSpaceExists) { 73 | 74 | for(int iter=0; iter getLine(string statement) { 95 | 96 | string question; 97 | vector questionSplit; 98 | 99 | cout<> temp; 13 | 14 | if(property == temp) { 15 | getline(file, temp); 16 | file.close(); 17 | 18 | int len = temp.length(); 19 | 20 | for(int iter=0; iter '9')) return false; 57 | } 58 | return true; 59 | } 60 | } 61 | 62 | /* Removes any HTML tags from a given text. */ 63 | string removeHTMLTagsFromText(string text) { 64 | 65 | int length = text.length(); 66 | int flag = 0; 67 | 68 | string newWord = ""; 69 | 70 | for(int iter=0; iter') flag = 2; 74 | if(flag == 0) newWord += text[iter]; 75 | else if(flag == 1){ } 76 | } 77 | 78 | return newWord; 79 | } 80 | 81 | /* We can display strings into a number of columns or a table. */ 82 | void formatTextIntoCols(int columns, vector input) { 83 | 84 | if(columns == -1) { /* No formatting into columns. */ 85 | int size = input.size(); 86 | for(int iter=0; iter largestLengths[colIter]) largestLengths[colIter] = input[iter].length(); 100 | if(colIter == (columns-1)) colIter = -1; 101 | } 102 | 103 | /* We make every length larger by 2 for padding. */ 104 | for(int iter=0; iter 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | using namespace std; 10 | 11 | /* User-defined libraries. */ 12 | #include"../include/utilities/utilities.h" 13 | #include"../include/knowledge-tree/infotrees.h" 14 | #include"../include/knowledge-tree/stringmatcher.h" 15 | #include"../include/knowledge-tree/treebuilder.h" 16 | #include"../include/file-validation/knowledge-base/validate.h" 17 | #include"../include/file-validation/config/validate.h" 18 | #include"../include/user-input/inputscanner.h" 19 | #include"../include/plugins/plugins.h" 20 | 21 | int main(){ 22 | 23 | /*-------------*/ 24 | /* We validate the config file syntax. */ 25 | if(!ConfigValidator::successfullyValidated()) { /* If invalid, we display an error. */ 26 | cout <<"Error: "< sentence = in.getLine("You: "); 61 | 62 | /* If nothing is entered, we 'continue'. */ 63 | /* If 'bye' is entered, we exit the loop. */ 64 | if(sentence.size() == 0) continue; 65 | else if(sentence[0] == "bye") break; 66 | 67 | /*---------------*/ 68 | /* The loop for searching for the node. */ 69 | while(true) { 70 | 71 | /* We check if there is any plugin activity or not. */ 72 | if(plugins.hasBeenMadeActive(sentence)) { 73 | plugins.areMainTopic = true; 74 | cout < maxScore) { 99 | temp_node = current_node.children[iter]; 100 | maxScore = score; 101 | } 102 | } 103 | 104 | current_node = temp_node; 105 | 106 | /* If the node has no children, then it is leaf node. */ 107 | if(current_node.children.size() == 0) { 108 | cout< . 82 | knowledge_file = ../data/ . 83 | ``` 84 | 85 | For example, amongst the topics in the ```/data``` directory, if you'd like to choose Taj Mahal, then your ```prog.config``` file would look something like this. 86 | 87 | ``` 88 | name = Chanakya . 89 | field = Taj Mahal . 90 | knowledge_file = ../data/tajmahal.chat . 91 | ``` 92 | 93 | * Now, execute the following commands, and voila! **You should now have a fully-functioning chatbot!** 94 | 95 | For Linux and Mac (in Terminal) 96 | ``` 97 | $ ./a.out 98 | ``` 99 | For Windows (in Command Prompt) 100 | ``` 101 | chanakya 102 | ``` 103 | * Feel free to point out mistakes or give any criticisms! 104 | 105 | ## Any planned features? 106 | Here's a list of some of the features I'd like to implement in the future in no particular order. 107 | 108 | Since the project is something that I'm doing for fun, I'd ideally like to implement all of the following features from scratch, ie, without the use of any external libraries. 109 | 110 | * **Word Stemming** - This might help conserve space when adding keywords for a particular branch in the knowledge base. 111 | * **Web API** - An API which can help webpages utilise Chanakya with a simple function call. 112 | * **Approximate Spellings** - In case the spelling of a word is wrong, then an approximation of what the correct word might be can be done. 113 | * **Documentation** - A proper documentation for Chanakya's logic, code and usage. 114 | * **Context** - Adding 'context' to conversations with Chanakya. 115 | * **JSON and YAML** - Support for new formats of knowledge bases so that devs don't have to learn a new format. 116 | 117 | ## Etymology 118 | It's named after **Chanakya** (371 BC - 283 BC), an ancient Indian teacher and royal advisor. Known for being a person who could *answer* the most ardous of questions, he is credited with playing an important role in the establishment of the Mauryan Empire. 119 | 120 | ## Tools 121 | * Vim Editor 122 | * Clang C++ Compiler 123 | 124 | ## Credits 125 | * [Criticker.com](https://www.criticker.com) - Source for the 'Movies' plugin 126 | * [hollywoodreporter.com](https://www.hollywoodreporter.com) - Source for the 'Movies' plugin 127 | -------------------------------------------------------------------------------- /include/knowledge-tree/infotrees.h: -------------------------------------------------------------------------------- 1 | /* Class definition for each individual node in the tree. */ 2 | class TreeNode { 3 | 4 | public: 5 | long long valuePosition; //Position of value in file. 6 | long long keywordPosition; //Position of keywords in file. 7 | 8 | string id; //ID of this node. 9 | vector children; 10 | 11 | /*==============*/ 12 | /* CONSTRUCTORS */ 13 | /*==============*/ 14 | 15 | TreeNode() {} 16 | 17 | TreeNode(string passed_id) { 18 | id = passed_id; 19 | } 20 | 21 | /*--------------------*/ 22 | /* OPERATOR OVERLOADS */ 23 | /*--------------------*/ 24 | 25 | bool operator ==(TreeNode node) { 26 | if(id == node.id) return true; 27 | else return false; 28 | } 29 | 30 | /*================*/ 31 | /* USER FUNCTIONS */ 32 | /*================*/ 33 | 34 | /* This function extracts and returns node value with help of valueIndex. */ 35 | string value() { 36 | 37 | /* We get the name of the knowledge file from the config file. */ 38 | string filename = getConfigProperty("knowledge_file"); 39 | string filetype = getConfigProperty("knowledge_type"); 40 | 41 | if(filetype == "chat") return getValueFromChatFile(filename); 42 | else if(filetype == "json") return getValueFromJsonFile(filename); 43 | else return ""; 44 | 45 | } 46 | 47 | vector keywords() { 48 | 49 | /* We get the name of the knowledge file from the config file. */ 50 | string filename = getConfigProperty("knowledge_file"); 51 | string filetype = getConfigProperty("knowledge_type"); 52 | 53 | if(filetype == "chat") return getKeywordsFromChatFile(filename); 54 | else return vector(); 55 | 56 | } 57 | 58 | private: 59 | 60 | /********************/ 61 | /* HELPER FUNCTIONS */ 62 | /********************/ 63 | 64 | /* We extract the node value from a .chat file. */ 65 | string getValueFromChatFile(string filename) { 66 | 67 | fstream file(filename.c_str()); 68 | 69 | /* One string for storing values and another for reading. */ 70 | string values = ""; 71 | string keyword; 72 | 73 | /* The cursor is set at position where value is present in file.*/ 74 | file.seekg(valuePosition); 75 | 76 | /* The loop iterates until a dot is read. */ 77 | while(true) { 78 | file >> keyword; 79 | if(keyword == ".") { 80 | values.pop_back(); 81 | break; 82 | } 83 | 84 | values.append(keyword); /* String appended to values string. */ 85 | values.push_back(' '); /* We add a space after each word. */ 86 | } 87 | 88 | file.close(); 89 | return values; 90 | 91 | } 92 | 93 | /* We extract node keywords from a .chat file. */ 94 | vector getKeywordsFromChatFile(string filename) { 95 | 96 | /* The cursor is set at position where value is present in file.*/ 97 | fstream file(filename.c_str()); 98 | file.seekg(keywordPosition); 99 | 100 | /* Vector for storing values and string for reading. */ 101 | vector node_keywords; 102 | string keyword; 103 | 104 | /* The loop iterates until a dot is read. */ 105 | while(true) { 106 | file >> keyword; 107 | 108 | if(keyword == ".") break; 109 | node_keywords.push_back(keyword); 110 | } 111 | 112 | file.close(); 113 | return node_keywords; 114 | 115 | } 116 | 117 | /* We extract the node value from a .json file. */ 118 | string getValueFromJsonFile(string filename) { 119 | 120 | /* The cursor starts from the given position. */ 121 | ifstream file(filename); 122 | file.seekg(valuePosition); 123 | 124 | string word = ""; 125 | 126 | while(true) { 127 | char character = file.get(); 128 | 129 | if(file.eof()) break; 130 | else if(character == '"') break; /* We break when " is met. */ 131 | else if(character == '\\') character = file.get(); 132 | else word += character; 133 | } 134 | 135 | return word; 136 | } 137 | 138 | /* We extract node keywords from a .json file. */ 139 | vector getKeywordsFromJsonFile(string filename) { 140 | 141 | ifstream file(filename); 142 | file.seekg(keywordPosition); 143 | 144 | vector keywords; 145 | string keyword = ""; 146 | 147 | while(true) { 148 | char character = file.get(); 149 | 150 | if(file.eof()) break; 151 | else if(character == ' ') { 152 | keywords.push_back(keyword); 153 | keyword = ""; 154 | } 155 | else if(character == '"') { 156 | keywords.push_back(keyword); 157 | break; 158 | } 159 | else if(character == '\\') character = file.get(); 160 | else keyword.push_back(character); 161 | } 162 | 163 | return keywords; 164 | 165 | } 166 | 167 | }; 168 | 169 | /* Class definiton for the tree itself. */ 170 | class InformationTree { 171 | 172 | public: 173 | 174 | TreeNode root; 175 | 176 | /*==============================*/ 177 | /* CONSTRUCTORS AND DESTRUCTORS */ 178 | /*==============================*/ 179 | 180 | InformationTree() { 181 | root.id = "root"; 182 | } 183 | 184 | /*================*/ 185 | /* USER FUNCTIONS */ 186 | /*================*/ 187 | 188 | /* Creates a node with given id and adds to given parent node. */ 189 | void add(string parentId, string id) { 190 | /* We first create a new node. */ 191 | TreeNode temp(id); 192 | 193 | /* We then 'get' the specified parent node. */ 194 | TreeNode* parent = getNode(parentId, &root); 195 | 196 | /* If the parent doesn't exist, we come out of the func. */ 197 | if(parent == NULL) return; 198 | 199 | /* We then add the child to the children of the parent. */ 200 | parent->children.push_back(temp); 201 | } 202 | 203 | /* Sets valuePosition to position in file. */ 204 | void setValuePosition(string id, int valuePosition) { 205 | TreeNode* node = getNode(id, &root); 206 | if(node == NULL) return; 207 | 208 | node->valuePosition = valuePosition; 209 | } 210 | 211 | /* Sets keywordPosition to position in file. */ 212 | void setKeywordPosition(string id, int keywordPosition) { 213 | TreeNode* node = getNode(id, &root); 214 | if(node == NULL) return; 215 | 216 | node->keywordPosition = keywordPosition; 217 | } 218 | 219 | /*-------------------*/ 220 | /* Utility Functions */ 221 | /*-------------------*/ 222 | 223 | /* We return the node with the given parent ID. */ 224 | TreeNode* getNode(string id, TreeNode* passed_root) { 225 | 226 | if(passed_root->id == id) { 227 | return passed_root; 228 | } 229 | else if(passed_root->children.size() == 0); 230 | else if(passed_root->children.size() != 0) { 231 | 232 | int childrenLength = passed_root->children.size(); 233 | for(int iter=0; iterchildren[iter]); 235 | if(result != NULL) return result; 236 | } 237 | 238 | } 239 | 240 | return NULL; 241 | 242 | } 243 | 244 | /* Debugging function. */ 245 | /* void print(TreeNode passed_root) { 246 | 247 | cout<<"The parent is "< bracketStack; 112 | bool quotesNotOpen = true; 113 | 114 | while(true) { 115 | char character = jsonFile.get(); 116 | 117 | if(jsonFile.eof() ) break; 118 | if( character == '"' ) quotesNotOpen = !quotesNotOpen; 119 | 120 | { 121 | if( (character == '{' || character == '[') && quotesNotOpen) { 122 | bracketStack.push(character); 123 | } 124 | else if ( (character == '}' || character == ']') && quotesNotOpen ) { 125 | if(bracketStack.size() == 0) return false; 126 | 127 | char topSymbol = bracketStack.top(); 128 | bracketStack.pop(); 129 | 130 | if(character == '}' && topSymbol == '{'); 131 | else if(character == ']' && topSymbol == '['); 132 | else return false; 133 | } 134 | else if( character == '\n' || character == '\r' ) file_line++; 135 | } 136 | } 137 | 138 | if(bracketStack.size() != 0) return false; 139 | 140 | return true; 141 | } 142 | 143 | /* Validates whether each string is formatted properly. */ 144 | bool stringsAreFormattedProperly() { 145 | 146 | long start, length = 0; 147 | bool stringHasStarted = false; 148 | bool quotesIsNotOpen = true; 149 | 150 | while(true) { 151 | char character = jsonFile.get(); 152 | 153 | if(jsonFile.eof()) { 154 | if(stringHasStarted) { 155 | length = jsonFile.tellg() - (long long) start; 156 | 157 | if(stringIsEmpty(extractFromFile(start-1,length))); 158 | else if(stringNotEnclosedByQuotes(start-1, length)) return false; 159 | } 160 | break; 161 | } 162 | else if( character == '\\' && stringHasStarted ) { /* Escaping characters. */ 163 | character = jsonFile.get(); 164 | continue; 165 | } 166 | else if( character == '"' || character == ',' || 167 | character == ':' || character == '[' || 168 | character == ']' || character == '{' || 169 | character == '}' ) { /* Structural characters */ 170 | 171 | if(stringHasStarted) { 172 | stringHasStarted = false; 173 | length = jsonFile.tellg() - (long long) start; 174 | 175 | if(stringIsEmpty(extractFromFile(start-1,length))); 176 | else if(stringNotEnclosedByQuotes(start-1, length)) return false; 177 | 178 | length = 0; 179 | } 180 | } 181 | else if( character == '\n' || character == '\r' ) file_line++; 182 | else { /* Literally anything else. */ 183 | if(!stringHasStarted) { 184 | stringHasStarted = true; 185 | start = jsonFile.tellg(); 186 | } 187 | } 188 | } 189 | 190 | return true; 191 | } 192 | 193 | /* Validates whether every array in the file is formatted properly. */ 194 | bool arraysAreFormattedProperly(long long cursor) { 195 | jsonFile.seekg(cursor); 196 | 197 | bool arrayHasStarted = false; 198 | bool stringHasStarted = false; 199 | bool commaNotEncountered = false; // Default value for first element. 200 | 201 | while(true) { 202 | char character = jsonFile.get(); 203 | if(jsonFile.eof()) { 204 | if(arrayHasStarted) return false; 205 | break; 206 | } 207 | 208 | if( character == '\\' ) { 209 | if(stringHasStarted) character = jsonFile.get(); 210 | else return false; 211 | } 212 | else if( character == '[' ) { 213 | if(!arrayHasStarted) { 214 | arrayHasStarted = true; 215 | } 216 | else if( arrayHasStarted ) { 217 | if( arraysAreFormattedProperly(jsonFile.tellg() - (long long) 1) ) 218 | commaNotEncountered = true; 219 | else return false; 220 | } 221 | } 222 | else if( character == '"' ) { 223 | if( arrayHasStarted ) { 224 | if( commaNotEncountered && !stringHasStarted ) return false; 225 | else if( !stringHasStarted ) stringHasStarted = true; 226 | else if( stringHasStarted ) { 227 | stringHasStarted = false; 228 | commaNotEncountered = true; 229 | } 230 | } 231 | } 232 | else if( character == ',' ) { 233 | if( !commaNotEncountered ) return false; 234 | else if( arrayHasStarted && !stringHasStarted ) commaNotEncountered = false; 235 | } 236 | else if( character == ']' ) { 237 | if( arrayHasStarted ) { 238 | if( stringHasStarted ) return false; 239 | arrayHasStarted = false; 240 | return true; 241 | } 242 | else return false; 243 | } 244 | else if( character == '{' ){ 245 | return mapsAreFormattedProperly(jsonFile.tellg() - (long long) 1); 246 | } 247 | else if(character == '\n' || character == '\r') file_line++; 248 | else { 249 | if( character == ' ' ); 250 | else return false; 251 | } 252 | 253 | } 254 | 255 | return true; 256 | } 257 | 258 | /* Validates whether every map in the array is formatted properly. */ 259 | bool mapsAreFormattedProperly(long long cursor) { 260 | jsonFile.seekg(cursor); 261 | 262 | bool mapHasStarted = false; 263 | bool stringHasStarted = false; 264 | bool commaEncountered = true; 265 | bool colonEncountered = false; 266 | int stringNum = 0; 267 | 268 | while(true) { 269 | char character = jsonFile.get(); 270 | if(jsonFile.eof()) break; 271 | 272 | if( character == '\\' ) { 273 | if(stringHasStarted) character = jsonFile.get(); 274 | else return false; 275 | } 276 | else if( character == '{' ) { 277 | if( !mapHasStarted ) mapHasStarted = true; 278 | else { 279 | if( stringNum == 0 ) return false; 280 | 281 | bool dummy = true; 282 | if( mapsAreFormattedProperly(jsonFile.tellg() - (long long) 1) ) stringNum = 2; 283 | else return false; 284 | 285 | } 286 | } 287 | else if(character == '"') { 288 | if( !stringHasStarted ) { 289 | stringHasStarted = true; 290 | if( stringNum == 0 && commaEncountered ) commaEncountered = false; 291 | else if( stringNum == 1 && !colonEncountered ) return false; 292 | else if( stringNum >= 2 ) return false; 293 | } 294 | else { 295 | stringHasStarted = false; 296 | stringNum++; 297 | } 298 | } 299 | else if( character == ':' ) { 300 | if( !stringHasStarted && stringNum == 1 ) { 301 | if( !colonEncountered ) colonEncountered = true; 302 | else return false; 303 | } 304 | else return false; 305 | } 306 | else if( character == ',' ) { 307 | if( !stringHasStarted && stringNum == 2 ) { 308 | commaEncountered = true; 309 | stringNum = 0; 310 | colonEncountered = false; 311 | } 312 | else return false; 313 | } 314 | else if( character == '}' ) { 315 | if( mapHasStarted && stringNum == 2 && !commaEncountered ) break; 316 | else return false; 317 | } 318 | else if( character == '[' ) { 319 | return arraysAreFormattedProperly(jsonFile.tellg() - (long long) 1); 320 | } 321 | else if( character == '\n' || character == '\r') file_line++; 322 | else { 323 | if( character == ' ' ); 324 | else return false; 325 | } 326 | } 327 | 328 | return true; 329 | } 330 | 331 | /************************/ 332 | /* SUPPORTING FUNCTIONS */ 333 | /************************/ 334 | 335 | /* We check if the given range is preceded by quotes. */ 336 | bool stringNotEnclosedByQuotes(int start, int length) { 337 | ifstream file(filenamestring); 338 | 339 | file.seekg(start-1); 340 | if(file.get() != 34) return true; 341 | 342 | file.seekg(start+length); 343 | if(file.get() != 34) return true; 344 | 345 | return false; 346 | } 347 | 348 | /* Extracts the requisite string from the filename given. */ 349 | string extractFromFile(int start, int length) { 350 | ifstream file(filenamestring); 351 | file.seekg(start); 352 | 353 | string str = ""; 354 | 355 | for(int iter=0; iter input) { 17 | int length = input.size(); 18 | 19 | for(int iter=0; iter input, string name, bool onlyPlugins) { 29 | 30 | /* We get the parameter options from the input. */ 31 | vector options = parseOptionsFromInput(input); 32 | 33 | /* We firct check if an answer is possible. */ 34 | if(!canGiveAnAnswer(input) && options[1]==0 && options[2]==0) 35 | cout< results = getDataFromHTML(); 40 | 41 | /* We check if it is a question about a movie. */ 42 | if(options[2] > 0) { 43 | if(options[2] == 1) { 44 | cout< parseOptionsFromInput(vector input) { 104 | 105 | /*------*/ 106 | /* The first option is genre (awards are genres too). Second option is year. */ 107 | array genres = {"adventure","action", "animation","comedy","drama","horror","kids","family","musical","music","mystery","suspense","thriller","romance","romantic","science","sci","fantasy","sports","fitness","game","war","oscars","oscar","award","awards","tamil","kollywood","bafta","disney","plus","malayalam","mallu","mollywood","news","updates","update","all"}; 108 | array genreOptions = {1,1,2,3,4,5,6,6,7,7,8,9,9,10,10,11,11,11,12,12,12,13,14,14,14,14,15,15,17,18,18,19,19,19,20,20,20,16}; 109 | int noOfGenres = genreOptions.size(); 110 | 111 | vector options(3,0); /* 3 elements with value 0. */ 112 | 113 | /* We shall first try and see if a genre exists in the sentence. */ 114 | int size = input.size(); 115 | for(int iter=0; iter options) { 168 | 169 | string baseURL = "'https://www.criticker.com/films/?filter="; 170 | 171 | if(options[2] == 1) return "'https://www.criticker.com/?search="+movieName+"&type=films'"; 172 | 173 | switch(options[0]) { 174 | case 1: baseURL.append("gy12x13zi1zf1900zt2030zor'"); break; //action 175 | case 2: baseURL.append("gy18zi1zf1900zt2030zor'"); break; //animated 176 | case 3: baseURL.append("gy2zi1zf1900zt2030zor'"); break; //comedy 177 | case 4: baseURL.append("gy3zi1zf1900zt2030zor'"); break; //drama 178 | case 5: baseURL.append("gy15zi1zf1900zt2030zor'"); break; //horror 179 | case 6: baseURL.append("gy10zi1zf1900zt2030zor'"); break; //kids 180 | case 7: baseURL.append("gy41x9zi1zf1900zt2030zor'"); break; //music 181 | case 8: baseURL.append("gy17zi1zf1900zt2030zor'"); break; //mystery 182 | case 9: baseURL.append("gy6zi1zf1900zt2030zor'"); break; //thriller/suspense 183 | case 10: baseURL.append("gy1zi1zf1900zt2030zor'"); break; //romance 184 | case 11: baseURL.append("gy5zi1zf1900zt2030zor'"); break; //scifi 185 | case 12: baseURL.append("gy34zi1zf1900zt2030zor'"); break; //sport 186 | case 13: baseURL.append("gy14zi1zf1900zt2030zor'"); break; //war 187 | case 14: baseURL.append("f1900zt2030ze3139zod'"); break; //oscar 188 | case 15: baseURL.append("f1900zt2030ze3075zor'"); break; //tamil 189 | case 16: baseURL.append("i1zf1900zt2030zor'"); break; //all 190 | case 17: baseURL.append("f1900zt2030ze10797zod'"); break; //bafta 191 | case 18: baseURL.append("f1900zt2030ze42853zor'"); break; //disney/disney+ 192 | case 19: baseURL.append("f1900zt2030ze2908zor'"); break; //malayalam 193 | case 20: baseURL = "'https://www.hollywoodreporter.com/topic/movies'"; break; //news 194 | } 195 | 196 | /* For year, we replace year in URL with our own. */ 197 | if(options[1] != 0 && options[0] == 14) { /* For Oscars, +1 year as award is presented next year only. */ 198 | baseURL.replace(baseURL.find("1900"),4,to_string(options[1]-1)); 199 | baseURL.replace(baseURL.find("2030"),4,to_string(options[1]-1)); 200 | } 201 | else if(options[1] != 0 && options[0] != 20) { /* No year replace for news results. */ 202 | baseURL.replace(baseURL.find("1900"),4,to_string(options[1])); 203 | baseURL.replace(baseURL.find("2030"),4,to_string(options[1])); 204 | } 205 | 206 | return baseURL; 207 | } 208 | 209 | /***************/ 210 | /* We save the request response HTML to a file. */ 211 | void saveHTMLFromURL(string url) { 212 | string cmd = "curl -s " + url + " > data.txt"; 213 | system(cmd.c_str()); /* Downloading file from URL. */ 214 | 215 | cmd = " cat data.txt | sed 's/"/\"/g' | sed \"s/'/'/g\" > tempdata.txt"; 216 | system(cmd.c_str()); /* Replacing " with ". */ 217 | 218 | cmd = "cat tempdata.txt > data.txt; rm tempdata.txt"; 219 | system(cmd.c_str()); /* Replacing ' with '. */ 220 | } 221 | 222 | /****************/ 223 | /* We parse the response HTML in the file to get our data (movie vectors). */ 224 | vector getDataFromHTML() { 225 | 226 | ifstream file("data.txt"); 227 | string word; 228 | string movie = ""; 229 | movieName = ""; 230 | 231 | vector movies; 232 | 233 | while(!file.eof()) { 234 | file>>word; 235 | 236 | /* Web-Scraping Movies from Criticker.com */ 237 | if(word == "class='fl_titlelist_link'") { 238 | 239 | int flag = 0; 240 | char character; 241 | 242 | while(true) { 243 | file.get(character); 244 | if(character == '<') break; 245 | if(flag == 1) movie.push_back(character); 246 | if(character == '>') flag = 1; 247 | } 248 | 249 | movies.push_back(movie); 250 | movie = ""; 251 | } 252 | /* Web-Scraping News from hollywoodreporter.com. */ 253 | else if(word == "class=\"topic-card__headline") { 254 | 255 | int flag = 0; 256 | char character; 257 | 258 | while(true) { 259 | file.get(character); 260 | if(character == '<') break; 261 | if(flag == 1) movie.push_back(character); 262 | if(character == '>') { 263 | flag = 1; 264 | movie.append("--> "); 265 | } 266 | } 267 | 268 | movies.push_back(movie); 269 | movie = ""; 270 | } 271 | /* Web-Scraping movie name from criticker.com search. */ 272 | else if(word == "class='titlerow_name'>') flag = 1; 281 | } 282 | 283 | movie.push_back('\n'); 284 | movie.append("Summary: "); 285 | } 286 | /* Web-Scraping movie summary from criticker.com search. */ 287 | else if(word == "class='titlerow_summary'") { 288 | int flag = 0; 289 | char character; 290 | 291 | while(true) { 292 | file.get(character); 293 | if(character == '<') break; 294 | if(flag == 1) movie.push_back(character); 295 | if(character == '>') flag = 1; 296 | } 297 | 298 | movies.push_back(movie); 299 | movie=""; 300 | break; 301 | } 302 | } 303 | 304 | file.close(); 305 | return movies; 306 | } 307 | 308 | }; 309 | -------------------------------------------------------------------------------- /data/knowledgebase.chat: -------------------------------------------------------------------------------- 1 | matches < root 2 | team < root 3 | stats < root 4 | help < root 5 | 6 | matches : who|whom|when|where|much|many won|lost|happened|happen|vs|score|result motm|man|match kkr|rcb|srh|dc|mi|rr|kxip|csk mumbai|delhi|kolkata|rajasthan|punjab|hyderabad|bangalore playoffs|playoff|qualifier|qualifiers|final|finals . 7 | team : who|whom|which captain|vice|owner|coach|home|team|squad|players|overseas|foreign chinna|thala|chepauk company|sponsor|partner|ground tech|main|shirt|food|drinks . 8 | stats : who|whom highest|leading|most run|runs wicket|wickets score|scorer|take|taker 2019|season . 9 | help : help|h|helpme . 10 | 11 | kkr1 < matches 12 | kkr2 < matches 13 | rcb1 < matches 14 | rcb2 < matches 15 | srh1 < matches 16 | srh2 < matches 17 | dc1 < matches 18 | dc2 < matches 19 | rr1 < matches 20 | rr2 < matches 21 | mi1 < matches 22 | mi2 < matches 23 | kxip1 < matches 24 | kxip2 < matches 25 | q1 < matches 26 | q2 < matches 27 | final < matches 28 | 29 | kkr1 : kkr kolkata knight riders first|home chennai|chepauk|home . 30 | rcb1 : rcb royal challengers bangalore first|home chennai|chepauk|home . 31 | srh1 : srh hyderabad sunrisers first|away hyderabad|away . 32 | dc1 : dc delhi capitals first|away feroz|delhi|away . 33 | rr1 : rr rajasthan royals first|home chennai|chepauk|home . 34 | mi1 : mi mumbai indians first|away away|mumbai|wankhede . 35 | kxip1 : kxip kings xi punjab first|home chennai|chepauk|home . 36 | 37 | kkr2 : kkr kolkata knight riders second|away kolkata|eden|away . 38 | rcb2 : rcb royal challengers bangalore second|away bangalore|chinnaswamy|away . 39 | srh2 : srh hyderabad sunrisers second|home chennai|chepauk|home . 40 | dc2 : dc delhi capitals second|home chennai|chepauk|home . 41 | rr2 : rr rajasthan royals second|away jaipur|away . 42 | mi2 : mi mumbai indians second|home chennai|chepauk|home . 43 | kxip2 : kxip kings xi punjab second|away punjab|mohali|away . 44 | 45 | q1 : 1 mi mumbai indians qualifier|playoff|playoffs chepauk|home . 46 | q2 : 2 dc delhi capitals qualifier|playoff|playoffs visakhapatnam|away . 47 | final : last mi mumbai indians finals|final|playoff|playoffs away . 48 | 49 | kkrmotm < kkr1 50 | kkrmotm : man of the match motm . 51 | kkrmotm = Deepak Chahar . 52 | 53 | kkrfi < kkr1 54 | kkrfi : score|hit|scoreboard|runs|wickets . 55 | kkrfi = KKR - 109/9 (Russell 50*, Chahar 3/20) and CSK - 111/3 (Plessis 43*, Narine 2/24) . 56 | 57 | kkr1result < kkr1 58 | kkr1result : won|result|lost|happened|vs of the . 59 | kkr1result = CSK won the match by 6 wickets . 60 | 61 | kkr1venue < kkr1 62 | kkr1venue : venue|where|place . 63 | kkr1venue = Chepauk . 64 | 65 | kkr1date < kkr1 66 | kkr1date : when|date|month|day . 67 | kkr1date = 9th April, 2019 . 68 | 69 | kkr2motm < kkr2 70 | kkr2motm : man of the match motm . 71 | kkr2motm = Imran Tahir . 72 | 73 | kkr2fi < kkr2 74 | kkr2fi : score|hit|scoreboard|runs|wickets . 75 | kkr2fi = KKR - 161/8 (Lynn 82, Tahir 4/27) and CSK - 162/5 (Raina 58*, Narine 2/19) . 76 | 77 | kkr2result < kkr2 78 | kkr2result : won|result|lost|happened|vs of the . 79 | kkr2result = CSK won the match by 5 wickets . 80 | 81 | kkr2venue < kkr2 82 | kkr2venue : venue|where|place . 83 | kkr2venue = Eden Gardens . 84 | 85 | kkr2date < kkr2 86 | kkr2date : when|date|month|day . 87 | kkr2date = 14th April, 2019 . 88 | 89 | rcbmotm < rcb1 90 | rcbmotm : man of the match motm . 91 | rcbmotm = Harbhajan Singh . 92 | 93 | rcb1fi < rcb1 94 | rcb1fi : score|hit|scoreboard|runs|wickets . 95 | rcb1fi = RCB - 70 (Parthiv 29, Tahir 3/9) and CSK - 71/3 (Rayudu 28, Siraj 1/5) . 96 | 97 | rcb1result < rcb1 98 | rcb1result : won|result|lost|happened|vs of the . 99 | rcb1result = CSK won the match by 7 wickets . 100 | 101 | rcb1venue < rcb1 102 | rcb1venue : venue|where|place . 103 | rcb1venue = Chepauk . 104 | 105 | rcb1date < rcb1 106 | rcb1date : when|date|month|day . 107 | rcb1date = 23rd March, 2019 . 108 | 109 | rcb2motm < rcb2 110 | rcb2motm : man of the match motm . 111 | rcb2motm = Parthiv Patel . 112 | 113 | rcb2fi < rcb2 114 | rcb2fi : score|hit|scoreboard|runs|wickets . 115 | rcb2fi = RCB - 161/7 (Parthiv 53, Chahar 2/25) and CSK - 160/8 (Dhoni 84*, Steyn 2/24) . 116 | 117 | rcb2result < rcb2 118 | rcb2result : won|result|lost|happened|vs of the . 119 | rcb2result = RCB won the match by 1 run . 120 | 121 | rcb2venue < rcb2 122 | rcb2venue : venue|where|place . 123 | rcb2venue = Bangalore . 124 | 125 | rcb2date < rcb2 126 | rcb2date : when|date|month|day . 127 | rcb2date = 21st April, 2019 . 128 | 129 | srh1motm < srh1 130 | srh1motm : man of the match motm . 131 | srh1motm = David Warner . 132 | 133 | srh1fi < srh1 134 | srh1fi : score|hit|scoreboard|runs|wickets . 135 | srh1fi = CSK - 132/5 (Plessis 45, Rashid 2/17) and SRH - 137/4 (Warner 50, Tahir 2/20) . 136 | 137 | srh1date < srh1 138 | srh1date : when|date|month|day . 139 | srh1date = 17th April, 2019 . 140 | 141 | srh1result < srh1 142 | srh1result : won|result|lost|happened|vs of the . 143 | srh1result = SRH won the match by 7 wickets . 144 | 145 | srh1venue < srh1 146 | srh1venue : venue|where|place . 147 | srh1venue = Hyderabad . 148 | 149 | srh2motm < srh2 150 | srh2motm : man of the match motm . 151 | srh2motm = Shane Watson . 152 | 153 | srh2fi < srh2 154 | srh2fi : score|hit|scoreboard|runs|wickets . 155 | srh2fi = SRH - 175/3 (Pandey 83*, Bhajji 2/39) and CSK - 176/4 (Watson 96, Bhuvi 1/18) . 156 | 157 | srh2date < srh2 158 | srh2date : when|date|month|day . 159 | srh2date = 23rd April, 2019 . 160 | 161 | srh2result < srh2 162 | srh2result : won|result|lost|happened|vs of the . 163 | srh2result = CSK won the match by 6 wickets . 164 | 165 | srh2venue < srh2 166 | srh2venue : venue|where|place . 167 | srh2venue = Chepauk . 168 | 169 | dcmotm < dc1 170 | dcmotm : man of the match motm . 171 | dcmotm = Shane Watson . 172 | 173 | dc1fi < dc1 174 | dc1fi : score|hit|scoreboard|runs|wickets . 175 | dc1fi = DC - 147/6 (Dhawan 51, Bravo 3/33) and CSK - 150/4 (Watson 44, Mishra 2/35) . 176 | 177 | dc1result < dc1 178 | dc1result : won|result|lost|happened|vs of the . 179 | dc1result = CSK won the match by 6 wickets . 180 | 181 | dc1venue < dc1 182 | dc1venue : venue|where|place . 183 | dc1venue = New Delhi . 184 | 185 | dc1date < dc1 186 | dc1date : when|date|month|day . 187 | dc1date = 26th March, 2019 . 188 | 189 | dc2motm < dc2 190 | dc2motm : man of the match motm . 191 | dc2motm = MS Dhoni . 192 | 193 | dc2fi < dc2 194 | dc2fi : score|hit|scoreboard|runs|wickets . 195 | dc2fi = CSK - 179/4 (Raina 59, Suchith 2/28) and DC - 99 (Iyer 44, Tahir 4/12) . 196 | 197 | dc2result < dc2 198 | dc2result : won|result|lost|happened|vs of the . 199 | dc2result = CSK won the match by 80 runs . 200 | 201 | dc2venue < dc2 202 | dc2venue : venue|where|place . 203 | dc2venue = Chepauk . 204 | 205 | dc2date < dc2 206 | dc2date : when|date|month|day . 207 | dc2date = 1st May, 2019 . 208 | 209 | rr1motm < rr1 210 | rr1motm : man of the match motm . 211 | rr1motm = MS Dhoni . 212 | 213 | rr1fi < rr1 214 | rr1fi : score|hit|scoreboard|runs|wickets . 215 | rr1fi = CSK - 175/5 (Dhoni 75*, Archer 2/17) and RR - 167/8 (Stokes 46, Chahar 2/19) . 216 | 217 | rr1result < rr1 218 | rr1result : won|result|lost|happened|vs of the . 219 | rr1result = CSK won the match by 8 runs . 220 | 221 | rr1venue < rr1 222 | rr1venue : venue|where|place . 223 | rr1venue = Chepauk . 224 | 225 | rr1date < rr1 226 | rr1date : when|date|month|day . 227 | rr1date = 31st March, 2019 . 228 | 229 | rr2motm < rr2 230 | rr2motm : man of the match motm . 231 | rr2motm = MS Dhoni . 232 | 233 | rr2fi < rr2 234 | rr2fi : score|hit|scoreboard|runs|wickets . 235 | rr2fi = RR - 151/7 (Stokes 28, Jadeja 2/20) and CSK - 155/6 (Dhoni 58, Stokes 2/39) . 236 | 237 | rr2result < rr2 238 | rr2result : won|result|lost|happened|vs of the . 239 | rr2result = CSK won the match by 4 wickets . 240 | 241 | rr2venue < rr2 242 | rr2venue : venue|where|place . 243 | rr2venue = Jaipur . 244 | 245 | rr2date < rr2 246 | rr2date : when|date|month|day . 247 | rr2date = 11th April, 2019 . 248 | 249 | kxip1motm < kxip1 250 | kxip1motm : man of the match motm . 251 | kxip1motm = Harbhajan Singh . 252 | 253 | kxip1fi < kxip1 254 | kxip1fi : score|hit|scoreboard|runs|wickets . 255 | kxip1fi = CSK - 160/3 (du Plessis 54, Ashwin 3/23) and KXIP - 138/5 (S Khan 67, Bhajji 2/17) . 256 | 257 | kxip1date < kxip1 258 | kxip1date : when|date|month|day . 259 | kxip1date = 6th April, 2019 . 260 | 261 | kxip1result < kxip1 262 | kxip1result : won|result|lost|happened|vs of the . 263 | kxip1result = CSK won by 22 runs . 264 | 265 | kxip1venue < kxip1 266 | kxip1venue : venue|where|place . 267 | kxip1venue = Chepauk . 268 | 269 | kxip2motm < kxip2 270 | kxip2motm : man of the match motm . 271 | kxip2motm = KL Rahul . 272 | 273 | kxip2fi < kxip2 274 | kxip2fi : score|hit|scoreboard|runs|wickets . 275 | kxip2fi = CSK - 170/5 (du Plessis 96, Curran 3/35) and KXIP - 173/4 (KL Rahul 71, Bhajji 3/57) . 276 | 277 | kxip2date < kxip2 278 | kxip2date : when|date|month|day . 279 | kxip2date = 5th May, 2019 . 280 | 281 | kxip2result < kxip2 282 | kxip2result : won|result|lost|happened|vs of the . 283 | kxip2result = KXIP won by 6 wickets . 284 | 285 | kxip2venue < kxip2 286 | kxip2venue : venue|where|place . 287 | kxip2venue = Mohali . 288 | 289 | mi1motm < mi1 290 | mi1motm : man of the match motm . 291 | mi1motm = Hardik Pandya . 292 | 293 | mi1fi < mi1 294 | mi1fi : score|hit|scoreboard|runs|wickets . 295 | mi1fi = MI - 170/5 (Yadav 59, Jadeja 1/10) and CSK - 133/8 (Jadhav 58, Pandya 3/20) . 296 | 297 | mi1date < mi1 298 | mi1date : when|date|month|day . 299 | mi1date = 3rd April, 2019 . 300 | 301 | mi1result < mi1 302 | mi1result : won|result|lost|happened|vs of the . 303 | mi1result = MI won by 37 runs . 304 | 305 | mi1venue < mi1 306 | mi1venue : venue|where|place . 307 | mi1venue = Mumbai . 308 | 309 | mi2motm < mi2 310 | mi2motm : man of the match motm . 311 | mi2motm = Rohit Sharma . 312 | 313 | mi2fi < mi2 314 | mi2fi : score|hit|scoreboard|runs|wickets . 315 | mi2fi = MI - 155/4 (Sharma 67, Santner 2/13) and CSK - 109 (Vijay 38, Malinga 4/37) . 316 | 317 | mi2date < mi2 318 | mi2date : when|date|month|day . 319 | mi2date = 26th April, 2019 . 320 | 321 | mi2result < mi2 322 | mi2result : won|result|lost|happened|vs of the . 323 | mi2result = MI won by 46 runs . 324 | 325 | mi2venue < mi2 326 | mi2venue : venue|where|place . 327 | mi2venue = Chepauk . 328 | 329 | q1motm < q1 330 | q1motm : man of the match motm . 331 | q1motm = Suryakumar Yadav . 332 | 333 | q1fi < q1 334 | q1fi : score|hit|scoreboard|runs|wickets . 335 | q1fi = CSK - 131/4 (Rayudu 42*, Chahar 2/14) and MI - 132/4 (Yadav 71*, Tahir 2/33) . 336 | 337 | q1result < q1 338 | q1result : won|result|lost|happened|vs of the . 339 | q1result = MI won by 6 wickets . 340 | 341 | q1venue < q1 342 | q1venue : venue|where|place . 343 | q1venue = Chepauk . 344 | 345 | q1date < q1 346 | q1date : when|date|month|day . 347 | q1date = 7th April, 2019 . 348 | 349 | q2motm < q2 350 | q2motm : man of the match motm . 351 | q2motm = Faf du Plessis . 352 | 353 | q2fi < q2 354 | q2fi : score|hit|scoreboard|runs|wickets . 355 | q2fi = DC - 147/9 (Pant 38, Bravo 2/19) and CSK - 151/4 (Watson 50, Boult 1/20) . 356 | 357 | q2result < q2 358 | q2result : won|result|lost|happened|vs of the . 359 | q2result = CSK won by 6 wickets . 360 | 361 | q2venue < q2 362 | q2venue : venue|where|place . 363 | q2venue = Vishakapatnam . 364 | 365 | q2date < q2 366 | q2date : when|date|month|day . 367 | q2date = 10th April, 2019 . 368 | 369 | finalmotm < final 370 | finalmotm : man of the match motm . 371 | finalmotm = Jasprit Bumrah . 372 | 373 | finfi < final 374 | finfi : score|hit|scoreboard|runs|wickets . 375 | finfi = MI - 149/8 (Pollard 41, Chahar 3/26) and CSK - 148/7 (Watson 80, Bumrah 2/14) . 376 | 377 | finalresult < final 378 | finalresult : won|result|lost|happened|vs of the . 379 | finalresult = MI won by 1 run and lifted the trophy for the 4th time . 380 | 381 | finalvenue < final 382 | finalvenue : venue|where|place . 383 | finalvenue = Hyderabad . 384 | 385 | finaldate < final 386 | finaldate : when|date|month|day . 387 | finaldate = 12th May, 2019 . 388 | 389 | owner < team 390 | owner : owner srini mama . 391 | owner = N Srinivasan . 392 | 393 | captain < team 394 | captain : captain thala mahi . 395 | captain = Mahendra Singh Dhoni . 396 | 397 | vice < team 398 | vice : vice captain|thala chinna . 399 | vice = Suresh Raina . 400 | 401 | coach < team 402 | coach : coach . 403 | coach = Stephen Fleming . 404 | 405 | battingcoach < team 406 | battingcoach : batting|bat coach . 407 | battingcoach = Mike Hussey . 408 | 409 | bowlingcoach < team 410 | bowlingcoach : bowling|bowl coach . 411 | bowlingcoach = L Balaji . 412 | 413 | squad < team 414 | squad : squad|team|players all|full|list . 415 | squad = Poda dei, refer the internet . 416 | 417 | overseas < team 418 | overseas : overseas|foreign|non players|squad|team . 419 | overseas : Plessis, Tahir, Watson and Bravo . 420 | 421 | ground < team 422 | ground : ground|home|chepauk|chidamabaram . 423 | ground = CSK's home ground is the MAC Stadium (Chepauk) . 424 | 425 | company < team 426 | company : company|partner|sponsor|sponsors owns|own|main . 427 | company = India Cements . 428 | 429 | techpartner < team 430 | techpartner : tech company|partner|sponsor|sponsors . 431 | techpartner = Tekplay . 432 | 433 | drinksptr < team 434 | drinksptr : company|partner|sponsor|sponsors drinks|drink . 435 | drinksptr = Frooti . 436 | 437 | highestruns < stats 438 | highestruns : highest|most runs|run|average scored|scorer|score . 439 | highestruns = MS Dhoni (416 runs) at an average of 42.20 . 440 | 441 | mostwickets < stats 442 | mostwickets : highest|most|leading wickets|wicket taken|took purple . 443 | mostwickets = Imran Tahir (26 wickets) . 444 | 445 | help = Not to worry. You can ask questions relating to information on CSK matches, dates, results, man of the matches and even team information like coaches, the captain, sponsors, etc . 446 | -------------------------------------------------------------------------------- /data/chennaisuperkings.chat: -------------------------------------------------------------------------------- 1 | matches < root 2 | team < root 3 | stats < root 4 | help < root 5 | 6 | matches : who|whom|when|where|much|many won|lost|happened|happen|vs|score|result motm|man|match kkr|rcb|srh|dc|mi|rr|kxip|csk mumbai|delhi|kolkata|rajasthan|punjab|hyderabad|bangalore playoffs|playoff|qualifier|qualifiers|final|finals . 7 | team : who|whom|which captain|vice|owner|coach|home|team|squad|players|overseas|foreign chinna|thala|chepauk company|sponsor|partner|ground tech|main|shirt|food|drinks . 8 | stats : who|whom highest|leading|most run|runs wicket|wickets score|scorer|take|taker 2019|season . 9 | help : help|h|helpme . 10 | 11 | kkr1 < matches 12 | kkr2 < matches 13 | rcb1 < matches 14 | rcb2 < matches 15 | srh1 < matches 16 | srh2 < matches 17 | dc1 < matches 18 | dc2 < matches 19 | rr1 < matches 20 | rr2 < matches 21 | mi1 < matches 22 | mi2 < matches 23 | kxip1 < matches 24 | kxip2 < matches 25 | q1 < matches 26 | q2 < matches 27 | final < matches 28 | 29 | kkr1 : kkr kolkata knight riders first|home chennai|chepauk|home . 30 | rcb1 : rcb royal challengers bangalore first|home chennai|chepauk|home . 31 | srh1 : srh hyderabad sunrisers first|away hyderabad|away . 32 | dc1 : dc delhi capitals first|away feroz|delhi|away . 33 | rr1 : rr rajasthan royals first|home chennai|chepauk|home . 34 | mi1 : mi mumbai indians first|away away|mumbai|wankhede . 35 | kxip1 : kxip kings xi punjab first|home chennai|chepauk|home . 36 | 37 | kkr2 : kkr kolkata knight riders second|away kolkata|eden|away . 38 | rcb2 : rcb royal challengers bangalore second|away bangalore|chinnaswamy|away . 39 | srh2 : srh hyderabad sunrisers second|home chennai|chepauk|home . 40 | dc2 : dc delhi capitals second|home chennai|chepauk|home . 41 | rr2 : rr rajasthan royals second|away jaipur|away . 42 | mi2 : mi mumbai indians second|home chennai|chepauk|home . 43 | kxip2 : kxip kings xi punjab second|away punjab|mohali|away . 44 | 45 | q1 : 1 mi mumbai indians qualifier|playoff|playoffs chepauk|home . 46 | q2 : 2 dc delhi capitals qualifier|playoff|playoffs visakhapatnam|away . 47 | final : last mi mumbai indians finals|final|playoff|playoffs away . 48 | 49 | kkrmotm < kkr1 50 | kkrmotm : man of the match motm . 51 | kkrmotm = Deepak Chahar . 52 | 53 | kkrfi < kkr1 54 | kkrfi : score|hit|scoreboard|runs|wickets . 55 | kkrfi = KKR - 109/9 (Russell 50*, Chahar 3/20) and CSK - 111/3 (Plessis 43*, Narine 2/24) . 56 | 57 | kkr1result < kkr1 58 | kkr1result : won|result|lost|happened|vs of the . 59 | kkr1result = CSK won the match by 6 wickets . 60 | 61 | kkr1venue < kkr1 62 | kkr1venue : venue|where|place . 63 | kkr1venue = Chepauk . 64 | 65 | kkr1date < kkr1 66 | kkr1date : when|date|month|day . 67 | kkr1date = 9th April, 2019 . 68 | 69 | kkr2motm < kkr2 70 | kkr2motm : man of the match motm . 71 | kkr2motm = Imran Tahir . 72 | 73 | kkr2fi < kkr2 74 | kkr2fi : score|hit|scoreboard|runs|wickets . 75 | kkr2fi = KKR - 161/8 (Lynn 82, Tahir 4/27) and CSK - 162/5 (Raina 58*, Narine 2/19) . 76 | 77 | kkr2result < kkr2 78 | kkr2result : won|result|lost|happened|vs of the . 79 | kkr2result = CSK won the match by 5 wickets . 80 | 81 | kkr2venue < kkr2 82 | kkr2venue : venue|where|place . 83 | kkr2venue = Eden Gardens . 84 | 85 | kkr2date < kkr2 86 | kkr2date : when|date|month|day . 87 | kkr2date = 14th April, 2019 . 88 | 89 | rcbmotm < rcb1 90 | rcbmotm : man of the match motm . 91 | rcbmotm = Harbhajan Singh . 92 | 93 | rcb1fi < rcb1 94 | rcb1fi : score|hit|scoreboard|runs|wickets . 95 | rcb1fi = RCB - 70 (Parthiv 29, Tahir 3/9) and CSK - 71/3 (Rayudu 28, Siraj 1/5) . 96 | 97 | rcb1result < rcb1 98 | rcb1result : won|result|lost|happened|vs of the . 99 | rcb1result = CSK won the match by 7 wickets . 100 | 101 | rcb1venue < rcb1 102 | rcb1venue : venue|where|place . 103 | rcb1venue = Chepauk . 104 | 105 | rcb1date < rcb1 106 | rcb1date : when|date|month|day . 107 | rcb1date = 23rd March, 2019 . 108 | 109 | rcb2motm < rcb2 110 | rcb2motm : man of the match motm . 111 | rcb2motm = Parthiv Patel . 112 | 113 | rcb2fi < rcb2 114 | rcb2fi : score|hit|scoreboard|runs|wickets . 115 | rcb2fi = RCB - 161/7 (Parthiv 53, Chahar 2/25) and CSK - 160/8 (Dhoni 84*, Steyn 2/24) . 116 | 117 | rcb2result < rcb2 118 | rcb2result : won|result|lost|happened|vs of the . 119 | rcb2result = RCB won the match by 1 run . 120 | 121 | rcb2venue < rcb2 122 | rcb2venue : venue|where|place . 123 | rcb2venue = Bangalore . 124 | 125 | rcb2date < rcb2 126 | rcb2date : when|date|month|day . 127 | rcb2date = 21st April, 2019 . 128 | 129 | srh1motm < srh1 130 | srh1motm : man of the match motm . 131 | srh1motm = David Warner . 132 | 133 | srh1fi < srh1 134 | srh1fi : score|hit|scoreboard|runs|wickets . 135 | srh1fi = CSK - 132/5 (Plessis 45, Rashid 2/17) and SRH - 137/4 (Warner 50, Tahir 2/20) . 136 | 137 | srh1date < srh1 138 | srh1date : when|date|month|day . 139 | srh1date = 17th April, 2019 . 140 | 141 | srh1result < srh1 142 | srh1result : won|result|lost|happened|vs of the . 143 | srh1result = SRH won the match by 7 wickets . 144 | 145 | srh1venue < srh1 146 | srh1venue : venue|where|place . 147 | srh1venue = Hyderabad . 148 | 149 | srh2motm < srh2 150 | srh2motm : man of the match motm . 151 | srh2motm = Shane Watson . 152 | 153 | srh2fi < srh2 154 | srh2fi : score|hit|scoreboard|runs|wickets . 155 | srh2fi = SRH - 175/3 (Pandey 83*, Bhajji 2/39) and CSK - 176/4 (Watson 96, Bhuvi 1/18) . 156 | 157 | srh2date < srh2 158 | srh2date : when|date|month|day . 159 | srh2date = 23rd April, 2019 . 160 | 161 | srh2result < srh2 162 | srh2result : won|result|lost|happened|vs of the . 163 | srh2result = CSK won the match by 6 wickets . 164 | 165 | srh2venue < srh2 166 | srh2venue : venue|where|place . 167 | srh2venue = Chepauk . 168 | 169 | dcmotm < dc1 170 | dcmotm : man of the match motm . 171 | dcmotm = Shane Watson . 172 | 173 | dc1fi < dc1 174 | dc1fi : score|hit|scoreboard|runs|wickets . 175 | dc1fi = DC - 147/6 (Dhawan 51, Bravo 3/33) and CSK - 150/4 (Watson 44, Mishra 2/35) . 176 | 177 | dc1result < dc1 178 | dc1result : won|result|lost|happened|vs of the . 179 | dc1result = CSK won the match by 6 wickets . 180 | 181 | dc1venue < dc1 182 | dc1venue : venue|where|place . 183 | dc1venue = New Delhi . 184 | 185 | dc1date < dc1 186 | dc1date : when|date|month|day . 187 | dc1date = 26th March, 2019 . 188 | 189 | dc2motm < dc2 190 | dc2motm : man of the match motm . 191 | dc2motm = MS Dhoni . 192 | 193 | dc2fi < dc2 194 | dc2fi : score|hit|scoreboard|runs|wickets . 195 | dc2fi = CSK - 179/4 (Raina 59, Suchith 2/28) and DC - 99 (Iyer 44, Tahir 4/12) . 196 | 197 | dc2result < dc2 198 | dc2result : won|result|lost|happened|vs of the . 199 | dc2result = CSK won the match by 80 runs . 200 | 201 | dc2venue < dc2 202 | dc2venue : venue|where|place . 203 | dc2venue = Chepauk . 204 | 205 | dc2date < dc2 206 | dc2date : when|date|month|day . 207 | dc2date = 1st May, 2019 . 208 | 209 | rr1motm < rr1 210 | rr1motm : man of the match motm . 211 | rr1motm = MS Dhoni . 212 | 213 | rr1fi < rr1 214 | rr1fi : score|hit|scoreboard|runs|wickets . 215 | rr1fi = CSK - 175/5 (Dhoni 75*, Archer 2/17) and RR - 167/8 (Stokes 46, Chahar 2/19) . 216 | 217 | rr1result < rr1 218 | rr1result : won|result|lost|happened|vs of the . 219 | rr1result = CSK won the match by 8 runs . 220 | 221 | rr1venue < rr1 222 | rr1venue : venue|where|place . 223 | rr1venue = Chepauk . 224 | 225 | rr1date < rr1 226 | rr1date : when|date|month|day . 227 | rr1date = 31st March, 2019 . 228 | 229 | rr2motm < rr2 230 | rr2motm : man of the match motm . 231 | rr2motm = MS Dhoni . 232 | 233 | rr2fi < rr2 234 | rr2fi : score|hit|scoreboard|runs|wickets . 235 | rr2fi = RR - 151/7 (Stokes 28, Jadeja 2/20) and CSK - 155/6 (Dhoni 58, Stokes 2/39) . 236 | 237 | rr2result < rr2 238 | rr2result : won|result|lost|happened|vs of the . 239 | rr2result = CSK won the match by 4 wickets . 240 | 241 | rr2venue < rr2 242 | rr2venue : venue|where|place . 243 | rr2venue = Jaipur . 244 | 245 | rr2date < rr2 246 | rr2date : when|date|month|day . 247 | rr2date = 11th April, 2019 . 248 | 249 | kxip1motm < kxip1 250 | kxip1motm : man of the match motm . 251 | kxip1motm = Harbhajan Singh . 252 | 253 | kxip1fi < kxip1 254 | kxip1fi : score|hit|scoreboard|runs|wickets . 255 | kxip1fi = CSK - 160/3 (du Plessis 54, Ashwin 3/23) and KXIP - 138/5 (S Khan 67, Bhajji 2/17) . 256 | 257 | kxip1date < kxip1 258 | kxip1date : when|date|month|day . 259 | kxip1date = 6th April, 2019 . 260 | 261 | kxip1result < kxip1 262 | kxip1result : won|result|lost|happened|vs of the . 263 | kxip1result = CSK won by 22 runs . 264 | 265 | kxip1venue < kxip1 266 | kxip1venue : venue|where|place . 267 | kxip1venue = Chepauk . 268 | 269 | kxip2motm < kxip2 270 | kxip2motm : man of the match motm . 271 | kxip2motm = KL Rahul . 272 | 273 | kxip2fi < kxip2 274 | kxip2fi : score|hit|scoreboard|runs|wickets . 275 | kxip2fi = CSK - 170/5 (du Plessis 96, Curran 3/35) and KXIP - 173/4 (KL Rahul 71, Bhajji 3/57) . 276 | 277 | kxip2date < kxip2 278 | kxip2date : when|date|month|day . 279 | kxip2date = 5th May, 2019 . 280 | 281 | kxip2result < kxip2 282 | kxip2result : won|result|lost|happened|vs of the . 283 | kxip2result = KXIP won by 6 wickets . 284 | 285 | kxip2venue < kxip2 286 | kxip2venue : venue|where|place . 287 | kxip2venue = Mohali . 288 | 289 | mi1motm < mi1 290 | mi1motm : man of the match motm . 291 | mi1motm = Hardik Pandya . 292 | 293 | mi1fi < mi1 294 | mi1fi : score|hit|scoreboard|runs|wickets . 295 | mi1fi = MI - 170/5 (Yadav 59, Jadeja 1/10) and CSK - 133/8 (Jadhav 58, Pandya 3/20) . 296 | 297 | mi1date < mi1 298 | mi1date : when|date|month|day . 299 | mi1date = 3rd April, 2019 . 300 | 301 | mi1result < mi1 302 | mi1result : won|result|lost|happened|vs of the . 303 | mi1result = MI won by 37 runs . 304 | 305 | mi1venue < mi1 306 | mi1venue : venue|where|place . 307 | mi1venue = Mumbai . 308 | 309 | mi2motm < mi2 310 | mi2motm : man of the match motm . 311 | mi2motm = Rohit Sharma . 312 | 313 | mi2fi < mi2 314 | mi2fi : score|hit|scoreboard|runs|wickets . 315 | mi2fi = MI - 155/4 (Sharma 67, Santner 2/13) and CSK - 109 (Vijay 38, Malinga 4/37) . 316 | 317 | mi2date < mi2 318 | mi2date : when|date|month|day . 319 | mi2date = 26th April, 2019 . 320 | 321 | mi2result < mi2 322 | mi2result : won|result|lost|happened|vs of the . 323 | mi2result = MI won by 46 runs . 324 | 325 | mi2venue < mi2 326 | mi2venue : venue|where|place . 327 | mi2venue = Chepauk . 328 | 329 | q1motm < q1 330 | q1motm : man of the match motm . 331 | q1motm = Suryakumar Yadav . 332 | 333 | q1fi < q1 334 | q1fi : score|hit|scoreboard|runs|wickets . 335 | q1fi = CSK - 131/4 (Rayudu 42*, Chahar 2/14) and MI - 132/4 (Yadav 71*, Tahir 2/33) . 336 | 337 | q1result < q1 338 | q1result : won|result|lost|happened|vs of the . 339 | q1result = MI won by 6 wickets . 340 | 341 | q1venue < q1 342 | q1venue : venue|where|place . 343 | q1venue = Chepauk . 344 | 345 | q1date < q1 346 | q1date : when|date|month|day . 347 | q1date = 7th April, 2019 . 348 | 349 | q2motm < q2 350 | q2motm : man of the match motm . 351 | q2motm = Faf du Plessis . 352 | 353 | q2fi < q2 354 | q2fi : score|hit|scoreboard|runs|wickets . 355 | q2fi = DC - 147/9 (Pant 38, Bravo 2/19) and CSK - 151/4 (Watson 50, Boult 1/20) . 356 | 357 | q2result < q2 358 | q2result : won|result|lost|happened|vs of the . 359 | q2result = CSK won by 6 wickets . 360 | 361 | q2venue < q2 362 | q2venue : venue|where|place . 363 | q2venue = Vishakapatnam . 364 | 365 | q2date < q2 366 | q2date : when|date|month|day . 367 | q2date = 10th April, 2019 . 368 | 369 | finalmotm < final 370 | finalmotm : man of the match motm . 371 | finalmotm = Jasprit Bumrah . 372 | 373 | finfi < final 374 | finfi : score|hit|scoreboard|runs|wickets . 375 | finfi = MI - 149/8 (Pollard 41, Chahar 3/26) and CSK - 148/7 (Watson 80, Bumrah 2/14) . 376 | 377 | finalresult < final 378 | finalresult : won|result|lost|happened|vs of the . 379 | finalresult = MI won by 1 run and lifted the trophy for the 4th time . 380 | 381 | finalvenue < final 382 | finalvenue : venue|where|place . 383 | finalvenue = Hyderabad . 384 | 385 | finaldate < final 386 | finaldate : when|date|month|day . 387 | finaldate = 12th May, 2019 . 388 | 389 | owner < team 390 | owner : owner srini mama . 391 | owner = N Srinivasan . 392 | 393 | captain < team 394 | captain : captain thala mahi . 395 | captain = Mahendra Singh Dhoni . 396 | 397 | vice < team 398 | vice : vice captain|thala chinna . 399 | vice = Suresh Raina . 400 | 401 | coach < team 402 | coach : coach . 403 | coach = Stephen Fleming . 404 | 405 | battingcoach < team 406 | battingcoach : batting|bat coach . 407 | battingcoach = Mike Hussey . 408 | 409 | bowlingcoach < team 410 | bowlingcoach : bowling|bowl coach . 411 | bowlingcoach = L Balaji . 412 | 413 | squad < team 414 | squad : squad|team|players all|full|list . 415 | squad = Poda dei, refer the internet . 416 | 417 | overseas < team 418 | overseas : overseas|foreign|non players|squad|team . 419 | overseas : Plessis, Tahir, Watson and Bravo . 420 | 421 | ground < team 422 | ground : ground|home|chepauk|chidamabaram . 423 | ground = CSK's home ground is the MAC Stadium (Chepauk) . 424 | 425 | company < team 426 | company : company|partner|sponsor|sponsors owns|own|main . 427 | company = India Cements . 428 | 429 | techpartner < team 430 | techpartner : tech company|partner|sponsor|sponsors . 431 | techpartner = Tekplay . 432 | 433 | drinksptr < team 434 | drinksptr : company|partner|sponsor|sponsors drinks|drink . 435 | drinksptr = Frooti . 436 | 437 | highestruns < stats 438 | highestruns : highest|most runs|run|average scored|scorer|score . 439 | highestruns = MS Dhoni (416 runs) at an average of 42.20 . 440 | 441 | mostwickets < stats 442 | mostwickets : highest|most|leading wickets|wicket taken|took purple . 443 | mostwickets = Imran Tahir (26 wickets) . 444 | 445 | help = Not to worry. You can ask questions relating to information on CSK matches, dates, results, man of the matches and even team information like coaches, the captain, sponsors, etc . 446 | --------------------------------------------------------------------------------