@@ -0,0 +1,1309 @@
+#!/usr/bin/python%0D%0A# -*- coding: utf-8 -*-%0D%0A%0D%0A%22%22%22%0D%0ACreated by Lalitha Madhuri Putchala on Dec 10 2017%0D%0A%22%22%22%0D%0A%0D%0Aimport nltk%0D%0Afrom nltk import word_tokenize, pos_tag, ne_chunk%0D%0Afrom nltk.tokenize.punkt import PunktSentenceTokenizer%0D%0Afrom docx.enum.text import WD_COLOR_INDEX%0D%0A%0D%0A%0D%0Adef highlight_text(doc, word):%0D%0A    ''' %0D%0A        this function obtains the content of each paragraph and checks for the given word%0D%0A        if the given word matches it highlights with yellow%0D%0A    '''%0D%0A%0D%0A    for paragraph in doc.paragraphs:%0D%0A        if word in paragraph.text:%0D%0A            substrings = paragraph.text.split(word)%0D%0A            for substring in substrings%5B:-1%5D:%0D%0A                paragraph.text = substring%0D%0A                font = paragraph.add_run(word).font%0D%0A                font.highlight_color = WD_COLOR_INDEX.YELLOW%0D%0A            paragraph.add_run(substrings%5B-1%5D)%0D%0A%0D%0A%0D%0Adef get_sentence_tokens(text):%0D%0A    paragraphs = %5Bp for p in text.split('%5Cn') if p%5D%0D%0A    tokenizer = PunktSentenceTokenizer()%0D%0A    sentence_tokens = %5Btokenizer.tokenize(paragraph) for paragraph in%0D%0A                       paragraphs%5D%0D%0A    return sentence_tokens%0D%0A%0D%0A%0D%0Adef get_word_tokens(text):%0D%0A    return word_tokenize(text)%0D%0A%0D%0A%0D%0Adef get_pos_tags(text):%0D%0A    return nltk.pos_tag(text)%0D%0A%0D%0A%0D%0Adef get_ne_chunks(pos):%0D%0A    return ne_chunk(pos)%0D%0A%0D%0A

add utils file