src/English/timex/en_TemporalNormalizer.cpp
/* Return the most likely verb tense for the context around the 
 * timex expression beginning at start_tok and ending at end_tok.
 */
Return the most likely verb tense for the context around the
timex expression beginning at start_tok and ending at end_tok.
Return the most likely verb tense for the context around the timex expression beginning at start_tok and ending at end_tok .
EnglishTemporalNormalizer::Tense EnglishTemporalNormalizer::getContextVerbTense(Parse *parse, int start_tok, int end_tok) {
	if (parse != 0) {
		const SynNode * timexNode = parse->getRoot()->getNodeByTokenSpan(start_tok, end_tok);
		wstring tag_chain = L"";
		wstring word_chain = L"";
		const SynNode * vpNode = timexNode;
		while (vpNode != 0 && vpNode->getTag() != EnglishSTags::VP && vpNode->getTag() != EnglishSTags::S && vpNode->getTag() != EnglishSTags::SBAR) {
			vpNode = vpNode->getParent();
		}
		addHeadWordAndTagToChain(vpNode, tag_chain, word_chain);
		while (vpNode != 0 && vpNode->getParent() != 0 && vpNode->getParent()->getTag() == EnglishSTags::VP) {		
			vpNode = vpNode->getParent();
			addHeadWordAndTagToChain(vpNode, tag_chain, word_chain);
		}
		if (vpNode != 0) {
			if (LanguageSpecificFunctions::isPastTenseVerbChain(tag_chain, word_chain)) {
				return PAST_TENSE;
			}
			else if (LanguageSpecificFunctions::isPresentTenseVerbChain(tag_chain, word_chain)) {
				return PRESENT_TENSE;
			}
			else if (LanguageSpecificFunctions::isFutureTenseVerbChain(tag_chain, word_chain)) {
				return FUTURE_TENSE;
			}
		}
	}	
	return UNK_TENSE;
}
EnglishTemporalNormalizer :: Tense EnglishTemporalNormalizer :: getContextVerbTense ( Parse * parse , int start_tok , int end_tok ) { if ( parse != 0 ) { const SynNode * timexNode = parse -> getRoot ( ) -> getNodeByTokenSpan ( start_tok , end_tok ) ; wstring tag_chain = L" " ; wstring word_chain = L" " ; const SynNode * vpNode = timexNode ; while ( vpNode != 0 && vpNode -> getTag ( ) != EnglishSTags :: VP && vpNode -> getTag ( ) != EnglishSTags :: S && vpNode -> getTag ( ) != EnglishSTags :: SBAR ) { vpNode = vpNode -> getParent ( ) ; } addHeadWordAndTagToChain ( vpNode , tag_chain , word_chain ) ; while ( vpNode != 0 && vpNode -> getParent ( ) != 0 && vpNode -> getParent ( ) -> getTag ( ) == EnglishSTags :: VP ) { vpNode = vpNode -> getParent ( ) ; addHeadWordAndTagToChain ( vpNode , tag_chain , word_chain ) ; } if ( vpNode != 0 ) { if ( LanguageSpecificFunctions :: isPastTenseVerbChain ( tag_chain , word_chain ) ) { return PAST_TENSE ; } else if ( LanguageSpecificFunctions :: isPresentTenseVerbChain ( tag_chain , word_chain ) ) { return PRESENT_TENSE ; } else if ( LanguageSpecificFunctions :: isFutureTenseVerbChain ( tag_chain , word_chain ) ) { return FUTURE_TENSE ; } } } return UNK_TENSE ; }
Return the most likely verb tense for the context around the
 timex expression beginning at start_tok and ending at end_tok.
Return the most likely verb tense for the context around the timex expression beginning at start_tok and ending at end_tok .
// find the first VP, S or SBAR containing timex expression
 // while there are nested VPs, continue up tree
 //wcout << L"Chain before call: " << tag_chain << L" " << word_chain << L"\n";
 //wcout << L"Past Tense\n";
 //wcout << L"Present Tense\n";
 //wcout << L"Future Tense\n";
