I have made a CFG grammar and verifying my grammar using EarleyParser algorithm.
I wanted to ask how to allow a rule even if something is out of vocabulary from production rules. Let me give a rough example.
S1 START I had a burger END
START In the morning
START In the evening
START In the afternoon
END with a coke
END with a pepsi
END with a milk shake
Now what I want is if some word is not in the vocabulary of START
and END
even then it should be detected. My problem is such that it is not possible to add all the rules in the grammar.
If someone type like this, In the noon I had a burger with sprite. Now In the noon and with a sprite both does not exist in the CFG grammar. Is there any way that for this given input I can still get S1 pattern from EarleyParser.