src/English/tokens/en_Tokenizer.cpp
// Matches from the index of the apostrophe

Matches from the index of the apostrophe
Matches from the index of the apostrophe
bool EnglishTokenizer::matchContractionOrPossessive(const LocatedString *string, int index) const {
	if ((index > 0)                               &&
		((index + 1) < string->length())          &&
		(string->charAt(index) == L'\'')          &&
		(iswalnum(string->charAt(index - 1))))
	{
		if ((index + 2 == string->length() || !iswalnum(string->charAt(index + 2))) &&
			(towlower(string->charAt(index + 1)) == L'm' ||
			 towlower(string->charAt(index + 1)) == L'd' ||
			 towlower(string->charAt(index + 1)) == L's'))
			return true;
		if ((index + 2) < string->length() &&
			(index + 3 == string->length() || !iswalnum(string->charAt(index + 3))))
		{
			if (towlower(string->charAt(index + 1)) == L'v' &&
				towlower(string->charAt(index + 2)) == L'e')
				return true;
			if (towlower(string->charAt(index + 1)) == L'l' &&
				towlower(string->charAt(index + 2)) == L'l')
				return true;
			if (towlower(string->charAt(index + 1)) == L'r' &&
				towlower(string->charAt(index + 2)) == L'e')
				return true;
			if (towlower(string->charAt(index + 1)) == L'e' &&
				towlower(string->charAt(index + 2)) == L'm')
				return true;
		}
	}
	return false;
}
bool EnglishTokenizer :: matchContractionOrPossessive ( const LocatedString * string , int index ) const { if ( ( index > 0 ) && ( ( index + 1 ) < string -> length ( ) ) && ( string -> charAt ( index ) == L' \' ' ) && ( iswalnum ( string -> charAt ( index - 1 ) ) ) ) { if ( ( index + 2 == string -> length ( ) || ! iswalnum ( string -> charAt ( index + 2 ) ) ) && ( towlower ( string -> charAt ( index + 1 ) ) == L' ' || towlower ( string -> charAt ( index + 1 ) ) == L' ' || towlower ( string -> charAt ( index + 1 ) ) == L' ' ) ) return true ; if ( ( index + 2 ) < string -> length ( ) && ( index + 3 == string -> length ( ) || ! iswalnum ( string -> charAt ( index + 3 ) ) ) ) { if ( towlower ( string -> charAt ( index + 1 ) ) == L' ' && towlower ( string -> charAt ( index + 2 ) ) == L' ' ) return true ; if ( towlower ( string -> charAt ( index + 1 ) ) == L' ' && towlower ( string -> charAt ( index + 2 ) ) == L' ' ) return true ; if ( towlower ( string -> charAt ( index + 1 ) ) == L' ' && towlower ( string -> charAt ( index + 2 ) ) == L' ' ) return true ; if ( towlower ( string -> charAt ( index + 1 ) ) == L' ' && towlower ( string -> charAt ( index + 2 ) ) == L' ' ) return true ; } } return false ; }
Matches from the index of the apostrophe
Matches from the index of the apostrophe
// Check for apostrophe followed by at least one other 
 // char and preceded by an alpha-numeric.
 // 'm 'd 's
 // 've
 // 'll
 // 're
 // 'em
