updateTipTap = function(editor, paragraphIndex, targetTextStr){
let textTemplate = Object({
type: "text",
text: ""
})
let textTemplateBold = Object({
type: "text",
text: "",
marks: [{"type": "bold"}]
})
let delay = 200;
let totalTextObject = editor.getJSON()
let currentTextStr = totalTextObject.content[paragraphIndex].content.map(obj => obj.text).join("");
let nwResult = nw(currentTextStr, targetTextStr, mispen, gappen, skwpen)
let tmpTextObjArray = nwResult.aout.map(word => {
const textObj = { ...textTemplate };
textObj.text = word;
return textObj;
});
updateEditor(editor, tmpTextObjArray, paragraphIndex)
let i = 0;
const iterations = nwResult.summary.length;
loopIteration(i, iterations);
return totalTextObject
}