Home
last modified time | relevance | path

Searched refs:TextClassifier (Results 1 – 25 of 37) sorted by relevance

12

/frameworks/base/core/java/android/view/textclassifier/
DTextClassificationManager.java25 import android.view.textclassifier.TextClassifier.TextClassifierType;
38 private static final String LOG_TAG = TextClassifier.LOG_TAG;
52 private TextClassifier mCustomTextClassifier;
75 public TextClassifier getTextClassifier() { in getTextClassifier()
92 public void setTextClassifier(@Nullable TextClassifier textClassifier) { in setTextClassifier()
108 public TextClassifier getTextClassifier(@TextClassifierType int type) { in getTextClassifier()
110 case TextClassifier.LOCAL: in getTextClassifier()
144 public TextClassifier createTextClassificationSession( in createTextClassificationSession()
147 final TextClassifier textClassifier = in createTextClassificationSession()
157 public TextClassifier createTextClassificationSession( in createTextClassificationSession()
[all …]
DTextLinksParams.java48 private final TextClassifier.EntityConfig mEntityConfig;
55 mEntityConfig = TextClassifier.EntityConfig.createWithHints(null); in TextLinksParams()
69 entitiesToFind.add(TextClassifier.TYPE_URL); in fromLinkMask()
72 entitiesToFind.add(TextClassifier.TYPE_EMAIL); in fromLinkMask()
75 entitiesToFind.add(TextClassifier.TYPE_PHONE); in fromLinkMask()
78 entitiesToFind.add(TextClassifier.TYPE_ADDRESS); in fromLinkMask()
81 TextClassifier.EntityConfig.createWithExplicitEntityList(entitiesToFind)) in fromLinkMask()
89 public TextClassifier.EntityConfig getEntityConfig() { in getEntityConfig()
189 public Builder setEntityConfig(@Nullable TextClassifier.EntityConfig entityConfig) { in setEntityConfig()
DTextClassifier.java61 public interface TextClassifier { interface
182 TextClassifier NO_OP = new TextClassifier() {
741 if (entities.contains(TextClassifier.TYPE_URL)) { in generateLegacyLinks()
742 addLinks(links, string, TextClassifier.TYPE_URL); in generateLegacyLinks()
744 if (entities.contains(TextClassifier.TYPE_PHONE)) { in generateLegacyLinks()
745 addLinks(links, string, TextClassifier.TYPE_PHONE); in generateLegacyLinks()
747 if (entities.contains(TextClassifier.TYPE_EMAIL)) { in generateLegacyLinks()
748 addLinks(links, string, TextClassifier.TYPE_EMAIL); in generateLegacyLinks()
772 case TextClassifier.TYPE_URL: in linkMask()
774 case TextClassifier.TYPE_PHONE: in linkMask()
[all …]
DTextClassificationSession.java33 final class TextClassificationSession implements TextClassifier {
37 private final TextClassifier mDelegate;
45 TextClassificationSession(TextClassificationContext context, TextClassifier delegate) { in TextClassificationSession()
273 private final TextClassifier mDelegate;
276 @NonNull SelectionEventHelper eventHelper, @NonNull TextClassifier delegate) { in CleanerRunnable()
DConversationActions.java310 private final TextClassifier.EntityConfig mTypeConfig;
321 @NonNull TextClassifier.EntityConfig typeConfig, in Request()
335 TextClassifier.EntityConfig typeConfig = in.readParcelable(null); in readFromParcel()
382 public TextClassifier.EntityConfig getTypeConfig() { in getTypeConfig()
451 private TextClassifier.EntityConfig mTypeConfig;
481 public Builder setTypeConfig(@Nullable TextClassifier.EntityConfig typeConfig) { in setTypeConfig()
513 ? new TextClassifier.EntityConfig.Builder().build() in build()
DSelectionEvent.java24 import android.view.textclassifier.TextClassifier.EntityType;
25 import android.view.textclassifier.TextClassifier.WidgetType;
127 private String mWidgetType = TextClassifier.WIDGET_TYPE_UNKNOWN;
223 TextClassifier.TYPE_UNKNOWN, invocationMethod, NO_SIGNATURE); in createSelectionStartedEvent()
240 TextClassifier.TYPE_UNKNOWN, INVOCATION_UNKNOWN, NO_SIGNATURE); in createSelectionModifiedEvent()
261 : TextClassifier.TYPE_UNKNOWN; in createSelectionModifiedEvent()
285 : TextClassifier.TYPE_UNKNOWN; in createSelectionModifiedEvent()
307 start, end, actionType, TextClassifier.TYPE_UNKNOWN, INVOCATION_UNKNOWN, in createSelectionActionEvent()
334 : TextClassifier.TYPE_UNKNOWN; in createSelectionActionEvent()
DSystemTextClassifier.java46 public final class SystemTextClassifier implements TextClassifier {
48 private static final String LOG_TAG = TextClassifier.LOG_TAG;
52 private final TextClassifier mFallback;
73 mFallback = TextClassifier.NO_OP; in SystemTextClassifier()
DTextClassificationSessionFactory.java34 TextClassifier createTextClassificationSession( in createTextClassificationSession()
DLog.java35 android.util.Log.isLoggable(TextClassifier.LOG_TAG, android.util.Log.VERBOSE);
DTextSelection.java29 import android.view.textclassifier.TextClassifier.EntityType;
30 import android.view.textclassifier.TextClassifier.Utils;
DTextClassificationContext.java23 import android.view.textclassifier.TextClassifier.WidgetType;
DTextLinks.java33 import android.view.textclassifier.TextClassifier.EntityConfig;
34 import android.view.textclassifier.TextClassifier.EntityType;
DTextClassification.java41 import android.view.textclassifier.TextClassifier.EntityType;
42 import android.view.textclassifier.TextClassifier.Utils;
/frameworks/base/core/tests/coretests/src/android/view/textclassifier/
DTextClassifierUtilsTest.java44 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
51 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
58 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
65 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
70 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
81 assertThrows(() -> TextClassifier.Utils.getSubString(null, 0, 1, minimumLength)); in testGetSubString_invalidParams()
83 assertThrows(() -> TextClassifier.Utils.getSubString(text, 6, 5, minimumLength)); in testGetSubString_invalidParams()
85 assertThrows(() -> TextClassifier.Utils.getSubString(text, -1, 5, minimumLength)); in testGetSubString_invalidParams()
87 assertThrows(() -> TextClassifier.Utils.getSubString(text, 6, length + 1, minimumLength)); in testGetSubString_invalidParams()
DTextLinksTest.java58 result.put(TextClassifier.TYPE_ADDRESS, address); in getEntityScores()
61 result.put(TextClassifier.TYPE_PHONE, phone); in getEntityScores()
64 result.put(TextClassifier.TYPE_OTHER, other); in getEntityScores()
90 assertEquals(TextClassifier.TYPE_OTHER, resultList.get(0).getEntity(0)); in testParcel()
91 assertEquals(1.f, resultList.get(0).getConfidenceScore(TextClassifier.TYPE_OTHER), 1e-7f); in testParcel()
96 assertEquals(TextClassifier.TYPE_ADDRESS, resultList.get(1).getEntity(0)); in testParcel()
97 assertEquals(TextClassifier.TYPE_OTHER, resultList.get(1).getEntity(1)); in testParcel()
98 assertEquals(TextClassifier.TYPE_PHONE, resultList.get(1).getEntity(2)); in testParcel()
99 assertEquals(.8f, resultList.get(1).getConfidenceScore(TextClassifier.TYPE_ADDRESS), 1e-7f); in testParcel()
100 assertEquals(.5f, resultList.get(1).getConfidenceScore(TextClassifier.TYPE_OTHER), 1e-7f); in testParcel()
[all …]
DTextSelectionTest.java51 .setEntityType(TextClassifier.TYPE_ADDRESS, 0.3f) in testParcel()
52 .setEntityType(TextClassifier.TYPE_PHONE, 0.7f) in testParcel()
53 .setEntityType(TextClassifier.TYPE_URL, 0.1f) in testParcel()
69 assertEquals(TextClassifier.TYPE_PHONE, result.getEntity(0)); in testParcel()
70 assertEquals(TextClassifier.TYPE_ADDRESS, result.getEntity(1)); in testParcel()
71 assertEquals(TextClassifier.TYPE_URL, result.getEntity(2)); in testParcel()
72 assertEquals(0.7f, result.getConfidenceScore(TextClassifier.TYPE_PHONE), 1e-7f); in testParcel()
73 assertEquals(0.3f, result.getConfidenceScore(TextClassifier.TYPE_ADDRESS), 1e-7f); in testParcel()
74 assertEquals(0.1f, result.getConfidenceScore(TextClassifier.TYPE_URL), 1e-7f); in testParcel()
DTextClassificationManagerTest.java48 TextClassifier classifier = mock(TextClassifier.class); in testSetTextClassifier()
55 assertThat(mTcm.getTextClassifier(TextClassifier.LOCAL)).isSameAs(TextClassifier.NO_OP); in testGetLocalTextClassifier()
60 assertThat(mTcm.getTextClassifier(TextClassifier.SYSTEM)) in testGetSystemTextClassifier()
DTextClassificationTest.java100 .setEntityType(TextClassifier.TYPE_ADDRESS, 0.3f) in testParcel()
101 .setEntityType(TextClassifier.TYPE_PHONE, 0.7f) in testParcel()
130 assertEquals(TextClassifier.TYPE_PHONE, result.getEntity(0)); in testParcel()
131 assertEquals(TextClassifier.TYPE_ADDRESS, result.getEntity(1)); in testParcel()
132 assertEquals(0.7f, result.getConfidenceScore(TextClassifier.TYPE_PHONE), EPSILON); in testParcel()
133 assertEquals(0.3f, result.getConfidenceScore(TextClassifier.TYPE_ADDRESS), EPSILON); in testParcel()
245 .setEntityType(TextClassifier.TYPE_EMAIL, 0.5f) in testToBuilder()
246 .setEntityType(TextClassifier.TYPE_PHONE, 0.4f) in testToBuilder()
263 classification.getConfidenceScore(TextClassifier.TYPE_EMAIL), in testToBuilder()
264 fromBuilder.getConfidenceScore(TextClassifier.TYPE_EMAIL), in testToBuilder()
[all …]
DTextClassifierEventTest.java33 new TextClassificationContext.Builder("pkg", TextClassifier.WIDGET_TYPE_TEXTVIEW)
37 .setEntityType(TextClassifier.TYPE_ADDRESS, 1)
42 .setEntityType(TextClassifier.TYPE_DATE, 1)
/frameworks/base/core/java/android/service/textclassifier/
DTextClassifierService.java47 import android.view.textclassifier.TextClassifier;
394 public final TextClassifier getLocalTextClassifier() { in getLocalTextClassifier()
395 return TextClassifier.NO_OP; in getLocalTextClassifier()
406 public static TextClassifier getDefaultTextClassifierImplementation(@NonNull Context context) { in getDefaultTextClassifierImplementation()
410 return TextClassifier.NO_OP; in getDefaultTextClassifierImplementation()
419 return tcm.getTextClassifier(TextClassifier.DEFAULT_SYSTEM); in getDefaultTextClassifierImplementation()
/frameworks/base/core/java/android/webkit/
DWebViewProvider.java48 import android.view.textclassifier.TextClassifier;
296 public default void setTextClassifier(@Nullable TextClassifier textClassifier) {} in setTextClassifier()
299 public default TextClassifier getTextClassifier() { return TextClassifier.NO_OP; } in getTextClassifier()
/frameworks/base/apct-tests/perftests/textclassifier/src/android/view/textclassifier/
DTextClassifierPerfTest.java51 private TextClassifier mTextClassifier;
63 mTextClassifier = textClassificationManager.getTextClassifier(TextClassifier.LOCAL); in setUp()
/frameworks/base/core/proto/android/stats/textclassifier/
Dtextclassifier_enums.proto31 // Something else other than user or the default TextClassifier triggered a selection.
61 // TextClassifier generated some actions
/frameworks/base/core/java/android/widget/
DSelectionActionModeHelper.java46 import android.view.textclassifier.TextClassifier;
731 @Nullable private TextClassifier mClassificationSession;
747 TextClassifier classificationSession, in logSelectionStarted()
1056 private Supplier<TextClassifier> mTextClassifier;
1087 TextClassificationHelper(Context context, Supplier<TextClassifier> textClassifier, in TextClassificationHelper()
1094 public void init(Supplier<TextClassifier> textClassifier, CharSequence text, in init()
/frameworks/base/core/tests/coretests/src/android/widget/
DTextViewActivityTest.java82 import android.view.textclassifier.TextClassifier;
125 tcm.setTextClassifier(TextClassifier.NO_OP); in setUp()
423 TextClassifier textClassifier = textClassificationManager.getTextClassifier(); in addLinkifiedTextToTextView()
1101 final TextClassifier classifier = new TextClassifier() { in testSelectionMetricsLogger_noAbandonAfterCopy()
1175 assertEquals(TextClassifier.TYPE_PHONE, lastEvent.getEntityType()); in testSelectionMetricsLogger_overtypeEventIncludesEntityType()
1187 return new TextClassifier() { in testTextClassifierSession()
1277 private final class TestableTextClassifier implements TextClassifier {
1290 .setEntityType(TextClassifier.TYPE_PHONE, 1) in suggestSelection()

12