src/Arabic/parse/ar_ChartDecoder.cpp
/* return a parse that is (FRAG w w w w) except for Names, which have NPPs
*/
return a parse that is (FRAG w w w w) except for Names, which have NPPs
return a parse that is ( FRAG w w w w ) except for Names which have NPPs
ParseNode* ArabicChartDecoder::_makeFlatParse(Symbol* sentence, int length,
    Constraint* _constraints, int _numConstraints){
		ParseNode* flat_parse = new ParseNode(ArabicSTags::FRAG);
		int word = 0;
		int curr_const =0;
		flat_parse->headNode = new ParseNode();
		ParseNode* currNode = flat_parse->headNode;
		ParseNode* lastNode;
		if(_numConstraints >0){
			if(_constraints[0].left==0){
				addNPPNode(currNode, _constraints[0], sentence);
				word = word+_constraints[0].right-_constraints[0].left+1;
				curr_const++;
			}
			else{
				addWordNode(currNode, sentence[word]);
				word++;
			}
		}
		else{
			addWordNode(currNode, sentence[word]);
			word++;
		}
		flat_parse->postmods = new ParseNode();
		currNode = flat_parse->postmods;
		while(word<length){
			if((curr_const < _numConstraints) && (_constraints[curr_const].left == word)){
				addNPPNode(currNode, _constraints[curr_const], sentence);
				word = word+_constraints[curr_const].right-_constraints[curr_const].left+1;
				curr_const++;
			}
			else{
				addWordNode(currNode, sentence[word]);
				word++;
			}
			currNode->next = new ParseNode();
			lastNode = currNode;
			currNode= currNode->next;
		}
		lastNode->next = NULL;
		delete currNode;
		highest_scoring_final_theory = 0;
		theory_scores[0] = .1f;
		return flat_parse;
	}
ParseNode * ArabicChartDecoder :: _makeFlatParse ( Symbol * sentence , int length , Constraint * _constraints , int _numConstraints ) { ParseNode * flat_parse = new ParseNode ( ArabicSTags :: FRAG ) ; int word = 0 ; int curr_const = 0 ; flat_parse -> headNode = new ParseNode ( ) ; ParseNode * currNode = flat_parse -> headNode ; ParseNode * lastNode ; if ( _numConstraints > 0 ) { if ( _constraints [ 0 ] . left == 0 ) { addNPPNode ( currNode , _constraints [ 0 ] , sentence ) ; word = word + _constraints [ 0 ] . right - _constraints [ 0 ] . left + 1 ; curr_const ++ ; } else { addWordNode ( currNode , sentence [ word ] ) ; word ++ ; } } else { addWordNode ( currNode , sentence [ word ] ) ; word ++ ; } flat_parse -> postmods = new ParseNode ( ) ; currNode = flat_parse -> postmods ; while ( word < length ) { if ( ( curr_const < _numConstraints ) && ( _constraints [ curr_const ] . left == word ) ) { addNPPNode ( currNode , _constraints [ curr_const ] , sentence ) ; word = word + _constraints [ curr_const ] . right - _constraints [ curr_const ] . left + 1 ; curr_const ++ ; } else { addWordNode ( currNode , sentence [ word ] ) ; word ++ ; } currNode -> next = new ParseNode ( ) ; lastNode = currNode ; currNode = currNode -> next ; } lastNode -> next = NULL ; delete currNode ; highest_scoring_final_theory = 0 ; theory_scores [ 0 ] = .1f ; return flat_parse ; }
return a parse that is (FRAG w w w w) except for Names, which have NPPs
return a parse that is ( FRAG w w w w ) except for Names which have NPPs
//add a NPP
 //ParseNode* currNode = flat_parse->postmods;
