如何获取数组中的所有英文单词以进行自动完成?
How to get all English words in an array for autocomplete?
我正在开发一个 Android 应用程序,我们在其中添加 post 和一些标签,例如 Stack Overflow。我观察到人们在我的应用程序中添加了不同模式的标签,比如他们将技术用作 tech、techno、technologies 或 startup、start up 或 start-up,所以当他们这样做时,在搜索时排序 post 是一个挑战.我的意思是,当他们搜索启动时,他们看不到 post 标记为启动或启动。
所以我想将用户写入标签的 edittext
更改为 autoCompleteTextView
因此现在他们必须从应用程序提供的列表中添加标签。但是对于单词列表,我需要一个 list/array 字符串,但我不能将它们包含在我的应用程序中,因为有数百万个单词,它们会使应用程序的大小增加 5 到 6mb。所以我想为我的应用程序免费 API
。
有很多 API 都适用于此,其中之一是 here。
A text file containing 479k English words for all your
dictionary/word-based projects e.g: auto-completion / autosuggestion
您可以获得这方面的教程。如果您想在 android 中将它与 kotlin 一起使用,只需像“Kotlin with Retrofit 2”这样搜索即可。
我正在开发一个 Android 应用程序,我们在其中添加 post 和一些标签,例如 Stack Overflow。我观察到人们在我的应用程序中添加了不同模式的标签,比如他们将技术用作 tech、techno、technologies 或 startup、start up 或 start-up,所以当他们这样做时,在搜索时排序 post 是一个挑战.我的意思是,当他们搜索启动时,他们看不到 post 标记为启动或启动。
所以我想将用户写入标签的 edittext
更改为 autoCompleteTextView
因此现在他们必须从应用程序提供的列表中添加标签。但是对于单词列表,我需要一个 list/array 字符串,但我不能将它们包含在我的应用程序中,因为有数百万个单词,它们会使应用程序的大小增加 5 到 6mb。所以我想为我的应用程序免费 API
。
有很多 API 都适用于此,其中之一是 here。
A text file containing 479k English words for all your dictionary/word-based projects e.g: auto-completion / autosuggestion
您可以获得这方面的教程。如果您想在 android 中将它与 kotlin 一起使用,只需像“Kotlin with Retrofit 2”这样搜索即可。