#include "PostDecode.h" #include "ExtractRule.h" void PrintSingleTree_PD(DataItem &item, RSTNode *node) { // if(node->relationValue != -1){cout<<" ("<relationValue<<" "<Begin<<'-'<Back<<' ';} // else if(node->nucleiValue != -1){cout<<" ("<nucleiValue<<":"<keyWord<<": "<Begin<<'-'<Back<<' ';} if(node->relationValue != -1){cout<<"RELVALUE: "<relationValue<nucleiValue != -1){cout<<"NUCLEIVALUE: "<nucleiValue<<'\n'<<"KEYWORD: "<keyWord<<"\n";} if(node->leftChild ==NULL) { cout<Begin<<" "<Back<<" ||| "<Begin,node->Back)<Begin < node->leftChild->Begin) cout<Begin<<" "<Back-1<<" ||| "<Begin,node->leftChild->Begin-1)<leftChild); } if(node->rightChild!=NULL) { PrintSingleTree_PD(item,node->rightChild); if(node->Back > node->rightChild->Back) cout<rightChild->Back+1<<" "<Back<<" ||| "<rightChild->Back+1,node->Back)<<'\n'; } else { if(node->Back>node->leftChild->Back) {cout<leftChild->Back+1<<" "<Back<<" ||| "<leftChild->Back+1,node->Back)<<'\n';return;} } //cout<<"#)"; } void PrintSingleTree_PD3(DataItem &item, RSTNode *node,string &posId) { string tmpId; // if(node->relationValue != -1){cout<<" ("<relationValue<<" "<Begin<<'-'<Back<<' ';} // else if(node->nucleiValue != -1){cout<<" ("<nucleiValue<<":"<keyWord<<": "<Begin<<'-'<Back<<' ';} // if(node->relationValue != -1){cout<<"RELVALUE: "<relationValue<nucleiValue != -1){cout<<"NUCLEIVALUE: "<nucleiValue<<'\n'<<"KEYWORD: "<keyWord<<"\n";} if(node->relationValue != -1) { string lS("NULL"),rS("NULL"); if(node->leftChild != NULL)lS=node->leftChild->keyWord; if(node->rightChild !=NULL)rS=node->rightChild->keyWord; cout <leftChild ==NULL) { cout< ||| "<Begin<<" "<Back<<" ||| "<Begin,node->Back)<Begin < node->leftChild->Begin) cout< ||| "<Begin<<" "<Back-1<<" ||| "<Begin,node->leftChild->Begin-1)<leftChild,tmpId); } if(node->rightChild!=NULL) { tmpId = posId+" 1"; PrintSingleTree_PD3(item,node->rightChild,tmpId); if(node->Back > node->rightChild->Back) cout< ||| "<rightChild->Back+1<<" "<Back<<" ||| "<rightChild->Back+1,node->Back)<<'\n'; } else { if(node->Back>node->leftChild->Back) {cout< ||| "<leftChild->Back+1<<" "<Back<<" ||| "<leftChild->Back+1,node->Back)<<'\n';return;} } //cout<<"#)"; } void PostDecodeClass::PrintFlatRSTTree_1(DataItem &item, vector& nodeVec) { using namespace boost; int pos(0); string posId="0"; for(size_t i(0);i pos){cout< ||| ";cout<(i); PrintSingleTree_PD3(item,&nodeVec[i],tmpId); //cout<<" "; } // cout<<" "; if(pos ||| "<