src/PredFinder/common/ElfMultiDoc.cpp
/**
 * Get acronyms that can correspond to a SynNode.
 * @param n SynNode for which acronyms are to be retrieved.
 * @return Set of acronyms to be retrieved.
 **/
Get acronyms that can correspond to a SynNode.
@param n SynNode for which acronyms are to be retrieved.
@return Set of acronyms to be retrieved.
Get acronyms that can correspond to a SynNode . @param n SynNode for which acronyms are to be retrieved . @return Set of acronyms to be retrieved .
SetOfStrings ElfMultiDoc::get_possible_acronyms_from_syn_node(const SynNode* n){
	SetOfStrings acronyms;
	Symbol ment_symbols[20];
	int n_terms = n->getTerminalSymbols(ment_symbols, 19);
	if(n_terms == 1)
		return acronyms;
	std::wstring a1, a2, a3;
	std::vector<wchar_t> characters;
	for(int i =0; i <n_terms; i++){
		Symbol s = ment_symbols[i];
		if(WordConstants::isAcronymStopWord(s))	
			continue; 
		wchar_t c = s.to_string()[0];
		a1.push_back(c);
		a2.push_back(c);
		if(i !=  (int)characters.size()-1)
			a2.push_back(L'.');	 
	}
	a3 = a2;
	a3.push_back(L'.');
	acronyms.insert(a1);
	acronyms.insert(a2);
	acronyms.insert(a3);
	return acronyms;
}
SetOfStrings ElfMultiDoc :: get_possible_acronyms_from_syn_node ( const SynNode * n ) { SetOfStrings acronyms ; Symbol ment_symbols [ 20 ] ; int n_terms = n -> getTerminalSymbols ( ment_symbols , 19 ) ; if ( n_terms == 1 ) return acronyms ; std :: wstring a1 , a2 , a3 ; std :: vector < wchar_t > characters ; for ( int i = 0 ; i < n_terms ; i ++ ) { Symbol s = ment_symbols [ i ] ; if ( WordConstants :: isAcronymStopWord ( s ) ) continue ; wchar_t c = s . to_string ( ) [ 0 ] ; a1 . push_back ( c ) ; a2 . push_back ( c ) ; if ( i != ( int ) characters . size ( ) - 1 ) a2 . push_back ( L' ' ) ; } a3 = a2 ; a3 . push_back ( L' ' ) ; acronyms . insert ( a1 ) ; acronyms . insert ( a2 ) ; acronyms . insert ( a3 ) ; return acronyms ; }
Get acronyms that can correspond to a SynNode.
Get acronyms that can correspond to a SynNode .
//don't worry about the rare acronym that includes a stop word
 //don't worry about the rare acronym that ends with a stop word
