Giter Club home page Giter Club logo

weixin-game-helper-search's Introduction

search

GPL-3.0 Build Status

基于搜索引擎的问答匹配度查询,目前使用了百度和搜狗搜索

目前用于 zhuweiyou/weixin-game-helper 答题类辅助,没有正确答案时提交推荐答案

安装

npm install github:zhuweiyou/weixin-game-helper-search

示例

const search = require('weixin-game-helper-search')

;(async () => {
  const {result, index, maxIndex, minIndex} = await search({
    question: '《红楼梦》的作者是谁?',
    options: [
      '施耐庵',
      '吴承恩',
      '曹雪芹',
      '罗贯中'
    ]
  })
  console.log(result) // [0, 0, 13,0] 数值越大的表示搜索结果越匹配,理论上该选项为正确答案的几率更高
  console.log(index) // 2 推荐的答案,一般为匹配度最高的答案(如果题目中包含否定词汇,匹配度最低为推荐答案)
  console.log(minIndex) // 匹配度最低的答案
  console.log(maxIndex) // 匹配度最高的答案
})()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.