前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >用Python分析了1980~2015年考研英语真题词汇,原来考研英语应该这样考!

用Python分析了1980~2015年考研英语真题词汇,原来考研英语应该这样考!

作者头像
sergiojune
发布2018-12-28 10:46:18
7840
发布2018-12-28 10:46:18
举报
文章被收录于专栏:日常学python

微信改版,加星标不迷路!

用Python分析了1980~2015年考研英语真题词汇,原来考研应该这样考!

作者:阿广

出处:视学算法

概述

  • 前言
  • 数据介绍
  • 实现过程
  • 考研英语词汇统计分析
  • 搞笑一刻
  • 阿广说
  • 每日问题
  • 推荐阅读

前言

我们渐渐长大,从一开始的初生牛犊不怕虎到渐渐惧怕孤独,从一开始的单打独斗到渐渐合群躲避孤独。不巧的是,考研就是一个孤单修炼的事情,没有任何人能够去帮你,于是二十出头的我们,从“牛b吊炸天,我要改变全世界”逐渐蜕变成“我要适应这个世界,我要适应孤单”。过去总是赶赴一场又一场热闹,在觥筹交错间,推杯换盏时,说一些违心的话,做一些违心的事,慢慢失去自我。但愿,酒阑人散后,剩下的只有空虚落寞;但愿,灯火阑珊处,留下是考研最美好的回忆。

数据介绍

本文统计的对象为1980年以来英语试卷所包含的词汇,并对其进行了分析和总结。

实现过程

(1)加载基础词汇

代码语言:javascript
复制
bw = open('data/basic_words.txt')
basicwords = []
for eachLine in bw:
    basicwords.append(sw.simplify_word(re.split("[^A-Za-z]", eachLine)[0].lower()))
    #print re.split("[^A-Za-z]", eachLine)[0]
print(len(list(set(basicwords))))
basicwords = list(set(basicwords))

(2)加载超纲词汇

代码语言:javascript
复制
notindagang = np.zeros(33)
chaogangword = {}
for j in range(33):
    for k in wy.eywords[j]:
        if k not in dw.dagangwords and k not in bw.basicwords:
            #notindagang[j] += 1
            if chaogangword.has_key(k):
                chaogangword[k] += 1
            else:
                chaogangword[k] = 1

for j in range(33):
    for k in wy.eywords[j]:
        if k not in dw.dagangwords and k not in bw.basicwords:
            if chaogangword[k] <= 2:
                notindagang[j] += 1
chaogangword = sorted(chaogangword.iteritems(), key = lambda e:e[1], reverse = True)
print('Chaogangword =',chaogangword)
pnotindagang = [float(x) / len(wy.eywords[i]) for i,x in enumerate(notindagang)]

(3)词汇分析

代码语言:javascript
复制
def simplify_word(a):
    #如果已经可以判断是名词,动词,形容词,副词,连词
    if enumerate.is_noun(a) or enumerate.is_verb(a) or enumerate.is_adjective(a) or enumerate.is_adverb(a) or enumerate.is_connective(a):
        return a
    try:#测试是否为动词,如果是则返回
        enumerate.is_verb(enumerate.verb.present(a))
        return enumerate.verb.present(a)
    except:#否则继续检查
        pass
    
    #测试是否是名词
    if enumerate.is_noun(enumerate.noun.singular(a)):
        return enumerate.noun.singular(a)
    otherwordlist.append(a)
    #print a
    return a

(4)加载大纲词汇

代码语言:javascript
复制
dagang = open('data/5495大纲词汇.txt')
dagangwords = []
for eachLine in dagang:
    dagangwords.append(sw.simplify_word(re.split("[^A-Za-z]", eachLine)[0].lower()))
    #print re.split("[^A-Za-z]", eachLine)[0]
print(len(list(set(dagangwords))))
dagangwords = list(set(dagangwords))

(5)考研英语真题单词数据可视化

代码语言:javascript
复制
x33 = 1980*np.ones(33)+range(33)
x32 = 1981*np.ones(32)+range(32)

plt.figure('wordeachyear')
plt.plot(x33,wy.eywords_volume,'r--o',alpha = 0.5)
plt.grid(True)
plt.show()

plt.figure('notindagang')
plt.plot(x33,cgw.notindagang,'o-', alpha = 0.5)
plt.grid(True)
plt.show()

plt.figure('wn')
plt.plot(wy.eywords_volume,cgw.pnotindagang,'bo')
plt.show()


plt.figure('pchaogang')
plt.plot(x33,cgw.pnotindagang,'o-', alpha = 0.5)
plt.grid(True)
plt.show()

plt.figure('notinpast')
plt.bar(x33,nip.words_not_in_the_past, color = 'green', alpha = 0.5)
plt.grid(True)
plt.show()

plt.figure('wordsAppearLastTime')
plt.plot(x32, walt.es, 'b--o', alpha = 0.5)
plt.grid(True)
plt.show()

plt.figure('pwordsAppearLastTime')
#plt.axes([1980, 2013 , 0.35 ,0.6])
plt.plot(x32, walt.esr1, 'r-o')
plt.plot(x32, walt.esr2, 'b--o', alpha = 0.4)
plt.plot(x32, walt.esr3, 'y--o', alpha = 0.4)
plt.grid(True)

plt.show()

https://github.com/zandaoguang/English

或者点击查看原文即可获得源码

考研英语真题词汇统计结果

1.第i+1年出现的从1980~i年间从未出现过的单词

2.第一年真题中出现的单词数

3.每一年都出现的单词

and, have, other, most, last, all, year, way, hi, like, because, your, new, know, english, chinese, if, you, they, this, give, people, he, not, many, question, from, into, such, work, over, would, make, translation, up, in, no, then, an, will, some, section, we, with, these, it, there, which, by, so, one, when, do, those, can, four, be, that, must, of, say, should, than, a, become, at, write, who, on, the, only, to, but, about, or, for

4.相邻年份考研真题词汇重复数

5.相邻年份考研真题词汇重复率

6.计算35年来真题词汇超纲率

7.拟合

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2018-12-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 日常学python 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 用Python分析了1980~2015年考研英语真题词汇,原来考研应该这样考!
    • 概述
      • 前言
        • 数据介绍
          • 实现过程
            • 考研英语真题词汇统计结果
            领券
            问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档