Fixes datetime model overtriggering, sms shortcodes being linkified to
maps, not recognizing certain phone number formats, and incorrect date
jumps when the granularity of the date is less than a day, and incorrect
start of week for non-US locales.
(Developed in Google3, synced using export_to_aosp.sh script)
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Bug: 77799341
Bug: 76199334
Bug: 77800082
Change-Id: Ib23bc27c63ff69673532851254f2800108e74dda
diff --git a/feature-processor.h b/feature-processor.h
index 553bd1e..98d3449 100644
--- a/feature-processor.h
+++ b/feature-processor.h
@@ -159,6 +159,11 @@
bool only_use_line_with_click,
std::vector<Token>* tokens, int* click_pos) const;
+ // Returns true if the token span has enough supported codepoints (as defined
+ // in the model config) or not and model should not run.
+ bool HasEnoughSupportedCodepoints(const std::vector<Token>& tokens,
+ TokenSpan token_span) const;
+
// Extracts features as a CachedFeatures object that can be used for repeated
// inference over token spans in the given context.
bool ExtractFeatures(const std::vector<Token>& tokens, TokenSpan token_span,