src/English/common/en_SymbolUtilities.cpp
//mrf 2007, sometimes Arabic names start with Al, even in English.  We
//don't always tokenize correctly, try this feature

mrf 2007, sometimes Arabic names start with Al, even in English.  We
don't always tokenize correctly, try this feature
mrf 2007 sometimes Arabic names start with Al even in English . We don ' t always tokenize correctly try this feature
Symbol EnglishSymbolUtilities::getWordWithoutAl(Symbol word){
	const wchar_t* word_str = word.to_string();
	size_t word_len = wcslen(word_str);
	if(word_len < 4) return word;
	if(word_len > 199) return word;
	if((word_str[0] == L'A') || (word_str[0] == L'a')){
		if((word_str[1] == L'L') || (word_str[1] == L'l')){
			int start = 2;
			if(word_str[2] == L'-'){
				start = 3;
			}
			wchar_t word_no_al[200];
			int curr_char = 0;
			for(size_t i = start; i< word_len; i++){
				word_no_al[curr_char++] = word_str[i];
			}
			word_no_al[curr_char] = L'\0';
			return Symbol(word_no_al);
		}
	}
	return word;
}
Symbol EnglishSymbolUtilities :: getWordWithoutAl ( Symbol word ) { const wchar_t * word_str = word . to_string ( ) ; size_t word_len = wcslen ( word_str ) ; if ( word_len < 4 ) return word ; if ( word_len > 199 ) return word ; if ( ( word_str [ 0 ] == L' ' ) || ( word_str [ 0 ] == L' ' ) ) { if ( ( word_str [ 1 ] == L' ' ) || ( word_str [ 1 ] == L' ' ) ) { int start = 2 ; if ( word_str [ 2 ] == L' ' ) { start = 3 ; } wchar_t word_no_al [ 200 ] ; int curr_char = 0 ; for ( size_t i = start ; i < word_len ; i ++ ) { word_no_al [ curr_char ++ ] = word_str [ i ] ; } word_no_al [ curr_char ] = L' \0 ' ; return Symbol ( word_no_al ) ; } } return word ; }
mrf 2007, sometimes Arabic names start with Al, even in English.
mrf 2007 sometimes Arabic names start with Al even in English .