使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
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")
}
如需详细了解依赖项,请参阅添加 build 依赖项。
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对此库有任何改进建议,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
创建新问题
如需了解详情,请参阅问题跟踪器文档。
版本 1.0.0
版本 1.0.0-alpha04
2022 年 3 月 23 日
发布了 androidx.textclassifier:textclassifier:1.0.0-alpha04
。版本 1.0.0-alpha04 中包含这些提交内容。
API 变更
bug 修复
- 针对 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
bug 修复
版本 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
bug 修复
版本 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 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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."]]