Skip to content

JeffyLu/predictive-text

Repository files navigation

predictive-text


环境依赖

  • MySQL
  • Redis
  • Python3

使用方法

settings.py中修改数据库和缓存的配置信息,然后装pip包。

$ pip3 install -r requirements.txt

下载英文词汇words.txt并初始化数据。

$ python3 manage.py migrate
$ python3 manage.py init_data -c [num of cup]
$ python3 manage.py import_vocabulary -f [path to words.txt]

注册定时任务,两个任务分别用来更新每日新闻和分析一定数量的文章,从而提高补全或提示的准确性。

$ python3 manage.py crontab add

运行。

$ python3 manage.py runserver

API文档

文档是基于APIBlueprint语法写的,可以使用aglio来渲染。

$ aglio -i api.apib -s

访问localhost:3000效果如下: 效果

系统效果