# Looking for similar words
This interface, from the plug-in 1.1.3 Start Support
Look for similar words. The input is a word and the output is a list of words that are similar to that word Examples: Input: Shanghai Output: Shanghai Pudong, Tianjin, Shanghai City, Hangzhou, Suzhou
# to initialize
Plugin version number in the document, only for example reference, the latest version of the plugin,Subject to this
{
"pages": [
"pages/index/index"
],
"plugins": {
"chatbot": {
"version": "1.2.23",
"provider": "wx8c631f7e9f2465e1"
}
},
"requiredBackgroundModes": [
"audio"
],
"sitemapLocation": "sitemap.json"
}
var plugin = requirePlugin("chatbot")
App({
onLaunch: function () {
plugin.init({
appid: "P5Ot9PHJDechCYqDFAW1AiK6OtG3Ja", //Mini Program sample account, for learning and reference only
openid: "", //初始值
success: () => {}, //Not required
fail: (error) => {}, //Not required
})
},
})
# Call Find Similar Words Interface
const txt = "Shanghai"
plugin.api.findSimilarWords(txt).then((nothing) => {
console.log("similarWords result : ", nothing)
})
# Dxplaination of parameters:
field | type | describe |
---|---|---|
txt | string | Enter the word, UTF-8 coding |
# Finding Similar Words Results
{
"words": ["shanghai pudong," "tianjin," "Shanghai City" "hangzhou"; "Suzhou"]
}
# Return value:
field | type | describe |
---|---|---|
words | Array | A list of words that are similar to the words entered |