src/PredFinder/elf/ElfIndividual.cpp
/**
 * Returns a string processed according to type. In most cases, this will
 * correspond to the original string, but for xsd:int, it will correspond
 * to a string from which any thousand separators have been stripped. Other
 * special cases may be added. This is a static class method, originally
 * implemented in ElfRelationArg.
 *
 * @param original_text The original text (e.g., "Ohio" or "5,000").
 * @return The processed text (e.g., "Ohio" or "5000").
 *
 * @author afrankel@bbn.com
 * @date 2010.08.04
 **/
Returns a string processed according to type. In most cases, this will
correspond to the original string, but for xsd:int, it will correspond
to a string from which any thousand separators have been stripped. Other
special cases may be added. This is a static class method, originally
implemented in ElfRelationArg.

@param original_text The original text .
@return The processed text .


Returns a string processed according to type . In most cases this will correspond to the original string but for xsd : int it will correspond to a string from which any thousand separators have been stripped . Other special cases may be added . This is a static class method originally implemented in ElfRelationArg . @param original_text The original text . @return The processed text .
std::wstring ElfIndividual::get_text_according_to_type(const std::wstring & type_string, const std::wstring & original_text) {
	if (type_string == L"xsd:int") {
		return get_normalized_int_text(original_text);
	} else if (type_string == L"xsd:date") {
		std::wstring ymd_only_text = TimexUtils::toYearMonthDayOnly(original_text);
		if (ymd_only_text == L"") {
			std::stringstream error;
			error << "ElfIndividual::get_text_according_to_type(std::wstring, std::wstring, DocTheory*): No YYYY-MM-DD in xsd:date '" << original_text << "'";
			throw std::runtime_error(error.str().c_str());
		} else {
			return ymd_only_text;
		}
	} else {
		return original_text;
	}
}
std :: wstring ElfIndividual :: get_text_according_to_type ( const std :: wstring & type_string , const std :: wstring & original_text ) { if ( type_string == L" " ) { return get_normalized_int_text ( original_text ) ; } else if ( type_string == L" " ) { std :: wstring ymd_only_text = TimexUtils :: toYearMonthDayOnly ( original_text ) ; if ( ymd_only_text == L" " ) { std :: stringstream error ; error << " " << original_text << " " ; throw std :: runtime_error ( error . str ( ) . c_str ( ) ) ; } else { return ymd_only_text ; } } else { return original_text ; } }
Returns a string processed according to type.
Returns a string processed according to type .
// Even though xsd:date supports times and timezones, we only care about day resolution
 // Additional cases requiring special handling may be added in additional "else if"
 // branches above.
