| 284 | } |
| 285 | |
| 286 | void NTokenizer::TTokenizer::Tokenize( |
| 287 | TStringBuf inputString, |
| 288 | TVector<TString>* tokens, |
| 289 | TVector<NTokenizer::ETokenType>* tokenTypes |
| 290 | ) const { |
| 291 | Y_ASSERT(tokens); |
| 292 | tokens->clear(); |
| 293 | if (tokenTypes) { |
| 294 | tokenTypes->clear(); |
| 295 | } |
| 296 | |
| 297 | if (Options.SeparatorType == NTokenizer::ESeparatorType::BySense) { |
| 298 | SplitBySense(inputString, Options, Lemmer.Get(), tokens, tokenTypes); |
| 299 | } else { |
| 300 | Y_ENSURE(Options.SeparatorType == NTokenizer::ESeparatorType::ByDelimiter, "Unsupported SeparatorType"); |
| 301 | SplitByDelimiter(inputString, Options, Lemmer.Get(), tokens, tokenTypes); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | TVector<TString> NTokenizer::TTokenizer::Tokenize(TStringBuf inputString) const { |
| 306 | TVector<TString> tokens; |
no test coverage detected