* @return the eDB unit
*/
public EDBUnit convertOperation( EDBUnit sNode, EDBUnit dNode, String X ){
String strCurrent = sNode.getData();
//System.out.println( strCurrent );
EDBUnit cExcept = null;
EDBUnit c0 = null;
EDBUnit c1 = null;
//iteration
int i = 0;
EDBUnit ISA = sNode.getRel("ISA");
//ISA.print("sNode ");
if( ISA != null )
for( String str1 : ISA.getMap().keySet() ){
EDBUnit child = ISA.map.get(str1);
if( i == 0 )
c0 = child;
else
c1 = child;
i++;
}
//for nodes
//System.out.println( strCurrent );
String str = getComplementaryOperater(strCurrent);
//System.out.println( str );
if( str != null ){
dNode = dNode.createParent(str);
if( !hasTreeNode(c0, X) ){
copyTreeToETree(dNode, c0);
cExcept = c0;
}else
if( !hasTreeNode(c1, X) ){
copyTreeToETree(dNode, c1);
cExcept = c1;
}
//dNode.print("dNode ");
}else{
return dNode;
}
//iteration
i = 0;
ISA = sNode.getRel("ISA");
if( ISA != null )
for( String str1 : ISA.getMap().keySet() ){
EDBUnit child = ISA.map.get(str1);
//child.print("Child ");
//cExcept.print("cExcept ");
//if( !cExcept.getData().equalsIgnoreCase(child.getData()) ){
if( !cExcept.isSameData(child) ){
EDBUnit r = convertOperation( child, dNode, X );
if( r != null )
return r;
}
}