src/English/names/en_NameRecognizer.cpp
// look for tokens (specified by a list) directly before or after a 
// name of a specified entity type. If those tokens are found, 
// extend the name over those tokens.

look for tokens (specified by a list) directly before or after a
name of a specified entity type. If those tokens are found,
extend the name over those tokens.
look for tokens ( specified by a list ) directly before or after a name of a specified entity type . If those tokens are found extend the name over those tokens .
void EnglishNameRecognizer::subsumeTokensInNames(PIdFSentence &sentence, vector<SymbolVector> &subsumptionWords, EntityType entType) {
	Symbol entTypeSym = entType.getName();
	wstring entStr1 = entTypeSym.to_string();
	wstring entStr2 = entTypeSym.to_string();
	wstring entCOStr = entStr1.append(L"-CO");
	wstring entSTStr = entStr2.append(L"-ST");
	Symbol entCO = Symbol(entCOStr);
	Symbol entST = Symbol(entSTStr);
	for (int i = 0; i < sentence.getLength(); i++) {
		int tag = sentence.getTag(i);
		if (_tagSet->isSTTag(tag) && _tagSet->getReducedTagSymbol(tag) == entTypeSym) {
			int count = countSubsumptionWordsReverse(sentence, subsumptionWords, i - 1);
			if (count > 0) {
				sentence.setTag(i, _tagSet->getTagIndex(entCO));
				int j;
				for (j = i - 1; j > i - count; j--) 
					sentence.setTag(j, _tagSet->getTagIndex(entCO));
				sentence.setTag(j, _tagSet->getTagIndex(entST));
			}
		}
	}
	bool ent_name_previous = false;
	for (int i = 0; i < sentence.getLength(); i++) {
		int tag = sentence.getTag(i);
		if (_tagSet->isSTTag(tag) && ent_name_previous) {
			int count = countSubsumptionWordsForward(sentence, subsumptionWords, i);
			if (count > 0) {
				int j;
				for (j = i; j < i + count; j++)
					sentence.setTag(j, _tagSet->getTagIndex(entCO));
				if (j < sentence.getLength() &&_tagSet->getReducedTagSymbol(sentence.getTag(j)) != entTypeSym)
					sentence.changeToStartTag(j);
			}
		}
		if (_tagSet->getReducedTagSymbol(tag) == entTypeSym) 
			ent_name_previous = true;
		else
			ent_name_previous = false;
	}
}
void EnglishNameRecognizer :: subsumeTokensInNames ( PIdFSentence & sentence , vector < SymbolVector > & subsumptionWords , EntityType entType ) { Symbol entTypeSym = entType . getName ( ) ; wstring entStr1 = entTypeSym . to_string ( ) ; wstring entStr2 = entTypeSym . to_string ( ) ; wstring entCOStr = entStr1 . append ( L" " ) ; wstring entSTStr = entStr2 . append ( L" " ) ; Symbol entCO = Symbol ( entCOStr ) ; Symbol entST = Symbol ( entSTStr ) ; for ( int i = 0 ; i < sentence . getLength ( ) ; i ++ ) { int tag = sentence . getTag ( i ) ; if ( _tagSet -> isSTTag ( tag ) && _tagSet -> getReducedTagSymbol ( tag ) == entTypeSym ) { int count = countSubsumptionWordsReverse ( sentence , subsumptionWords , i - 1 ) ; if ( count > 0 ) { sentence . setTag ( i , _tagSet -> getTagIndex ( entCO ) ) ; int j ; for ( j = i - 1 ; j > i - count ; j -- ) sentence . setTag ( j , _tagSet -> getTagIndex ( entCO ) ) ; sentence . setTag ( j , _tagSet -> getTagIndex ( entST ) ) ; } } } bool ent_name_previous = false ; for ( int i = 0 ; i < sentence . getLength ( ) ; i ++ ) { int tag = sentence . getTag ( i ) ; if ( _tagSet -> isSTTag ( tag ) && ent_name_previous ) { int count = countSubsumptionWordsForward ( sentence , subsumptionWords , i ) ; if ( count > 0 ) { int j ; for ( j = i ; j < i + count ; j ++ ) sentence . setTag ( j , _tagSet -> getTagIndex ( entCO ) ) ; if ( j < sentence . getLength ( ) && _tagSet -> getReducedTagSymbol ( sentence . getTag ( j ) ) != entTypeSym ) sentence . changeToStartTag ( j ) ; } } if ( _tagSet -> getReducedTagSymbol ( tag ) == entTypeSym ) ent_name_previous = true ; else ent_name_previous = false ; } }
look for tokens (specified by a list) directly before or after a
name of a specified entity type.
look for tokens ( specified by a list ) directly before or after a name of a specified entity type .
// look for start of name
 // look for end of name
