GithubHelp home page GithubHelp logo

bobcn2017 / idioms Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 2.8 MB

成语接龙后台模块,Get方式发送“接龙”和long值ID到服务器,服务器返回成语,用户接成语后发送,服务器判断是否正确后继续接龙或提示用户接错。

HTML 4.36% Java 95.64%

idioms's Introduction

Idioms

成语接龙后台模块,Get方式发送“接龙”和long值ID到服务器,服务器返回成语,用户接成语后发送,服务器判断是否正确后继续接龙或提示用户接错。

移动端最终接龙效果:

image

War包链接

https://github.com/BobCN2017/Idioms/blob/master/WebContent/raw/Idioms.war

可测试的链接:

http://106.14.163.73:8080/Idioms/Idiom?q=成语接龙测试4999&id=1501591237030

源起

一月份时用图灵机器人后台做了款聊天机器人,发到了Google Play上,结果用户纷纷反馈,接龙模块难度太高,太难了,不好玩。于是向图灵反馈,希望他们能修改接龙模块,降低难度。可能这事太小了,图灵机器人或者太忙,总之很久未没能修改这模块。突然有天灵机一动,心想这模块也不难,自已做了一个得了。于是自已写了一个这个后台模块,打了个War包,放到了阿里云上。自己的App先用上,感觉还不错,开始也在GitHub上搜索过,还没有类似的后台方面的东西,嗯,放上来和大家共享下吧。

拼音模块

使用的是TinyPinYin https://github.com/promeG/TinyPinyin 感谢!

成语库

最初是从百度文库下载成语大全,自己写一小段代码来筛选,哼哧哼哧干了很久,才收集了三千多的成语。据一个成语接龙网站数据,全部成语共有4万多,后来在GitHub搜索时,在一个也是成语接龙模块中找到了一个三万多的成语库,未保留链接,现找不到了,抱歉!试了一下,发现里面成语生僻的还是很多,简单地用常用3500汉字筛选了一下,成语中任一个字不在这3500之中,则删除,最终库的大小是27000。

判断用户是否正确模块

应该是从https://github.com/NLPchina/ansj_seg 下载了一个中文的全部词库,将四字词筛选出来,筛选完后拼接上成语库一共有90855个,其中一大部分不是成语,将其做为识别用户输入是否合法的词表。这样做的目的只有一个:降低难度。 将90855个四字词做表时,采用了存贮其Hashcode的Set方法来验证,一共转成了90842个独立的Hashcode,重复了13个,做为验证用户输入是否合法,精度是足够了。

idioms's People

Contributors

zhangp365 avatar

Stargazers

BenjaminWei avatar Jinman Zhao avatar

Watchers

James Cloos avatar

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.