src/English/names/en_NameRecognizer.cpp
// Any time you see one or two tokens surrounded by double parens, make it a person name

Any time you see one or two tokens surrounded by double parens, make it a person name
Any time you see one or two tokens surrounded by double parens make it a person name
void EnglishNameRecognizer::forceDoubleParenNames(PIdFSentence &sentence) {
	Symbol perSymbol = EntityType::getPERType().getName();
	wstring perStr = perSymbol.to_string();
	wstring perCOStr = perStr.append(L"-CO");
	Symbol perCO = Symbol(perCOStr);
	perStr = perSymbol.to_string();
	wstring perSTStr = perStr.append(L"-ST");
	Symbol perST = Symbol(perSTStr);
	for (int i = 0; i < sentence.getLength() - 2; i++) {
		if (WordConstants::isOpenDoubleBracket(sentence.getWord(i)) && 
			WordConstants::isClosedDoubleBracket(sentence.getWord(i + 2)) && 
			isForceableToPerson(sentence, i + 1, i + 1)) 
		{
			if (sentence.getTag(i + 1) != _tagSet->getTagIndex(perCO)) {
				sentence.setTag(i + 1, _tagSet->getTagIndex(perST));
			}
			if (sentence.getTag(i + 2) != _tagSet->getTagIndex(perCO)) {
				sentence.changeToStartTag(i + 2);
			}
		}
		if (i + 3 < sentence.getLength() && 
			WordConstants::isOpenDoubleBracket(sentence.getWord(i)) && 
			WordConstants::isClosedDoubleBracket(sentence.getWord(i + 3)) && 
			isForceableToPerson(sentence, i + 1, i + 2)) 
		{
			if (sentence.getTag(i + 1) != _tagSet->getTagIndex(perCO)) {
				sentence.setTag(i + 1, _tagSet->getTagIndex(perST));
			}
			sentence.setTag(i + 2, _tagSet->getTagIndex(perCO));
			if (sentence.getTag(i + 3) != _tagSet->getTagIndex(perCO)) {
				sentence.changeToStartTag(i + 3);
			}
		}
	}
}
void EnglishNameRecognizer :: forceDoubleParenNames ( PIdFSentence & sentence ) { Symbol perSymbol = EntityType :: getPERType ( ) . getName ( ) ; wstring perStr = perSymbol . to_string ( ) ; wstring perCOStr = perStr . append ( L" " ) ; Symbol perCO = Symbol ( perCOStr ) ; perStr = perSymbol . to_string ( ) ; wstring perSTStr = perStr . append ( L" " ) ; Symbol perST = Symbol ( perSTStr ) ; for ( int i = 0 ; i < sentence . getLength ( ) - 2 ; i ++ ) { if ( WordConstants :: isOpenDoubleBracket ( sentence . getWord ( i ) ) && WordConstants :: isClosedDoubleBracket ( sentence . getWord ( i + 2 ) ) && isForceableToPerson ( sentence , i + 1 , i + 1 ) ) { if ( sentence . getTag ( i + 1 ) != _tagSet -> getTagIndex ( perCO ) ) { sentence . setTag ( i + 1 , _tagSet -> getTagIndex ( perST ) ) ; } if ( sentence . getTag ( i + 2 ) != _tagSet -> getTagIndex ( perCO ) ) { sentence . changeToStartTag ( i + 2 ) ; } } if ( i + 3 < sentence . getLength ( ) && WordConstants :: isOpenDoubleBracket ( sentence . getWord ( i ) ) && WordConstants :: isClosedDoubleBracket ( sentence . getWord ( i + 3 ) ) && isForceableToPerson ( sentence , i + 1 , i + 2 ) ) { if ( sentence . getTag ( i + 1 ) != _tagSet -> getTagIndex ( perCO ) ) { sentence . setTag ( i + 1 , _tagSet -> getTagIndex ( perST ) ) ; } sentence . setTag ( i + 2 , _tagSet -> getTagIndex ( perCO ) ) ; if ( sentence . getTag ( i + 3 ) != _tagSet -> getTagIndex ( perCO ) ) { sentence . changeToStartTag ( i + 3 ) ; } } } }
Any time you see one or two tokens surrounded by double parens, make it a person name
Any time you see one or two tokens surrounded by double parens make it a person name
// look for PER names surrounded by -LDB- and -RDB-, turn all of it to PER
