Hi we have a document which contains grammar corrections and sentence corrections
we have run information along with actual paragraph - stored in form of dictionary, which contains complete paragraph as ‘text’ and style(font name, font size, font color, bold, italic, underline, font background, font shading, superscript, subscript, hyperlink) for each run for paragraph
Corrected text - we have corrected string/paragraph with words inserted/deleted, which changes the length of the actual text
now based on the corrected text, we want to paste the corrected text back to its original place with all styles intact
we have run information along with actual paragraph - stored in form of dictionary, which contains complete paragraph as ‘text’ and style(font name, font size, font color, bold, italic, underline, font background, font shading, superscript, subscript, hyperlink) for each run for paragraph
Corrected text - we have corrected string/paragraph with words inserted/deleted, which changes the length of the actual text
now based on the corrected text, we want to paste the corrected text back to its original place with all styles intact
[{'type': 'paragraph',
'para_id': 1,
'text': 'The Bankruptcy procedure applies to all companies are that have their docile or placeof buiness in Somecountry.',
'runs': [{'text': 'The Bankruptcy procedure applies to all ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'companies ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'are that ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': (255, 255, 0),
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'have',
'bold': True,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': (255, 255, 0),
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': ' their ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': (255, 255, 0),
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'docile',
'bold': True,
'italic': True,
'underline': '1',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': (255, 255, 0),
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': ' or ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': (255, 255, 0),
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'place',
'bold': True,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': (112, 48, 160),
'highlight_color': (255, 255, 0),
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'of ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'buiness',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': ' in ',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': 'Somecountry',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None},
{'text': '.',
'bold': False,
'italic': False,
'underline': '0',
'font_name': 'Calibri',
'font_size': 11.0,
'color': None,
'highlight_color': None,
'shading_color': None,
'all_caps': False,
'strike_through': False,
'superscript': False,
'subscript': False,
'hyperlink': False,
'hyperlink_url': None} ]
corrected sentence is as follows
“The bankruptcy procedure applies to all companies that have their domicile or place of business in Somecountry.”
need somehelp in pasting back correct styles based on the dictionary created