|
|
@@ -537,12 +537,10 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '' |
|
|
|
//自动获取关键词 |
|
|
|
if ($autokey == 1) { |
|
|
|
$subject = $title; |
|
|
|
$message = $body; |
|
|
|
//采用DedeBIZ Core分词组件分词 |
|
|
|
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { |
|
|
|
$keywords = ''; |
|
|
|
$client = new DedeBizClient(); |
|
|
|
$data = $client->Spliteword($subject.Html2Text($message)); |
|
|
|
$keywords = $data->data; |
|
|
|
$client->Close(); |
|
|
|
} else { |
|
|
@@ -552,24 +550,14 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '' |
|
|
|
$sp->SetSource($subject, $cfg_soft_lang); |
|
|
|
$sp->StartAnalysis(); |
|
|
|
$titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); |
|
|
|
$sp->SetSource(Html2Text($message), $cfg_soft_lang); |
|
|
|
$sp->StartAnalysis(); |
|
|
|
$allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); |
|
|
|
if (is_array($allindexs) && is_array($titleindexs)) { |
|
|
|
if (is_array($titleindexs)) { |
|
|
|
foreach ($titleindexs as $k => $v) { |
|
|
|
if (strlen($keywords.$k) >= 60) { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
if (strlen($k) <= 2 || $length == 3) continue; |
|
|
|
$keywords .= $k.','; |
|
|
|
} |
|
|
|
} |
|
|
|
foreach ($allindexs as $k => $v) { |
|
|
|
if (strlen($keywords.$k) >= 60) { |
|
|
|
break; |
|
|
|
} else if (!in_array($k, $titleindexs)) { |
|
|
|
if (strlen($k) <= 2 || $length == 3) continue; |
|
|
|
$keywords .= $k.','; |
|
|
|
if (strlen($k) <= 6 || $length == 3) continue; |
|
|
|
$keywords .= ($keywords == '' ? "{$k}" : ",{$k}"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|