TextClassifierEvent.TextSelectionEvent 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
這個類別代表與智慧型文字選取功能相關的事件。
[Android.Runtime.Register("android/view/textclassifier/TextClassifierEvent$TextSelectionEvent", ApiSince=29, DoNotGenerateAcw=true)]
public sealed class TextClassifierEvent.TextSelectionEvent : Android.Views.TextClassifiers.TextClassifierEvent, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/textclassifier/TextClassifierEvent$TextSelectionEvent", ApiSince=29, DoNotGenerateAcw=true)>]
type TextClassifierEvent.TextSelectionEvent = class
inherit TextClassifierEvent
interface IParcelable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- 繼承
- 屬性
- 實作
備註
這個類別代表與智慧型文字選取功能相關的事件。
// User started a selection. e.g. "York" in text "New York City, NY".
new TextSelectionEvent.Builder(TYPE_SELECTION_STARTED)
.setEventContext(classificationContext)
.setEventIndex(0)
.build();
// System smart-selects a recognized entity. e.g. "New York City".
new TextSelectionEvent.Builder(TYPE_SMART_SELECTION_MULTI)
.setEventContext(classificationContext)
.setResultId(textSelection.getId())
.setRelativeWordStartIndex(-1) // Goes back one word to "New" from "York".
.setRelativeWordEndIndex(2) // Goes forward 2 words from "York" to start of ",".
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setEventIndex(1)
.build();
// User resets the selection to the original selection. i.e. "York".
new TextSelectionEvent.Builder(TYPE_SELECTION_RESET)
.setEventContext(classificationContext)
.setResultId(textSelection.getId())
.setRelativeSuggestedWordStartIndex(-1) // Repeated from above.
.setRelativeSuggestedWordEndIndex(2) // Repeated from above.
.setRelativeWordStartIndex(0) // Original selection is always at (0, 1].
.setRelativeWordEndIndex(1)
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setEventIndex(2)
.build();
// User modified the selection. e.g. "New".
new TextSelectionEvent.Builder(TYPE_SELECTION_MODIFIED)
.setEventContext(classificationContext)
.setResultId(textSelection.getId())
.setRelativeSuggestedWordStartIndex(-1) // Repeated from above.
.setRelativeSuggestedWordEndIndex(2) // Repeated from above.
.setRelativeWordStartIndex(-1) // Goes backward one word from "York" to
"New".
.setRelativeWordEndIndex(0) // Goes backward one word to exclude "York".
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setEventIndex(3)
.build();
// Smart (contextual) actions (at indices, 0, 1, 2) presented to the user.
// e.g. "Map", "Ride share", "Explore".
new TextSelectionEvent.Builder(TYPE_ACTIONS_SHOWN)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setActionIndices(0, 1, 2)
.setEventIndex(4)
.build();
// User chooses the "Copy" action.
new TextSelectionEvent.Builder(TYPE_COPY_ACTION)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setEventIndex(5)
.build();
// User chooses smart action at index 1. i.e. "Ride share".
new TextSelectionEvent.Builder(TYPE_SMART_ACTION)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setActionIndices(1)
.setEventIndex(5)
.build();
// Selection dismissed.
new TextSelectionEvent.Builder(TYPE_SELECTION_DESTROYED)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setEventIndex(6)
.build();
的 android.view.textclassifier.TextClassifierEvent.TextSelectionEvent
JAVA 檔。
此頁面的部分是根據 原始碼專案所建立和共用的工作進行修改,並根據中所述的詞彙使用。
欄位
屬性
Class |
傳回這個 |
Creator |
這個類別代表與智慧型文字選取功能相關的事件。 |
EventCategory |
傳回事件類別目錄。 (繼承來源 TextClassifierEvent) |
EventContext |
傳回事件內容。 (繼承來源 TextClassifierEvent) |
EventIndex |
傳回它所屬之事件系列中這個事件的索引。 (繼承來源 TextClassifierEvent) |
EventType |
傳回事件種類。 (繼承來源 TextClassifierEvent) |
Extras |
傳回套件組合,其中包含此事件的非結構化額外資訊。 (繼承來源 TextClassifierEvent) |
Handle |
基礎 Android 實例的控制碼。 (繼承來源 Object) |
JniIdentityHashCode |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
JniPeerMembers |
這個類別代表與智慧型文字選取功能相關的事件。 |
Locale |
傳回偵測到的地區設定。 (繼承來源 TextClassifierEvent) |
ModelName |
傳回模型名稱。 (繼承來源 TextClassifierEvent) |
PeerReference |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
RelativeSuggestedWordEndIndex |
傳回智慧選取範圍結尾的相對字 (獨佔) 索引。 |
RelativeSuggestedWordStartIndex |
傳回智慧選取範圍開頭的相對字索引。 |
RelativeWordEndIndex |
傳回選取範圍結尾 (獨佔) 索引的相對字組。 |
RelativeWordStartIndex |
傳回選取範圍開頭的相對字索引。 |
ResultId |
傳回與這個事件相關的文字分類器結果識別碼。 (繼承來源 TextClassifierEvent) |
ThresholdClass |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 TextClassifierEvent) |
ThresholdType |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 TextClassifierEvent) |
方法
Clone() |
建立並傳回這個 物件的複本。 (繼承來源 Object) |
DescribeContents() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 TextClassifierEvent) |
Dispose() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
Dispose(Boolean) |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
Equals(Object) |
指出其他物件是否「等於」這個物件。 (繼承來源 Object) |
GetActionIndices() |
傳回與此事件相關的動作索引。 (繼承來源 TextClassifierEvent) |
GetEntityTypes() |
傳回實體類型的陣列。 (繼承來源 TextClassifierEvent) |
GetHashCode() |
傳回此物件的雜湊碼值。 (繼承來源 Object) |
GetScores() |
傳回建議的分數。 (繼承來源 TextClassifierEvent) |
JavaFinalize() |
當垃圾收集判斷物件沒有其他參考時,由物件上的垃圾收集行程呼叫。 (繼承來源 Object) |
Notify() |
喚醒正在等候此物件的監視器的單一線程。 (繼承來源 Object) |
NotifyAll() |
喚醒正在等候此物件監視器的所有線程。 (繼承來源 Object) |
SetHandle(IntPtr, JniHandleOwnership) |
設定 Handle 屬性。 (繼承來源 Object) |
ToArray<T>() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
ToString() |
傳回物件的字串表示。 (繼承來源 Object) |
UnregisterFromRuntime() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
Wait() |
讓目前的執行緒等到喚醒為止,通常是藉由 < em > notified < /em > 或 < em > interrupted < /em > 來喚醒。 (繼承來源 Object) |
Wait(Int64) |
讓目前的執行緒等到喚醒為止,通常是 < 透過 em > notified < /em 或 em > interrupted < /em >> ,或 < 直到經過一定數量的即時為止。 (繼承來源 Object) |
Wait(Int64, Int32) |
讓目前的執行緒等到喚醒為止,通常是 < 透過 em > notified < /em 或 em > interrupted < /em >> ,或 < 直到經過一定數量的即時為止。 (繼承來源 Object) |
WriteToParcel(Parcel, ParcelableWriteFlags) |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 TextClassifierEvent) |
明確介面實作
IJavaPeerable.Disposed() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
IJavaPeerable.DisposeUnlessReferenced() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
IJavaPeerable.Finalized() |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
IJavaPeerable.JniManagedPeerState |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) |
這個類別代表與智慧型文字選取功能相關的事件。 (繼承來源 Object) |
擴充方法
JavaCast<TResult>(IJavaObject) |
執行 Android 執行時間檢查的類型轉換。 |
JavaCast<TResult>(IJavaObject) |
這個類別代表與智慧型文字選取功能相關的事件。 |
GetJniTypeName(IJavaPeerable) |
這個類別代表與智慧型文字選取功能相關的事件。 |