src/Chinese/descriptors/ch_CompoundMentionFinder.cpp
// NOTE: mentions can be modified here. It's one of the only places in this class!

mentions can be modified here. It's one of the only places in this class!
mentions can be modified here . It ' s one of the only places in this class!
void ChineseCompoundMentionFinder::coerceAppositiveMemberMentions(Mention** mentions)
{
    if (_use_correct_answers) {
		if (mentions[1]->mentionType == Mention::NAME && mentions[0]->mentionType == Mention::DESC) {
			mentions[0]->setEntityType(mentions[1]->getEntityType());
			mentions[0]->setEntitySubtype(mentions[1]->getEntitySubtype());
		}
		return;
	}
	if (mentions[0]->getEntityType() == mentions[1]->getEntityType())
		return;
	if (mentions[1]->mentionType == Mention::NAME && mentions[0]->mentionType == Mention::DESC) {
		int numTypes = 0;
		const Symbol* types = _descWordMap->lookup(mentions[0]->node->getHeadWord(), numTypes);
		for (int i = 0; i < numTypes; i++) {
			if (types[i] == mentions[1]->getEntityType().getName()) {
				mentions[0]->setEntityType(mentions[1]->getEntityType());
				mentions[0]->setEntitySubtype(mentions[1]->getEntitySubtype());
				return;
			}
		}
	}
}
void ChineseCompoundMentionFinder :: coerceAppositiveMemberMentions ( Mention * * mentions ) { if ( _use_correct_answers ) { if ( mentions [ 1 ] -> mentionType == Mention :: NAME && mentions [ 0 ] -> mentionType == Mention :: DESC ) { mentions [ 0 ] -> setEntityType ( mentions [ 1 ] -> getEntityType ( ) ) ; mentions [ 0 ] -> setEntitySubtype ( mentions [ 1 ] -> getEntitySubtype ( ) ) ; } return ; } if ( mentions [ 0 ] -> getEntityType ( ) == mentions [ 1 ] -> getEntityType ( ) ) return ; if ( mentions [ 1 ] -> mentionType == Mention :: NAME && mentions [ 0 ] -> mentionType == Mention :: DESC ) { int numTypes = 0 ; const Symbol * types = _descWordMap -> lookup ( mentions [ 0 ] -> node -> getHeadWord ( ) , numTypes ) ; for ( int i = 0 ; i < numTypes ; i ++ ) { if ( types [ i ] == mentions [ 1 ] -> getEntityType ( ) . getName ( ) ) { mentions [ 0 ] -> setEntityType ( mentions [ 1 ] -> getEntityType ( ) ) ; mentions [ 0 ] -> setEntitySubtype ( mentions [ 1 ] -> getEntitySubtype ( ) ) ; return ; } } } }
NOTE: mentions can be modified here.
NOTE : mentions can be modified here .
// if we have a desc-name pair,
 // if the type of the name is valid for the head of the desc, coerce
 // else nothing to do
