[問題] 關鍵字密度code

作者: lkm981324 (stinkytofuhaha)   2018-10-19 12:43:18
我目前在研究這個網站 https://www.live-keyword-analysis.com/ 的code
其中有一些問題想請各位高手解答
在funjay.js這檔案裡
Q1:
if (index >= 0)
{
pindex = bodyl.indexOf(">",index);
bodyank=bodyl.substring(index,pindex+1);
bodyl=bodyl.replace(bodyank," ");
}
最後一行為什麼要replace空白字元
Q2:
bodyl=rm_ext_char.split(" ");
rm_s_d="";
full_text="";
count=0
for(i=0; i<bodyl.length; i++){
rm_s_d=bodyl[i];
if (rm_s_d.length>2){
count=count+1;
full_text=full_text+" "+rm_s_d;
}
}
最後一行+rm_s_d的目的是什麼
Q3:
while(countkf>=0){
if (countkf>=0.1 && countkf<0.2)
{
countkf = full_text.indexOf(kf,0);
}
else
{
end=countkf+kf.length;
countkf = full_text.indexOf(kf,end);
}
if (countkf >= 0)
{
kftotal=kftotal+1;
}
}
if (kslen.length>count)
document.frm1.r1.value=0;
else
document.frm1.r1.value=math_round(kftotal/(count+1-kslen.length)*100,1);
這段判斷條件為什麼要這樣去設定,看不懂他的邏輯
感謝~~
作者: diabloevagto (wi)   2018-10-19 13:04:00
你有試著用中斷點單步執行看每一個變數的數值嗎
作者: jfcherng (小霹靂)   2018-10-19 22:14:00
上一篇文是不是被刪了
作者: KKbiger (UUUU)   2018-10-20 16:45:00
現在很多前端的code都會用webpack去打包壓縮去搞懂那些打包後的code 說真的沒什麼學習意思要研究關鍵字的密度你還不如去往機器學習深度學習那邊走
作者: vi000246 (Vi)   2018-10-20 21:15:00
你這樣問也沒人知道啊

Links booklink

Contact Us: admin [ a t ] ucptt.com