src/English/names/en_NameRecognizer.cpp
// If we see John ((Smith)) make sure everything up including the last double 
// paren occurs in the name

If we see John ((Smith)) make sure everything up including the last double
paren occurs in the name
If we see John (( Smith )) make sure everything up including the last double paren occurs in the name
void EnglishNameRecognizer::joinDoubleParenNames(PIdFSentence &sentence) {
	Symbol perSymbol = EntityType::getPERType().getName();
	wstring perStr = perSymbol.to_string();
	wstring perCOStr = perStr.append(L"-CO");
	Symbol perCO = Symbol(perCOStr);
	for (int i = 0; i < sentence.getLength() - 2; i++) {
		if (WordConstants::isOpenDoubleBracket(sentence.getWord(i))) {
			bool found_per = false;
			bool found_rdb = false;
			int j;
			for (j = i + 1; j < i + 4 && j < sentence.getLength(); j++) {
				Symbol reducedTag = _tagSet->getReducedTagSymbol(sentence.getTag(j));
				Symbol word = sentence.getWord(j);
				if (reducedTag == perSymbol) found_per = true;
				if (WordConstants::isClosedDoubleBracket(word)) {
					found_rdb = true;
					break;
				}
			}
			if (found_per && found_rdb) {
				for (int k = i; k <= j; k++) {
					sentence.setTag(k, _tagSet->getTagIndex(perCO));
				}
				if (i == 0 || _tagSet->getReducedTagSymbol(sentence.getTag(i - 1)) != perSymbol) {
					sentence.changeToStartTag(i);
				}
				if (j + 1 < sentence.getLength() && _tagSet->getReducedTagSymbol(sentence.getTag(j + 1)) == perSymbol && _tagSet->isSTTag(sentence.getTag(j + 1))) {
					sentence.changeToContinueTag(j + 1);
				}
				if (j + 1 < sentence.getLength() && _tagSet->getReducedTagSymbol(sentence.getTag(j + 1)) != perSymbol) {
					sentence.changeToStartTag(j + 1);
				}
			}
		}
	}
}
void EnglishNameRecognizer :: joinDoubleParenNames ( PIdFSentence & sentence ) { Symbol perSymbol = EntityType :: getPERType ( ) . getName ( ) ; wstring perStr = perSymbol . to_string ( ) ; wstring perCOStr = perStr . append ( L" " ) ; Symbol perCO = Symbol ( perCOStr ) ; for ( int i = 0 ; i < sentence . getLength ( ) - 2 ; i ++ ) { if ( WordConstants :: isOpenDoubleBracket ( sentence . getWord ( i ) ) ) { bool found_per = false ; bool found_rdb = false ; int j ; for ( j = i + 1 ; j < i + 4 && j < sentence . getLength ( ) ; j ++ ) { Symbol reducedTag = _tagSet -> getReducedTagSymbol ( sentence . getTag ( j ) ) ; Symbol word = sentence . getWord ( j ) ; if ( reducedTag == perSymbol ) found_per = true ; if ( WordConstants :: isClosedDoubleBracket ( word ) ) { found_rdb = true ; break ; } } if ( found_per && found_rdb ) { for ( int k = i ; k <= j ; k ++ ) { sentence . setTag ( k , _tagSet -> getTagIndex ( perCO ) ) ; } if ( i == 0 || _tagSet -> getReducedTagSymbol ( sentence . getTag ( i - 1 ) ) != perSymbol ) { sentence . changeToStartTag ( i ) ; } if ( j + 1 < sentence . getLength ( ) && _tagSet -> getReducedTagSymbol ( sentence . getTag ( j + 1 ) ) == perSymbol && _tagSet -> isSTTag ( sentence . getTag ( j + 1 ) ) ) { sentence . changeToContinueTag ( j + 1 ) ; } if ( j + 1 < sentence . getLength ( ) && _tagSet -> getReducedTagSymbol ( sentence . getTag ( j + 1 ) ) != perSymbol ) { sentence . changeToStartTag ( j + 1 ) ; } } } } }
If we see John ((Smith)) make sure everything up including the last double
paren occurs in the name
If we see John (( Smith )) make sure everything up including the last double paren occurs in the name
// look for PER names surrounded by -LDB- and -RDB-, turn all of it to PER
 // Found PER surrounded by -LDB- and -RDB-. i is index of -LDB-, j is index of -RDB-
