');
var line = [];
var a = hash["incident"].split(" ");
for(var j in a) {
if(a[j] == "") continue;
var ar = a[j].split(":");
if(ar.length == 1) {
if(zyutugohash[ar[0]] != null) line.push('' + ar[0].specialword2html() + '');
else line.push(a[j].specialword2html());
}
else if(ar.length == 2) {
if(zyutugohash[ar[0]] != null) line.push('' + ar[0].specialword2html() + '' + " (" + ar[1].specialword2html() + ")");
else line.push(a[j].specialword2html());
}
}
if(hash["text"] != "") arr.push('
【説明】
' + hash["text"].html2specialword() + '
');
if(hash["incident"] != "") arr.push('
【関連述語】
' + line.join(" , ") + '
');
if(hash["sample"] != "") arr.push('
【実行例】
' + hash["sample"].html2specialword() + '
');
arr.push('
');
arr.push('
');
arr.push('
');
$("#res_body").append(arr.join(""));
//checkExpand(hash.id);
}
}
}
// 2014.11.28 Add by H.O. ----- [ End ] -----
function zyutugoonly_write(){
$("#searchbox").val(findbox_write);
finddata(findbox_write,true,'all');
}
function checkExpand(id) {
var elm = document.getElementById("trzyutugo_"+id);
if((elm)&&(elm.style)){
elm.style.display = (elm.style.display=="none")? "" : "none"
arrow_change(id,(elm.style.display=="")? true:false);
}
}
function arrow_change(id,bool){
var elm = document.getElementById("image_"+id);
if((elm)&&(elm.style)){
elm.src = (bool)? "../images/arrow_after.png":"../images/arrow.png"
elm.width = (bool)? 10:6;
elm.height = (bool)? 6:10;
}
}
String.prototype.indexOfCnt = function(word,bool){
bool = (bool==null)? false:bool;
var s = this.toString();
var cnt=0;
if (bool){word=word.toUpperCase(); s=s.toUpperCase();}
return s.split(word).length -1;
};
function finddata(word){
$("#res_body").find("tr").remove();
if (word == ""){
if (location.href.indexOf("_abc.html")==-1) kinoubetu_write();
return;
}
var hashs = [];
word = word.replace(/ /g," ");
var arr = word.split(" ");
var res = [];
if (word!="printall"){
azlist.sort(function(a, b) {return a["name"] > b["name"] ? 1 : -1;});
for (var i in azlist){
var bool ={};
var per = 0;
for (var j in arr){
bool[j] = false;
var cnt = azlist[i]["name"].indexOfCnt(arr[j],true);
if (cnt>0){ per += 10*cnt/azlist[i]["name"].replace(/\ .+/,"").length; bool[j]=true;}
cnt = azlist[i]["text"].split("。")[0].indexOfCnt(arr[j],true);
if (cnt>0){per += 3*cnt/azlist[i]["text"].split("。")[0].length;bool[j]=true;}
cnt = azlist[i]["text"].indexOfCnt(arr[j],true);
if (cnt>0){per += cnt/azlist[i]["text"].length;bool[j]=true;}
}
var hash = azlist[i];
hash.percent = per;
var b = true;
for (var j in bool){if(!bool[j]) b=false;}
if (b) hashs.push(hash);
}
hashs.sort(function(a, b) {return a["percent"] < b["percent"] ? 1 : -1;});
zyutugo_tablewrite(hashs,false,false);
$('#highlight-plugin').removeHighlight();
for (var j in arr) if(arr[j]!="") $('#highlight-plugin').highlight(arr[j]);
if (findbox_write.indexOf("/")>-1){
checkExpand(hashs[0].id);
}
findbox_write="";
} else {
azlist.sort(function(a, b) {return a["name"] > b["name"] ? 1 : -1;});
zyutugo_tablewrite(azlist,true,false);
}
}
function sakuinfind(word){
$("#searchbox").val("");
if (word=="記号") word = "\\W";
else if (word=="全て") word = ".*";
var re = new RegExp("^"+word,"i");
azlist.sort(function(a, b) {return a["name"] > b["name"] ? 1 : -1;});
var arr=[];
for (var i in azlist){ if (azlist[i]["name"].match(re)) arr.push(azlist[i]);}
zyutugo_tablewrite(arr,true,false);
}
function kinoubetu_write(){
for (var i in azlist){if(!azlist[i]["genre2"]) azlist[i]["genre2"] = genrelist.length;}
azlist.sort(function(a, b) {
if (parseInt(a["genre2"]) < parseInt(b["genre2"]) ) return -1;
if (parseInt(a["genre2"]) > parseInt(b["genre2"]) ) return 1;
if (a["name"] < b["name"]) return -1;
if (a["name"] > b["name"]) return 1;
return 0;
});
zyutugo_tablewrite(azlist,false,true);
}
function zyutugo_tablewrite(hashs,expand,bool){
$("#res_body").find("tr").remove();
var genre_before = 0;
for (var i in hashs){
var hash = hashs[i];
if (hash==null) continue;
if ((hash.used=="false")||(hash.used==false)) continue;
if (hash["name"]=="") continue;
var arr = [];
if (bool){
if (genre_before != hash["genre"]){
arr.push('
' + '' + g_name + ' ');
}
// 2014.11.25 Add by H.O. ----- [ End ] -----
if (hash["name"]!="") arr.push('
【述語】
'+hash["name"].specialword2html()+'
');
if (hash["format"]!="") arr.push('
【書式】
'+hash["format"].specialword2html()+'
');
if (hash["argument"]!="") arr.push('
【引数】
'+hash["argument"].html2specialword()+'
');
var line = [];
var a = hash["incident"].split(" ");
for (var i in a){
if (a[i]=="") continue;
var ar = a[i].split(":");
if (ar.length==1){
if(zyutugohash[ar[0]]!=null) line.push('' + ar[0].specialword2html() + '');
else line.push(a[i].specialword2html());
} else if (ar.length==2){
if(zyutugohash[ar[0]]!=null) line.push('' + ar[0].specialword2html() + '' + " (" + ar[1].specialword2html() + ")");
else line.push(a[i].specialword2html());
}
}
if (hash["text"]!="") arr.push('
【説明】
'+hash["text"].html2specialword()+'
');
if (hash["incident"]!="") arr.push('
【関連述語】
'+line.join(" , ")+'
');
if (hash["sample"]!="") arr.push('
【実行例】
'+hash["sample"].html2specialword()+'
');
arr.push('
');
arr.push('
');
arr.push('
');
$("#res_body").append(arr.join(""));
//$("#restable").find('tbody').append(arr.join(""));
if (expand) checkExpand(hash.id);
}
}
function incident_close(id){$("#"+id).html("");}
function incident_write(id,name){
var hash = {};
for (var i in azlist){
var arr = azlist[i]["name"].split(" ");
for(var j in arr) if (arr[j]==name) hash=azlist[i];
}
var list = [];
list.push('
');
list.push((hash["common"].match("ISO"))? 'ISO':"");
list.push((hash["common"].match("Win"))? ' for Windows':"");
list.push((hash["common"].match("Linux"))? ' for Linux':"");
list.push('
');
list.push('
');
list.push('
');
var line = [];
var a = hash["incident"].split(" ");
for (var i in a){
if (a[i]=="") continue;
var ar = a[i].split(":");
if (ar.length==1){
if(zyutugohash[ar[0]]!=null) line.push(ar[0].specialword2html());
else line.push(a[i].specialword2html());
} else if (ar.length==2){
if(zyutugohash[ar[0]]!=null) line.push(ar[0].specialword2html() + " (" + ar[1].specialword2html() + ")");
else line.push(a[i].specialword2html());
}
}
list.push('