src/Urdu/tokens/ur_Tokenizer.cpp
/*
* Return true if spaces should be put around the comma, which is
* always true at the ends of a sentence, and always in the middle unless
* the comma is surrounded on both sides by numbers
*/
Return true if spaces should be put around the comma, which is
always true at the ends of a sentence, and always in the middle unless
the comma is surrounded on both sides by numbers
Return true if spaces should be put around the comma which is always true at the ends of a sentence and always in the middle unless the comma is surrounded on both sides by numbers
bool UrduTokenizer::isCommaBreakable(LocatedString *string, int i) {
	if (i == 0 || i == string->length()-1) {
		return true;
	}
	else {
		wchar_t prevchar = string->charAt(i-1);
		wchar_t nextchar = string->charAt(i+1);
		if (iswdigit(prevchar) && iswdigit(nextchar))
			return false;
		else 
			return true;
	}
}
bool UrduTokenizer :: isCommaBreakable ( LocatedString * string , int i ) { if ( i == 0 || i == string -> length ( ) - 1 ) { return true ; } else { wchar_t prevchar = string -> charAt ( i - 1 ) ; wchar_t nextchar = string -> charAt ( i + 1 ) ; if ( iswdigit ( prevchar ) && iswdigit ( nextchar ) ) return false ; else return true ; } }
Return true if spaces should be put around the comma, which is
always true at the ends of a sentence, and always in the middle unless
the comma is surrounded on both sides by numbers
Return true if spaces should be put around the comma which is always true at the ends of a sentence and always in the middle unless the comma is surrounded on both sides by numbers