Coder Social home page Coder Social logo

converting_english_books_to_vocabularylist_for_learning's Introduction

English Books Foreteller

项目简介

环境配置

  • tkinter
  • sqlite3
  • pdfplumber
  • re
  • requests
  • os
  • json

一. tkinter 界面学习单词

1. 项目主文件

mainpage.py(本来是多个文件分开的,但是为了打包成可执行文件所以合并到一起)

2. 项目附带文件

DataForUse 目录下的两个单词数据库。(本项目不需要联网)

3. 主要功能

  1. 上传 txt/pdf 的英文原版书,生成按词频排序的词单,可保存在 exported_list 目录下。
  2. 选择内置的英文原版 txt 书,或者内置的单词书,生成背诵的词单,可保存在 exported_list 目录下。
  3. 以无中文,只有中文,正序,倒序方式浏览词单。
  4. 以无中文,中英结合方式测试词汇掌握程度。

4. 重点功能的实现

  1. 读取、统计词频(运用技术:正则匹配和高频词去除):利用 pdfplumber 的 API 读取 PDF 文件,然后利用正则匹配单一大写字母且剩下小写字母或者全部小写字母的单词。为了筛选出常用词汇,利用10多本书的单词,按照词频排序,生成一个高词频的词单。这些词单中大多数将不会被匹配,比如冠词、不定式等等。
  2. 传入文件,生成词单(数据库二叉搜索和多线程):生成要查找的词后,利用 sqlite3 数据库默认的二叉搜索和 threading 的多线程,分别在高频词汇库(大约13000个词,内含词频)和中频词汇库(34万个词)进行查找。查找完成后在数据库内生成表格,存储收集的信息,以便背诵使用。

二. 学习词单脚本(补充项目一的第四功能,并且有更成熟的单词检测系统)

1. 项目主文件

test_memery.py

2. 项目附带文件

DataForUse 目录下的自动生成的 test_memery.db。(本项目需要联网)

3. 主要功能

  1. 读取 txt 文件(格式为一行一个单词形式,或者 WORD: xxxx 形式),生成关于一个英文单词的至少有 35 个英文例句及更多词意的 txt 文档供学习。在主程序控制台以英文词义检测掌握程度,设置正确次数大于错误次数 2 值后不再复习(后期准备通过遗忘曲线控制熟练度)。
  2. 可以通过项目一的只有单词模式导出的 txt 文件直接生成,但可能需要较长时间。

4. 重点功能的实现

  1. 逐个爬取单词信息:利用 requests 库的 session 进行多次连续爬取:先按照词汇查询网页网址规律找到目标单词的网页,在网页源代码中有时直接导成 json 拼接或者利用正则匹配特定的 tag 如 <audio>.*?</audio>
  2. 爬取成功后保存到 txt 文档储存

image

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.