Linguistic corpora 种子语料库-待分析对象-分析与更新语料库
Computational Linguistics
http://matplotlib.org/
https://github.com/matplotlib/matplotlib/blob/master/INSTALL#L59
http://www.nltk.org/book/ch01.html#id9

C:\Users\w>python -m pip install --upgrade pip
Collecting pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.reque
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 14kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1 C:\Users\w>python -m pip install matplotlib
Collecting matplotlib
Downloading matplotlib-1.5.3-cp35-cp35m-win_amd64.whl (6.5MB)
100% |████████████████████████████████| 6.5MB 30kB/s
Collecting pytz (from matplotlib)
Downloading pytz-2016.10-py2.py3-none-any.whl (483kB)
100% |████████████████████████████████| 491kB 35kB/s
Collecting pyparsing!=2.0.4,!=2.1.2,>=1.5.6 (from matplotlib)
Downloading pyparsing-2.1.10-py2.py3-none-any.whl (56kB)
100% |████████████████████████████████| 61kB 29kB/s
Collecting numpy>=1.6 (from matplotlib)
Downloading numpy-1.11.2-cp35-none-win_amd64.whl (7.6MB)
100% |████████████████████████████████| 7.6MB 32kB/s
Collecting cycler (from matplotlib)
Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting python-dateutil (from matplotlib)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 46kB/s
Collecting six (from cycler->matplotlib)
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: pytz, pyparsing, numpy, six, cycler, python-dateutil, matplotlib
Successfully installed cycler-0.10.0 matplotlib-1.5.3 numpy-1.11.2 pyparsing-2.1.10 python-dateutil-2.6.0 pytz-2016.10 six-1.10.0
text4.dispersion_plot(["kate","he","she","jack"])
<p id="w_last" style="color: red; font-size: 6em;">w-WAITING---</p><br>
<?php
include('conn.php');
//http://www.baidu.com/s?wd=%E5%8F%96%E8%8B%B1%E6%96%87%E5%90%8D
$w_db_incr_girl = 0;
for ($w = 0; $w < 153; $w++) {
$wgirl = 'http://api.open.baidu.com/pae/channel/data/asyncqury?appid=4036&srcid=4036&from_mid=1&format=json&ie=utf-8&oe=utf-8&subtitle=%E8%8B%B1%E6%96%87%E5%90%8D&query=%E8%8B%B1%E6%96%87%E5%90%8D&rn=5&stat1=%E5%A5%B3%E7%94%9F&pn=' . (5 * $w) . '&srcid=4036&cb=jQuery110205654252001601794_1481004786057&_=' . (1481004786059 + $w);
$w_file = file_get_contents($wgirl);
$partten = '/\"englishname\"\:\"\w{0,}\"/';
$w_name = preg_match_all($partten, $w_file, $matches, PREG_SET_ORDER);
$tmp = 0;
foreach ($matches AS $one) {
if ($tmp % 3 == 2) {
$given_name = substr($one[0], 15, strlen($one[0]) - 15 - 1);
$sql = 'INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $wgirl . '",0)';
if (mysqli_query($link, $sql)) {
$w_db_incr_girl++;
};
}
$tmp++;
}
} $w_db_incr_boy = 0;
for ($w = 0; $w < 153; $w++) { // $wgirl = 'http://api.open.baidu.com/pae/channel/data/asyncqury?appid=4036&srcid=4036&from_mid=1&format=json&ie=utf-8&oe=utf-8&subtitle=%E8%8B%B1%E6%96%87%E5%90%8D&query=%E8%8B%B1%E6%96%87%E5%90%8D&rn=5&stat1=%E5%A5%B3%E7%94%9F&pn='.(5*$w).'&srcid=4036&cb=jQuery110205654252001601794_1481004786057&_='.(1481004786059+$w); $wboy = 'http://api.open.baidu.com/pae/channel/data/asyncqury?appid=4036&srcid=4036&from_mid=1&format=json&ie=utf-8&oe=utf-8&subtitle=%E8%8B%B1%E6%96%87%E5%90%8D&query=%E8%8B%B1%E6%96%87%E5%90%8D&rn=5&pn=' . (5 * $w) . '&srcid=4036&stat1=%E7%94%B7%E7%94%9F&cb=jQuery1102017382318514491035_1481005337608&_=' . (1481004786059 + $w);
$w_file = file_get_contents($wboy);
$partten = '/\"englishname\"\:\"\w{0,}\"/';
$w_name = preg_match_all($partten, $w_file, $matches, PREG_SET_ORDER); $tmp = 0;
foreach ($matches AS $one) {
if ($tmp % 3 == 2) {
$given_name = substr($one[0], 15, strlen($one[0]) - 15 - 1);
$sql = 'INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $wboy . '",1)';
if (mysqli_query($link, $sql)) {
$w_db_incr_boy++;
};
}
$tmp++;
}
} $w_arr = array_merge(range('A', 'Z'));
//http://ename.dict.cn/list/female/R/2
foreach ($w_arr AS $w_range) {
for ($w = 1; $w < 8; $w++) {
$wgirl = 'http://ename.dict.cn/list/female/' . $w_range . '/' . $w;
$w_file = file_get_contents($wgirl);
$partten = '/' . 'href=\"\/\w{0,}\"\>' . '/';
$w_name = preg_match_all($partten, $w_file, $matches, PREG_SET_ORDER);
foreach ($matches AS $one) {
$given_name = substr($one[0], 7, strlen($one[0]) - 7 - 2);
$sql = 'INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $wgirl . '",0)';
if (mysqli_query($link, $sql)) {
$w_db_incr_girl++;
};
}
} for ($w = 1; $w < 8; $w++) {
$wboy = 'http://ename.dict.cn/list/male/' . $w_range . '/' . $w;
$w_file = file_get_contents($wboy);
$partten = '/' . 'href=\"\/\w{0,}\"\>' . '/';
$w_name = preg_match_all($partten, $w_file, $matches, PREG_SET_ORDER);
foreach ($matches AS $one) {
$given_name = substr($one[0], 7, strlen($one[0]) - 7 - 2);
$sql = 'INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $wboy . '",1)';
if (mysqli_query($link, $sql)) {
$w_db_incr_boy++;
};
}
}
} ?>
<script>
document.getElementById('w_last').innerHTML = 'w_db_incr_girl\'s=<?= $w_db_incr_girl?>,w_db_incr_boy\'s=' +<?= $w_db_incr_boy?>;
</script>
$sql_db_check = 'SEELCT isboy FROM namelist WHERE given_name="'.$given_name.'"';
$check = db_multiple_rows_link($link, $sql_db_check);
if(count($check)==2){
$isboy = 2;
}elseif(count($check)==1){
$isboy = $check['isboy'];
}elseif(count($check)==0){
$w_arr = w_cross_domian_name_isboy($given_name);
//var_dump($w_arr);
$isboy = $w_arr['w_code'];
$grab_url = $w_arr['w_url'];
if($isboy!=4){
if($isboy==1){
$sql_w ='INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $grab_url . '",1)';
}elseif($isboy==0){
$sql_w ='INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $grab_url . '",0)';
}elseif($isboy==2){
$sql_w ='INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $grab_url . '",1)'.';';
$sql_w .='INSERT INTO namelist (given_name,grab_url,isboy) VALUES ("' . $given_name . '","' . $grab_url . '",0)';
}
// var_dump($sql_w);
mysqli_multi_query($link,$sql_w);
function w_given_name($wstr)
{
$given_name = strstr($wstr, ' ', TRUE);
if (empty($given_name)) $given_name = ltrim($wstr);
$given_name = strtoupper(substr($given_name, 0, 1)) . strtolower(substr($given_name, 1));
RETURN $given_name;
} //http://dict.youdao.com/w/eng/Tommy/#keyfrom=dict2.index
//http://dict.youdao.com/w/eng/Chris/#keyfrom=dict2.index
//http://dict.youdao.com/w/eng/Billie/#keyfrom=dict2.index
//http://dict.youdao.com/w/eng/Mikhael/#keyfrom=dict2.index
function w_cross_domian_name_isboy($name)
{
$url = 'http://dict.youdao.com/w/eng/' . $name . '/#keyfrom=dict2.index';
$w_file = file_get_contents($url);
// $wfile = fopen('w.w', 'w');
//fwrite($wfile, $w_file); $partten = '/' . '您要找的是不是' . '/';
preg_match_all($partten, $w_file, $matches_spell, PREG_SET_ORDER);
if (!empty($matches_spell)) {
} else {
$partten = '/' . '男子名' . '/';
preg_match_all($partten, $w_file, $matches_boy, PREG_SET_ORDER);
$partten = '/' . '女子名' . '/';
preg_match_all($partten, $w_file, $matches_girl, PREG_SET_ORDER);
} $w = array();
$w['w_url'] = $url;
$w['w_code'] = 4;
if (!empty($matches_spell) || (empty($matches_boy) && empty($matches_girl))) {
} elseif (!empty($matches_boy) && !empty($matches_girl)) {
$w['w_code'] = 2;
} elseif (!empty($matches_boy)) {
$w['w_code'] = 1;
} elseif (!empty($matches_girl)) {
$w['w_code'] = 0;
}
RETURN $w;
}
Linguistic corpora 种子语料库-待分析对象-分析与更新语料库的更多相关文章
- .Net 内存对象分析
在生产环境中,通过运行日志我们会发现一些异常问题,此时,我们不能直接拿VS远程到服务器上调试,同时日志输出的信息无法百分百反映内存中对象的状态,比如说我们想查看进程中所有的Socket连接状态.服务路 ...
- 序列化与反序列化、def的介绍与快速使用、cbv源码分析、APIView与request对象分析
今日内容概要 序列化与反序列化 def介绍和快速使用 cbv源码流程分析 drf之APIView和Request对象分析 内容详细 1.序列化和反序列化 # api接口开发 最核心最常见的一个过程就是 ...
- mybatis 04: mybatis对象分析 + 测试代码简化 + 配置优化
MyBatis对象分析 测试代码示例 package com.example.test; import com.example.pojo.Student; import org.apache.ibat ...
- Android核心分析 之一分析方法论探讨之设计意图
为什么要研究Android,是因为它够庞大,它够复杂,他激起了我作为一个程序员的内心的渴望,渴望理解这种复杂性.我研究的对象是作为手机开发平台的Android软件系统部分,而不是Dalvik虚拟机本身 ...
- MapReduce源代码分析MapTask分析
前言 MapReduce该分析是基于源代码Hadoop1.2.1代码分析进行的基础上. 该章节会分析在MapTask端的详细处理流程以及MapOutputCollector是怎样处理map之后的col ...
- x264源代码 概述 框架分析 架构分析
函数背景色 函数在图中以方框的形式表现出来.不同的背景色标志了该函数不同的作用: 白色背景的函数:不加区分的普通内部函数. 浅红背景的函数:libx264类库的接口函数(API). 粉红色背景函数:滤 ...
- 转:[gevent源码分析] 深度分析gevent运行流程
[gevent源码分析] 深度分析gevent运行流程 http://blog.csdn.net/yueguanghaidao/article/details/24281751 一直对gevent运行 ...
- Qt Creator Valgrind内存分析前端(分析Nginx内存)
Linux上使用Qt Creator进行C/C++开发http://my.oschina.net/eechen/blog/166969Qt Creator GDB调试前端(调试Nginx):http: ...
- Python之路,Day22 - 网站用户访问质量分析监测分析项目开发
Python之路,Day22 - 网站用户访问质量分析监测分析项目开发 做此项目前请先阅读 http://3060674.blog.51cto.com/3050674/1439129 项目实战之 ...
随机推荐
- 关于html5不支持frameset的解决方法
转自:http://blog.sina.com.cn/s/blog_b2813a790101ejvf.html html5已经不支持frameset了,很郁闷,看了大家的解决方法,无非就是两种1. 使 ...
- Android调用WebService(转)
Android调用WebService WebService是一种基于SOAP协议的远程调用标准,通过 webservice可以将不同操作系统平台.不同语言.不同技术整合到一块.在Android SD ...
- jq查找父类元素三个函数的区别
parent是找当前元素的第一个父节点,parents是找当前元素的所有父节点 parent().parents()与closest()方法两两之间有类似又有不同,本篇简短的区分一下这三个方法.通过本 ...
- 在Windows Server 2008中安装IIS
1.右键“我的电脑”,选择“管理”,打开“服务器管理器” 2.点击左边菜单栏“角色”调出角色窗口 3.接着点击“添加角色”,弹出添加“角色向导” 4.点击“下一步”进入服务器角色选项 5.勾选“Web ...
- this和$(this)区别
This代表当前元素,是javascript关键词中的一个,表示上下文中的当前DOM元素,不能调用Jquery方法: $(this)返回一个Jquery对象,可调用多个方法.
- 递推DP URAL 1353 Milliard Vasya's Function
题目传送门 /* 题意:1~1e9的数字里,各个位数数字相加和为s的个数 递推DP:dp[i][j] 表示i位数字,当前数字和为j的个数 状态转移方程:dp[i][j] += dp[i-1][j-k] ...
- css构造文本
1. 1. 文本缩进text-indent:值:值为数字,最常用的数值单位是px(像素),也可以直接是百分比!text-indent:100px;text-indent:10%;2. 文本对齐text ...
- 【SPOJ】7258. Lexicographical Substring Search(后缀自动机)
http://www.spoj.com/problems/SUBLEX/ 后缀自动机系列完成QAQ...撒花..明天or今晚写个小结? 首先得知道:后缀自动机中,root出发到任意一个状态的路径对应一 ...
- 【POJ】A New Stone Game(博弈论)
http://poj.org/problem?id=1740 题目大意就是,对于n堆石子,每堆若干个,两人轮流操作,每次操作分两步,第一步从某堆中去掉至少一个,第二步(可省略)把该堆剩余石子的一部分分 ...
- Java_BigDecimal类型比较大小
这个类是java里精确计算的类 1 比较对象是否相等 一般的对象用equals,但是BigDecimal比较特殊,举个例子: BigDecimal a=BigDecimal.valueOf(1.0); ...