src/Arabic/edt/ar_DescLinkFeatureFunctions.cpp
//Arabic is usually head initial, but numbers proceed the words they modify

Arabic is usually head initial, but numbers proceed the words they modify
Arabic is usually head initial but numbers proceed the words they modify
const SynNode* ArabicDescLinkFeatureFunctions::getNumericMod(const Mention *ment) {
	const SynNode *node = ment->getNode();
	if (node->isPreterminal())
		return 0;
	for (int i = 0; i < node->getHeadIndex(); i++) {
		const SynNode *child = node->getChild(i);
		const SynNode *term = child->getFirstTerminal();
		for (int j = 0; j < child->getNTerminals(); j++) {
			const SynNode *parent = term->getParent();
			if (parent != 0 && (parent->getTag() == ArabicSTags::CD ||
				parent->getTag() == ArabicSTags::NUMERIC_COMMA))
				return parent;
			if (j < child->getNTerminals() - 1)
				term = term->getNextTerminal();
		}
	}
	return 0;
}
const SynNode * ArabicDescLinkFeatureFunctions :: getNumericMod ( const Mention * ment ) { const SynNode * node = ment -> getNode ( ) ; if ( node -> isPreterminal ( ) ) return 0 ; for ( int i = 0 ; i < node -> getHeadIndex ( ) ; i ++ ) { const SynNode * child = node -> getChild ( i ) ; const SynNode * term = child -> getFirstTerminal ( ) ; for ( int j = 0 ; j < child -> getNTerminals ( ) ; j ++ ) { const SynNode * parent = term -> getParent ( ) ; if ( parent != 0 && ( parent -> getTag ( ) == ArabicSTags :: CD || parent -> getTag ( ) == ArabicSTags :: NUMERIC_COMMA ) ) return parent ; if ( j < child -> getNTerminals ( ) - 1 ) term = term -> getNextTerminal ( ) ; } } return 0 ; }
Arabic is usually head initial, but numbers proceed the words they modify
Arabic is usually head initial but numbers proceed the words they modify
// if the node is preterminal, it won't have any numeric premods
