src/Chinese/descriptors/ch_DescClassModifiers.cpp
//For Training add the PreModifiers  of the current node

For Training add the PreModifiers  of the current node
For Training add the PreModifiers of the current node
void ChineseDescClassModifiers::addModifers(const SynNode *node, Symbol type){
	Symbol premodArr[3];
	Symbol premodBackArr[2];
	premodArr[0] = premodBackArr[0] = type;
	int headIndex = node->getHeadIndex();
	Symbol termToHead[100];
	int termSize = node->getTerminalSymbols(termToHead, 100);
	premodArr[1] = node->getHeadWord();
	for (int j = 0; j < termSize; j++) {
		if(termToHead[j]==premodArr[1])
			break;
		premodArr[2] = premodBackArr[1] = termToHead[j];
		_modWriter->registerTransition(premodArr);
		_modBackoffWriter->registerTransition(premodBackArr);
	}
}
void ChineseDescClassModifiers :: addModifers ( const SynNode * node , Symbol type ) { Symbol premodArr [ 3 ] ; Symbol premodBackArr [ 2 ] ; premodArr [ 0 ] = premodBackArr [ 0 ] = type ; int headIndex = node -> getHeadIndex ( ) ; Symbol termToHead [ 100 ] ; int termSize = node -> getTerminalSymbols ( termToHead , 100 ) ; premodArr [ 1 ] = node -> getHeadWord ( ) ; for ( int j = 0 ; j < termSize ; j ++ ) { if ( termToHead [ j ] == premodArr [ 1 ] ) break ; premodArr [ 2 ] = premodBackArr [ 1 ] = termToHead [ j ] ; _modWriter -> registerTransition ( premodArr ) ; _modBackoffWriter -> registerTransition ( premodBackArr ) ; } }
For Training add the PreModifiers  of the current node
For Training add the PreModifiers of the current node