from nltk.tag import RegexpTagger
from nltk.corpus import treebank
patterns = [(r'ketoconazole','DB1026'),(r'extina','DB01026'),
(r'fungarest','DB01026'),(R'misoldipine','DB00401'),
(r'bayaycard','DB00401'),(r'misocor','DB00401')]
tagger = RegexpTagger(patterns)
input_text = '''there is a boy in minisoda who has some ketoconazole with coke in regular bases , fungarest is the only drug fit for curing his disese , although misoldiine has proven to be a sucessful alternative for Markovs disease .
bayaycard on the other hand is a discovery of Dr Asidovada who also came up with misocor .
'''
prep = input_text.split()
op1 = tagger.tag(prep)
op1
Output:
[('there', None), ('is', None), ('a', None), ('boy', None), ('in', None), ('minisoda', None), ('who', None), ('has', None), ('some', None), ('ketoconazole', 'DB1026'), ('with', None), ('coke', None), ('in', None), ('regular', None), ('bases', None), (',', None), ('fungarest', 'DB01026'), ('is', None), ('the', None), ('only', None), ('drug', None), ('fit', None), ('for', None), ('curing', None), ('his', None), ('disese', None),..........