透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Textclassifier
識別文字中的對話、連結、選取項目和其他類似結構。
最近更新時間 |
穩定版 |
候選版 |
Beta 版 |
Alpha 版 |
2022 年 3 月 23 日 |
- |
- |
- |
1.0.0-alpha04 |
宣告依附元件
如要新增 TextClassifier 的依附元件,您必須在專案中新增 Google Maven 存放區。詳情請參閱 Google 的 Maven 存放區。
在應用程式或模組的 build.gradle
檔案中,新增所需構件的依附元件:
Groovy
dependencies {
implementation "androidx.textclassifier:textclassifier:1.0.0-alpha04"
}
Kotlin
dependencies {
implementation("androidx.textclassifier:textclassifier:1.0.0-alpha04")
}
如要進一步瞭解依附元件,請參閱「新增建構依附元件」一文。
意見回饋
您的意見可協助我們改善 Jetpack。如果您發現新問題,或是有改進這個程式庫的建議,請告訴我們。回報新問題前,請先查看這個程式庫的現有問題。只要按一下星號按鈕,即可投票給現有的問題。
建立新問題
詳情請參閱 Issue Tracker 說明文件。
1.0.0 版
1.0.0-alpha04 版本
2022 年 3 月 23 日
發布 androidx.textclassifier:textclassifier:1.0.0-alpha04
。查看 1.0.0-alpha04 版的修訂項。
API 變更
修正錯誤
- 為 AndroidX 啟用
MissingGetterMatchingBuilder
的 API Lint 檢查功能 (I4bbea、b/138602561)
- 已用向量來源取代
AppCompatRatingBar
PNG 可繪項目。這可能會導致個別星號的視覺外觀有些許變動。(I6b99d)
TextClassifier 1.0.0-alpha03 版
2020 年 1 月 22 日
發布了 androidx.textclassifier:textclassifier:1.0.0-alpha03
。1.0.0-alpha03 版包含此連結所列的修訂項目。
新功能
API 變更
setIncludeDefaultEntityTypes
已重新命名為 includeTypesFromTextClassifier
setIncludedEntityTypes
已重新命名為 setIncludedTypes
setExcludedEntityTypes
已重新命名為 setExcludedTypes
修正錯誤
1.0.0-alpha02 版本
2019 年 2 月 7 日
發布 androidx.textclassifier 1.0.0-alpha02
。
API 變更
TextLinks.TextLink.getEntityType
取代 TextLinks.TextLink.getEntity
TextLinks.TextLink.getEntityTypeCount
取代 TextLinks.TextLink.getEntityCount
TextSelection.getEntityType
取代 TextSelection.getEntity
TextSelection.getEntityTypeCount
取代「TextSelection.getEntityCount」
修正錯誤
1.0.0-alpha01 版
2018 年 12 月 3 日
這是 TextClassifier
對 androidx
的第一次重構。這個版本將 (android.view.textclassifier.TextClassifier
)[/reference/android/view/textclassifier/TextClassifier] 功能 (尤其是 Smart Linkify) 向後移植到 API 14。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Textclassifier\n==============\n\nAPI Reference \n[androidx.textclassifier](/reference/kotlin/androidx/textclassifier/package-summary) \nIdentifies conversations, links, selections, and other similar constructs in text. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|----------------|----------------|-------------------|--------------|--------------------------------------------------------------------------|\n| March 23, 2022 | - | - | - | [1.0.0-alpha04](/jetpack/androidx/releases/textclassifier#1.0.0-alpha04) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on TextClassifier, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n implementation \"androidx.textclassifier:textclassifier:1.0.0-alpha04\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n implementation(\"androidx.textclassifier:textclassifier:1.0.0-alpha04\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:878772%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=878772&template=1441952)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.0.0\n-------------\n\n### Version 1.0.0-alpha04\n\nMarch 23, 2022\n\n`androidx.textclassifier:textclassifier:1.0.0-alpha04` is released. [Version 1.0.0-alpha04 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/0a3d894e8fe0217f1312fb163a89ad51bf15794e..5ef5671233460b844828e14a816255dbf7904868/textclassifier/textclassifier)\n\n**API Changes**\n\n- Deprecate all the APIs in the textclassifier module ([Idc180](https://android-review.googlesource.com/#/q/Idc18063196531c0e926162fefeadf2dc5f559da1), [b/210509084](https://issuetracker.google.com/issues/210509084))\n\n**Bug Fixes**\n\n- API lint check for `MissingGetterMatchingBuilder` is enabled for androidx ([I4bbea](https://android-review.googlesource.com/#/q/I4bbeacf9869d8338a3d7086acb40bc56ec68c3f9), [b/138602561](https://issuetracker.google.com/issues/138602561))\n- `AppCompatRatingBar` PNG drawables have been replaced with vector sources. This may cause slight changes in the visual appearance of individual stars. ([I6b99d](https://android-review.googlesource.com/#/q/I6b99d3fde8d3cd275d0fc279324066bcd7f3ecd6))\n\n### TextClassifier Version 1.0.0-alpha03\n\nJanuary 22, 2020\n\n`androidx.textclassifier:textclassifier:1.0.0-alpha03` is released. [Version 1.0.0-alpha03 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/ddceab357394ac5ab55c825844f111afe9401261..0a3d894e8fe0217f1312fb163a89ad51bf15794e/textclassifier).\n\n**New features**\n\n**API changes**\n\n- `setIncludeDefaultEntityTypes` has been renamed to `includeTypesFromTextClassifier`\n- `setIncludedEntityTypes` has been renamed to `setIncludedTypes`\n- `setExcludedEntityTypes` has been renamed to `setExcludedTypes`\n\n**Bug fixes**\n\n### Version 1.0.0-alpha02\n\nFebruary 7, 2019\n\n`androidx.textclassifier 1.0.0-alpha02` is released.\n\n**API changes**\n\n- `TextLinks.TextLink.getEntityType` replaces `TextLinks.TextLink.getEntity`\n- `TextLinks.TextLink.getEntityTypeCount` replaces `TextLinks.TextLink.getEntityCount`\n- `TextSelection.getEntityType` replaces `TextSelection.getEntity`\n- `TextSelection.getEntityTypeCount` replaces \\`TextSelection.getEntityCount\n\n**Bug fixes**\n\n- Fix a memory leak issue in AndroidX TextClassificationManager. ([aosp/887354](https://android-review.googlesource.com/887354))\n- Floating Toolbar: Handle TextView position changes. ([aosp/877713](https://android-review.googlesource.com/877713))\n\n### Version 1.0.0-alpha01\n\nDecember 3, 2018\n\nThis is the first\nrefactoring of `TextClassifier` to `androidx`. This release backports\n(`android.view.textclassifier.TextClassifier`)\\[/reference/android/view/textclassifier/TextClassifier\\]\nfeatures, particularly Smart Linkify, back to API 14."]]