I need some logic to find a grammatical pattern like in a sentence:
[adjective]* [noun]+ [hyphen] [verb Past Participle | verb Present Participle | one of the special adjectives] [adjective]* [noun]+
where * means any number (0 or more), ? means 0 or 1, and + means 1 or more, | means or.
If i give any input sentence the logic has to search if it contains the above pattern or not.
I completely have no idea how to begin.
Please if anyone could suggest me with some logic.
This is pseudo code. It makes 2 passes on the input, in the first pass it converts each word in the input string to a letter which refers to its type, and on the second pass you match the result of the first pass with your regular expression.