Writing a text parser (like those used in Interactive Fiction / gaming engines like Inform / TADS / ADRIFT) is not a simple thing, especially if you want it to understand more natural language like statements like “I am from xxx”
If you are considering making a Text Parser based project then I suggest looking at the engines that come with such functionality built-in. You may also be interested in reading the Progress of the Parser thread on this forum.