@note NLP type of token is NLP_MISCTEXT; prefixes always considered as "misctext"; suffixes of non-words considered as "misctext"; this function can be called after the last token as well, especially when the last non-word token has the suffix
| 193 | //! this function can be called after the last token as well, |
| 194 | //! especially when the last non-word token has the suffix |
| 195 | void GetDelimiter(TWideToken& tok) const { |
| 196 | Y_ASSERT(!Tokens.empty()); // Next() must be called |
| 197 | //Y_ASSERT(!Finished()); |
| 198 | const TCharSpan& prev = Tokens.back(); |
| 199 | size_t endpos = prev.EndPos(); |
| 200 | if (prev.Type == TOKEN_WORD) { |
| 201 | endpos += prev.SuffixLen; |
| 202 | if (!Finished() && Subtokens[First].PrefixLen) |
| 203 | endpos += GetAdditionalSuffixLen(); |
| 204 | } else if (NlpType == NLP_INTEGER && !Finished() && Subtokens[First].PrefixLen) |
| 205 | endpos += GetIntegerSuffixLen(); |
| 206 | tok.Token = Tok.Token + endpos; |
| 207 | tok.Leng = (Finished() ? Tok.Leng : Tok.SubTokens[First].Pos) - endpos; // length can be equal to 0 in case v1.0 -> v 1.0 |
| 208 | tok.SubTokens.clear(); |
| 209 | } |
| 210 | }; |
no test coverage detected