var part_max_deep=10; var part_curr_deep=0; var part_word_array=null; function part_create_node(){ let newWord=new Object(); newWord.id=""; newWord.spell=""; newWord.real=""; newWord.type=""; newWord.gramma=""; newWord.case=""; newWord.mean=""; newWord.note=""; newWord.sparent=""; newWord.parent_id=""; newWord.part=""; newWord.partmean=""; newWord.bmc=0; newWord.bmt=""; newWord.lock=false; newWord.rela=""; newWord.parent_visible=true; newWord.child_visible=false; newWord.valid=true; newWord.firstChild=null; newWord.nextNode=null; newWord.setpart=_part_setpart; part_word_array.push(newWord); return(newWord); } function _part_setpart(value){ if(value==null){ return(this.part); } else{ if(this.part!=value){ let arrPart = value.split("+"); let newParts=new Array(); for(let x in arrPart){ let isExist=false; let nextNode=this.firstChild; while(nextNode) { if(arrPart[x]==nextNode.real){ newParts.push(nextNode.clone()); isExist=true; break; } nextNode = nextNode.nextNode; } if(isExist==false){ let newPart = part_create_node(); newPart.id=this.id+"-"+x; newPart.spell = arrPart[x]; newPart.real = arrPart[x]; newPart.sparent=this.real; newPart.parent_id=this.id; newParts.push(newPart); } } let nextNode=this.firstChild; while(nextNode) { nextNode.valid=false; nextNode = nextNode.nextNode; } this.firstChild = newParts[0]; for(let x =0 ; x