src/PredFinder/common/ElfMultiDoc.cpp
/**
 * Get acronyms that can correspond to a string.
 * @param s String for which acronyms are to be retrieved.
 * @return Set of acronyms to be retrieved.
 * @example get_possible_acronyms("american insurance group") -> ("a i g", "a i g ", "aig")
 **/
Get acronyms that can correspond to a string.
@param s String for which acronyms are to be retrieved.
@return Set of acronyms to be retrieved.
Get acronyms that can correspond to a string . @param s String for which acronyms are to be retrieved . @return Set of acronyms to be retrieved .
SetOfStrings ElfMultiDoc::get_possible_acronyms(const std::wstring & s){
	SetOfStrings acronyms;
	std::vector<std::wstring> words;
	boost::algorithm::split(words, s, boost::algorithm::is_from_range(L' ', L' '));
	std::wstring a1, a2, a3;
	BOOST_FOREACH(std::wstring word, words){
		if(WordConstants::isAcronymStopWord(Symbol(word)))
			continue;
		wchar_t c = word[0];
		a1.push_back(c);
		a2.push_back(c);
		a2.push_back(L' ');
	}
	a2 = UnicodeUtil::normalizeTextString(a2);
	a3 = a2;
	a3.push_back(L' ');
	acronyms.insert(a1);
	acronyms.insert(a2);
	acronyms.insert(a3);
	return acronyms;
}
SetOfStrings ElfMultiDoc :: get_possible_acronyms ( const std :: wstring & s ) { SetOfStrings acronyms ; std :: vector < std :: wstring > words ; boost :: algorithm :: split ( words , s , boost :: algorithm :: is_from_range ( L' ' , L' ' ) ) ; std :: wstring a1 , a2 , a3 ; BOOST_FOREACH ( std :: wstring word , words ) { if ( WordConstants :: isAcronymStopWord ( Symbol ( word ) ) ) continue ; wchar_t c = word [ 0 ] ; a1 . push_back ( c ) ; a2 . push_back ( c ) ; a2 . push_back ( L' ' ) ; } a2 = UnicodeUtil :: normalizeTextString ( a2 ) ; a3 = a2 ; a3 . push_back ( L' ' ) ; acronyms . insert ( a1 ) ; acronyms . insert ( a2 ) ; acronyms . insert ( a3 ) ; return acronyms ; }
Get acronyms that can correspond to a string.
Get acronyms that can correspond to a string .