I am new to NLP. I am trying to search a corpus for Part-of-speech sequence. The goal would be to search for a sequence of POS tags and find all sentences that match sequence from a given corpus.
Input: The quick brown fox jumped over the lazy dogs. Tagger will process tag the sentence: POS tagging results in: [DT][JJ][JJ][NN][VBD][IN][DT][JJ][NNS][.] Apply search will result in any sentence that matches this sequence or longer.
How do I search by Part-of-Speech? Is there a direct function in NLTK or spacy?
I would appreciate some guidance on the steps needed to solve the problem and the challenges that I might face.
Note that I found someone who posted a similar question on stackoverflow, but I think the problem he was facing was more specific. Search POS