aboutsummaryrefslogtreecommitdiff
path: root/icing/tokenization/rfc822-tokenizer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'icing/tokenization/rfc822-tokenizer.cc')
-rw-r--r--icing/tokenization/rfc822-tokenizer.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/icing/tokenization/rfc822-tokenizer.cc b/icing/tokenization/rfc822-tokenizer.cc
index 35b82ca..13c58c5 100644
--- a/icing/tokenization/rfc822-tokenizer.cc
+++ b/icing/tokenization/rfc822-tokenizer.cc
@@ -778,15 +778,14 @@ class Rfc822TokenIterator : public Tokenizer::Iterator {
};
libtextclassifier3::StatusOr<std::unique_ptr<Tokenizer::Iterator>>
-Rfc822Tokenizer::Tokenize(std::string_view text,
- LanguageSegmenter::AccessType) const {
+Rfc822Tokenizer::Tokenize(std::string_view text) const {
return std::make_unique<Rfc822TokenIterator>(text);
}
libtextclassifier3::StatusOr<std::vector<Token>> Rfc822Tokenizer::TokenizeAll(
std::string_view text) const {
- std::unique_ptr<Tokenizer::Iterator> iterator =
- std::make_unique<Rfc822TokenIterator>(text);
+ ICING_ASSIGN_OR_RETURN(std::unique_ptr<Tokenizer::Iterator> iterator,
+ Tokenize(text));
std::vector<Token> tokens;
while (iterator->Advance()) {
std::vector<Token> batch_tokens = iterator->GetTokens();