李亮1975重庆
语料库快乐军政委
汉语叠词就是“气呼呼、笑嘻嘻、胖嘟嘟、摇摇晃晃、悠哉悠哉”,也就是ABB、ABAB、AABB这三类。吾用HTA技术为骨头,以javascript为灵魂,以HTML为肌肤,制作了一个“小精灵”,欢迎体验和付诸科研实战!
如果对HTA技术产生兴趣,希望入门,可阅读我的“概论”教程
http://www.docin.com/p-672594294.html
下载地址是在我的百度网盘
http://pan.baidu.com/share/home?uk=724520607&view=share#category/type=0
源代码如下……
<!DOCTYPE html>
<html>
<head>
<script>
function smart_add(str) {
var txt2=document.getElementById("area2").value;
if(txt2.indexOf(str)==-1) document.getElementById("area2").value=document.getElementById("area2").value+str+"\n";
}
function get_abb() {
var txt=document.getElementById("area1").value;
document.getElementById("area2").value="";
if(txt.length<4) alert("too few characters!");
if(txt.length>3)
{
for(var c=0;c<txt.length-3;c++)
{
var char1=txt.charAt(c);
var char2=txt.charAt(c+1);
var char3=txt.charAt(c+2);
var char4=txt.charAt(c+3);
var char123=char1+char2+char3;
var char234=char2+char3+char4;
if(char2!=" " && char3!=" " && char1!=char2 && char2==char3 && char3!=char4)
{ smart_add(char123); }
if(char2!=" " && char3!=" " && char1!=char2 && char2!=char3 && char3==char4)
{ smart_add(char234); }
}
}
}
function get_abab() {
var txt=document.getElementById("area1").value;
document.getElementById("area2").value="";
if(txt.length<4) alert("too few characters!");
if(txt.length>3)
{
for(var c=0;c<txt.length-3;c++)
{
var char1=txt.charAt(c);
var char2=txt.charAt(c+1);
var char3=txt.charAt(c+2);
var char4=txt.charAt(c+3);
var char1234=char1+char2+char3+char4;
if(char1!=" " && char2!=" " && char3!=" " && char4!=" " && char1!=char2 && char2==char4 && char3!=char4 && char1==char3 )
{ smart_add(char1234); }
}
}
}
function get_aabb() {
var txt=document.getElementById("area1").value;
document.getElementById("area2").value="";
if(txt.length<4) alert("too few characters!");
if(txt.length>3)
{
for(var c=0;c<txt.length-3;c++)
{
var char1=txt.charAt(c);
var char2=txt.charAt(c+1);
var char3=txt.charAt(c+2);
var char4=txt.charAt(c+3);
var char1234=char1+char2+char3+char4;
if(char1!=" " && char2!=" " && char3!=" " && char4!=" " && char1==char2 && char3==char4 && char2!=char3 )
{ smart_add(char1234); }
}
}
}
</script>
</head>
<body>
<h3>开发者:李亮(计算词典学方向,QQ:492130980) 2013-12-20制作</h3>
<h3>广东外语外贸大学 词典学研究中心</h3>
<br /><br />
把数据拷贝到左侧文本框,点击相应按钮则右侧文本框出现处理结果哟!<br /><br />
<textarea cols="30" rows="10" id="area1"></textarea>
<textarea cols="30" rows="10" id="area2"></textarea>
<br /><br />
<input type="button" value="get ABB" onclick="get_abb()" />
<input type="button" value="get ABAB" onclick="get_abab()" />
<input type="button" value="get AABB" onclick="get_aabb()" />
</body>
</html>
如果对HTA技术产生兴趣,希望入门,可阅读我的“概论”教程
http://www.docin.com/p-672594294.html
下载地址是在我的百度网盘
http://pan.baidu.com/share/home?uk=724520607&view=share#category/type=0
源代码如下……
<!DOCTYPE html>
<html>
<head>
<script>
function smart_add(str) {
var txt2=document.getElementById("area2").value;
if(txt2.indexOf(str)==-1) document.getElementById("area2").value=document.getElementById("area2").value+str+"\n";
}
function get_abb() {
var txt=document.getElementById("area1").value;
document.getElementById("area2").value="";
if(txt.length<4) alert("too few characters!");
if(txt.length>3)
{
for(var c=0;c<txt.length-3;c++)
{
var char1=txt.charAt(c);
var char2=txt.charAt(c+1);
var char3=txt.charAt(c+2);
var char4=txt.charAt(c+3);
var char123=char1+char2+char3;
var char234=char2+char3+char4;
if(char2!=" " && char3!=" " && char1!=char2 && char2==char3 && char3!=char4)
{ smart_add(char123); }
if(char2!=" " && char3!=" " && char1!=char2 && char2!=char3 && char3==char4)
{ smart_add(char234); }
}
}
}
function get_abab() {
var txt=document.getElementById("area1").value;
document.getElementById("area2").value="";
if(txt.length<4) alert("too few characters!");
if(txt.length>3)
{
for(var c=0;c<txt.length-3;c++)
{
var char1=txt.charAt(c);
var char2=txt.charAt(c+1);
var char3=txt.charAt(c+2);
var char4=txt.charAt(c+3);
var char1234=char1+char2+char3+char4;
if(char1!=" " && char2!=" " && char3!=" " && char4!=" " && char1!=char2 && char2==char4 && char3!=char4 && char1==char3 )
{ smart_add(char1234); }
}
}
}
function get_aabb() {
var txt=document.getElementById("area1").value;
document.getElementById("area2").value="";
if(txt.length<4) alert("too few characters!");
if(txt.length>3)
{
for(var c=0;c<txt.length-3;c++)
{
var char1=txt.charAt(c);
var char2=txt.charAt(c+1);
var char3=txt.charAt(c+2);
var char4=txt.charAt(c+3);
var char1234=char1+char2+char3+char4;
if(char1!=" " && char2!=" " && char3!=" " && char4!=" " && char1==char2 && char3==char4 && char2!=char3 )
{ smart_add(char1234); }
}
}
}
</script>
</head>
<body>
<h3>开发者:李亮(计算词典学方向,QQ:492130980) 2013-12-20制作</h3>
<h3>广东外语外贸大学 词典学研究中心</h3>
<br /><br />
把数据拷贝到左侧文本框,点击相应按钮则右侧文本框出现处理结果哟!<br /><br />
<textarea cols="30" rows="10" id="area1"></textarea>
<textarea cols="30" rows="10" id="area2"></textarea>
<br /><br />
<input type="button" value="get ABB" onclick="get_abb()" />
<input type="button" value="get ABAB" onclick="get_abab()" />
<input type="button" value="get AABB" onclick="get_aabb()" />
</body>
</html>