src/Generic/discTagger/DTTagSet.cpp
/* public convenience function that adds the specified reduced tag
   and updates nested tags if necessary */
public convenience function that adds the specified reduced tag
and updates nested tags if necessary
public convenience function that adds the specified reduced tag and updates nested tags if necessary
void DTTagSet::addTag(const Symbol &reducedTag) {
	if (reducedTag == _noneTag || reducedTag == _startTag || reducedTag == _endTag) {
		std::stringstream err;
		err << "Cannot add reserved tag name '" << reducedTag << "' to tag set";
		throw UnexpectedInputException("DTTagSet::addTag()", err.str().c_str());
	}
	if (std::find(_reducedTags.begin(), _reducedTags.end(), reducedTag) != _reducedTags.end())
		return;
	_reducedTags.push_back(reducedTag);
	addTag(reducedTag, reducedTag);
	if (_use_nested_names) {
		BOOST_FOREACH(Symbol otherTag, _reducedTags) {
			Symbol outerNestedTag = reducedTag + Symbol(L"=") + otherTag;
			addTag(reducedTag, outerNestedTag, true);
			if (otherTag != reducedTag) {
				Symbol innerNestedTag = otherTag + Symbol(L"=") + reducedTag;
				addTag(otherTag, innerNestedTag, true);
			}
		}
		setupSuccPred();
	}
}
void DTTagSet :: addTag ( const Symbol & reducedTag ) { if ( reducedTag == _noneTag || reducedTag == _startTag || reducedTag == _endTag ) { std :: stringstream err ; err << " " << reducedTag << " " ; throw UnexpectedInputException ( " " , err . str ( ) . c_str ( ) ) ; } if ( std :: find ( _reducedTags . begin ( ) , _reducedTags . end ( ) , reducedTag ) != _reducedTags . end ( ) ) return ; _reducedTags . push_back ( reducedTag ) ; addTag ( reducedTag , reducedTag ) ; if ( _use_nested_names ) { BOOST_FOREACH ( Symbol otherTag , _reducedTags ) { Symbol outerNestedTag = reducedTag + Symbol ( L" " ) + otherTag ; addTag ( reducedTag , outerNestedTag , true ) ; if ( otherTag != reducedTag ) { Symbol innerNestedTag = otherTag + Symbol ( L" " ) + reducedTag ; addTag ( otherTag , innerNestedTag , true ) ; } } setupSuccPred ( ) ; } }
public convenience function that adds the specified reduced tag
and updates nested tags if necessary
public convenience function that adds the specified reduced tag and updates nested tags if necessary
// don't allow reserved tag names
 // do nothing if the tag is already defined
 // add the tag
 // generate and add any nested tags if they're enabled
 // We're updating as we go, but we don't want to do the same reduced tag twice
 // we need to completely rebuild successors/predecessors when nested tags are being used (which is rare)
