/// <summary> /// Determines the type of character that is currently pointed to by _offset, /// </summary> /// <param name="charsToConsume"></param> /// <returns></returns> private CharClass ClassifyChar(string strval, int offset, out int charsToConsume) { charsToConsume = 1; char currChar = strval[offset]; if (currChar == '&') { int nextSemi = strval.IndexOf(';', offset + 1); if (nextSemi != -1) { int code = HtmlUtils.DecodeEntityReference(strval.Substring(offset + 1, nextSemi - offset - 1)); if (code != -1) { charsToConsume = nextSemi - offset + 1; currChar = (char)code; } } } return (!WordRangeHelper.IsNonSymbolChar(currChar) ? CharClass.Break : char.IsLetter(currChar) ? CharClass.Letter : char.IsNumber(currChar) ? CharClass.Number : currChar == '\'' ? CharClass.BoundaryBreak : currChar == '’' ? CharClass.BoundaryBreak : currChar == '.' ? CharClass.IncludedBreakChar : CharClass.Break); }