dict_lookup.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <?php
  2. //查询参考字典
  3. include("../log/pref_log.php");
  4. require_once '../path.php';
  5. require_once '../public/casesuf.inc';
  6. require_once '../public/union.inc';
  7. require_once "../public/_pdo.php";
  8. require_once "../public/load_lang.php"; //语言文件
  9. require_once "../public/function.php";
  10. require_once "../search/word_function.php";
  11. require_once "../ucenter/active.php";
  12. require_once "../ucenter/function.php";
  13. require_once "../dict/p_ending.php";
  14. require_once "../redis/function.php";
  15. global $redis;
  16. $redis = redis_connect();
  17. global $count_return;
  18. $count_return = 0;
  19. $word = mb_strtolower($_GET["word"], 'UTF-8');
  20. $org_word = $word;
  21. global $dict_list;
  22. $dict_list = array();
  23. $right_word_list = "";
  24. add_edit_event(_DICT_LOOKUP_, $word);
  25. echo "<div id='dict_ref'>";
  26. #先查原词
  27. echo "<div class='pali_spell'><a name='{word_$word}'></a>" . $word . "</div>";
  28. $dict_list_a = [];
  29. //社区字典开始
  30. echo lookup_user($word);
  31. //社区字典结束
  32. echo lookup_term($word);
  33. PDO_Connect("" . _FILE_DB_REF_);
  34. //直接查询
  35. $query = "SELECT dict.dict_id,dict.mean,info.shortname from " . _TABLE_DICT_REF_ . " LEFT JOIN info ON dict.dict_id = info.id where word = ? limit 0,100";
  36. $Fetch = PDO_FetchAll($query, array($word));
  37. $iFetch = count($Fetch);
  38. echo "直接查询{$iFetch}<br>";
  39. $count_return += $iFetch;
  40. if ($iFetch > 0) {
  41. for ($i = 0; $i < $iFetch; $i++) {
  42. $mean = $Fetch[$i]["mean"];
  43. $dictid = $Fetch[$i]["dict_id"];
  44. $dict_list[$dictid] = $Fetch[$i]["shortname"];
  45. $dict_list_a[] = array("ref_dict_$dictid", $Fetch[$i]["shortname"]);
  46. $outXml = "<div class='dict_word'>";
  47. $outXml = $outXml . "<a name='ref_dict_$dictid'></a>";
  48. $outXml = $outXml . "<div class='dict'>" . $Fetch[$i]["shortname"] . "</div>";
  49. $outXml = $outXml . "<div class='mean'>" . $mean . "</div>";
  50. $outXml = $outXml . "</div>";
  51. echo $outXml;
  52. }
  53. }
  54. //去格位除尾查
  55. $newWord = array();
  56. for ($row = 0; $row < count($case); $row++) {
  57. $len = mb_strlen($case[$row][1], "UTF-8");
  58. $end = mb_substr($word, 0 - $len, null, "UTF-8");
  59. if ($end == $case[$row][1]) {
  60. $base = mb_substr($word, 0, mb_strlen($word, "UTF-8") - $len, "UTF-8") . $case[$row][0];
  61. if ($base != $word) {
  62. $thiscase = "";
  63. $arrCase = explode('$', $case[$row][2]);
  64. foreach ($arrCase as $value) {
  65. $caseid = "grammar_" . str_replace('.', '', $value);
  66. $thiscase .= "<guide gid='$caseid'>$value</guide>";
  67. }
  68. if (isset($newWord[$base])) {
  69. $newWord[$base] .= "<br />" . $thiscase;
  70. } else {
  71. $newWord[$base] = $thiscase;
  72. }
  73. }
  74. }
  75. }
  76. $base_list = array();
  77. if (count($newWord) > 0) {
  78. foreach ($newWord as $x => $x_value) {
  79. $titleHas = false;
  80. $userDictStr = lookup_user($x);
  81. $termDictStr = lookup_term($x);
  82. if(!empty($userDictStr) || !empty($termDictStr)){
  83. echo "<div class='pali_spell'><a name='word_$x'></a>" . $x . "</div>";
  84. $titleHas = true;
  85. }
  86. $query = "SELECT dict.dict_id,dict.mean,info.shortname from " . _TABLE_DICT_REF_ . " LEFT JOIN info ON dict.dict_id = info.id where word = ? limit 0,30";
  87. $Fetch = PDO_FetchAll($query, array($x));
  88. $iFetch = count($Fetch);
  89. $count_return += $iFetch;
  90. if ($iFetch > 0) {
  91. $base_list[] = $x;
  92. $dict_list_a[] = array("word_$x", $x);
  93. if(!$titleHas){
  94. echo "<div class='pali_spell'><a name='word_$x'></a>" . $x . "</div>";
  95. }
  96. //语法信息
  97. foreach ($_local->grammastr as $gr) {
  98. $x_value = str_replace($gr->id, $gr->value, $x_value);
  99. }
  100. echo "<div class='dict_find_gramma'>" . $x_value . "</div>";
  101. echo $userDictStr;
  102. echo $termDictStr;
  103. for ($i = 0; $i < $iFetch; $i++) {
  104. $mean = $Fetch[$i]["mean"];
  105. $dictid = $Fetch[$i]["dict_id"];
  106. $dict_list[$dictid] = $Fetch[$i]["shortname"];
  107. $dict_list_a[] = array("ref_dict_$dictid", $Fetch[$i]["shortname"]);
  108. echo "<div class='dict_word'>";
  109. echo "<a name='ref_dict_$dictid'></a>";
  110. echo "<div class='dict'>" . $Fetch[$i]["shortname"] . "</div>";
  111. echo "<div class='mean'>" . $mean . "</div>";
  112. echo "</div>";
  113. }
  114. }
  115. }
  116. }
  117. //去除尾查结束
  118. //去分词除尾查
  119. $arrBase = array();
  120. if (count($newWord) > 0) {
  121. foreach ($newWord as $base => $grammar){
  122. for ($row = 0; $row < count($p_ending); $row++) {
  123. $len = mb_strlen($p_ending[$row][1], "UTF-8");
  124. $end = mb_substr($base, 0 - $len, null, "UTF-8");
  125. if ($end == $p_ending[$row][1]) {
  126. $newbase = mb_substr($base, 0, mb_strlen($base, "UTF-8") - $len, "UTF-8") . $p_ending[$row][0];
  127. if ($newbase != $base) {
  128. $thiscase = "";
  129. $arrCase = explode('$', $p_ending[$row][2]);
  130. foreach ($arrCase as $value) {
  131. $caseid = "grammar_" . str_replace('.', '', $value);
  132. $thiscase .= "<guide gid='$caseid'>$value</guide>";
  133. }
  134. if (isset($arrBase[$newbase])) {
  135. $arrBase[$newbase]['grammar'] .= "<br />" . $thiscase;
  136. } else {
  137. $arrBase[$newbase]['grammar'] = $thiscase;
  138. $arrBase[$newbase]['parent'] = $base;
  139. }
  140. }
  141. }
  142. }
  143. }
  144. $base_list = array();
  145. if (count($arrBase) > 0) {
  146. foreach ($arrBase as $x => $x_value) {
  147. $query = "SELECT dict.dict_id,dict.mean,info.shortname from " . _TABLE_DICT_REF_ . " LEFT JOIN info ON dict.dict_id = info.id where word = ? limit 0,30";
  148. $Fetch = PDO_FetchAll($query, array($x));
  149. $iFetch = count($Fetch);
  150. $count_return += $iFetch;
  151. if ($iFetch > 0) {
  152. $base_list[] = $x;
  153. $dict_list_a[] = array("word_$x", $x);
  154. echo "<div class='pali_spell'><a name='word_$x'></a>" . $x . "</div>";
  155. echo "<div style='color:gray;'>{$x}➡{$x_value["parent"]}➡{$word}</div>";
  156. //替换为本地语法信息
  157. foreach ($_local->grammastr as $gr) {
  158. $x_value['grammar'] = str_replace($gr->id, $gr->value, $x_value['grammar']);
  159. }
  160. echo "<div class='dict_find_gramma'>" . $x_value['grammar'] . "</div>";
  161. for ($i = 0; $i < $iFetch; $i++) {
  162. $mean = $Fetch[$i]["mean"];
  163. $dictid = $Fetch[$i]["dict_id"];
  164. $dict_list[$dictid] = $Fetch[$i]["shortname"];
  165. $dict_list_a[] = array("ref_dict_$dictid", $Fetch[$i]["shortname"]);
  166. echo "<div class='dict_word'>";
  167. echo "<a name='ref_dict_$dictid'></a>";
  168. echo "<div class='dict'>" . $Fetch[$i]["shortname"] . "</div>";
  169. echo "<div class='mean'>" . $mean . "</div>";
  170. echo "</div>";
  171. }
  172. }
  173. }
  174. }
  175. }
  176. //去除尾查结束
  177. echo "<div id='search_summary'>";
  178. echo "查询{$word} 共{$count_return}条 ";
  179. if(count($base_list)>0){
  180. echo "找到可能的拼写: ";
  181. foreach ($base_list as $key => $value) {
  182. # code...
  183. echo "<a>{$value}</a> ";
  184. }
  185. }
  186. echo "<a>查询内文</a>";
  187. echo "</div>";
  188. echo "<input type='hidden' id='word_count' value='{$count_return}' />";
  189. //查连读词
  190. /*
  191. if ($count_return < 2) {
  192. echo "<div>Junction</div>";
  193. $newWord = array();
  194. for ($row = 0; $row < count($un); $row++) {
  195. $len = mb_strlen($un[$row][1], "UTF-8");
  196. $end = mb_substr($word, 0 - $len, null, "UTF-8");
  197. if ($end == $un[$row][1]) {
  198. $base = mb_substr($word, 0, mb_strlen($word, "UTF-8") - $len, "UTF-8") . $un[$row][0];
  199. $arr_un = explode("+", $base);
  200. foreach ($arr_un as $oneword) {
  201. echo "<a onclick='dict_pre_word_click(\"$oneword\")'>$oneword</a> + ";
  202. }
  203. echo "<br />";
  204. }
  205. }
  206. }
  207. */
  208. //拆复合词
  209. echo "<div id='auto_split'></div>";
  210. //查内容
  211. if ($count_return < 4) {
  212. $word1 = $org_word;
  213. $wordInMean = "%$org_word%";
  214. echo "包含 $org_word 的:<br />";
  215. $query = "SELECT dict.dict_id,dict.word,dict.mean,info.shortname from " . _TABLE_DICT_REF_ . " LEFT JOIN info ON dict.dict_id = info.id where mean like ? limit 0,30";
  216. $Fetch = PDO_FetchAll($query, array($wordInMean));
  217. $iFetch = count($Fetch);
  218. $count_return += $iFetch;
  219. if ($iFetch > 0) {
  220. for ($i = 0; $i < $iFetch; $i++) {
  221. $mean = $Fetch[$i]["mean"];
  222. $pos = mb_stripos($mean, $word, 0, "UTF-8");
  223. if ($pos) {
  224. if ($pos > 20) {
  225. $start = $pos - 20;
  226. } else {
  227. $start = 0;
  228. }
  229. $newmean = mb_substr($mean, $start, 100, "UTF-8");
  230. } else {
  231. $newmean = $mean;
  232. }
  233. $pos = mb_stripos($newmean, $word1, 0, "UTF-8");
  234. $head = mb_substr($newmean, 0, $pos, "UTF-8");
  235. $mid = mb_substr($newmean, $pos, mb_strlen($word1, "UTF-8"), "UTF-8");
  236. $end = mb_substr($newmean, $pos + mb_strlen($word1, "UTF-8"), null, "UTF-8");
  237. $heigh_light_mean = "$head<hl>$mid</hl>$end";
  238. echo "<div class='dict_word'>";
  239. echo "<div class='pali'><a href='index.php?key={$Fetch[$i]["word"]}'>" . $Fetch[$i]["word"] . "</a></div>";
  240. echo "<div class='dict'>" . $Fetch[$i]["shortname"] . "</div>";
  241. echo "<div class='mean'>" . $heigh_light_mean . "</div>";
  242. echo "<div><a href='index.php?key={$Fetch[$i]["word"]}&hightlight={$org_word}'>详情</a></div>";
  243. echo "</div>";
  244. }
  245. }
  246. }
  247. else{
  248. }
  249. echo "<div id='dictlist'>";
  250. foreach ($dict_list_a as $x_value) {
  251. if (substr($x_value[0], 0, 4) == "word") {
  252. echo "<div class='pali_spell'>";
  253. echo "<a href='#{$x_value[0]}'>$x_value[1]</a></div>";
  254. } else {
  255. echo "<div><a href='#{$x_value[0]}'>$x_value[1]</a></div>";
  256. }
  257. }
  258. echo "<div>";
  259. $arrWords = countWordInPali($word, true);
  260. $weight = 0;
  261. foreach ($arrWords as $oneword) {
  262. $weight += $oneword["count"] * $oneword["len"];
  263. }
  264. //echo "<div>{$_local->gui->word_weight}:$weight {$_local->gui->characters}</div>";
  265. //echo "<div>{$_local->gui->real_declension}:".count($arrWords)." {$_local->gui->forms}</div>";
  266. $right_word_list .= "<div>{$_local->gui->word_weight}:$weight {$_local->gui->characters}</div>";
  267. $right_word_list .= "<div>{$_local->gui->real_declension}:" . count($arrWords) . " {$_local->gui->forms}</div>";
  268. foreach ($arrWords as $oneword) {
  269. if ($oneword["bold"] > 0) {
  270. //echo "<div><b>{$oneword["word"]}</b> {$oneword["count"]} {$_local->gui->times}</div>";
  271. $right_word_list .= "<div><b>{$oneword["word"]}</b> {$oneword["count"]} {$_local->gui->times}</div>";
  272. } else {
  273. //echo "<div>{$oneword["word"]} {$oneword["count"]}{$_local->gui->times}</div>";
  274. $right_word_list .= "<div>{$oneword["word"]} {$oneword["count"]}{$_local->gui->times}</div>";
  275. }
  276. }
  277. echo "</div>";
  278. echo "</div>";
  279. echo "</div>";
  280. //参考字典查询结束
  281. //用户词典编辑窗口
  282. echo "<div id='dict_user' >";
  283. echo "<div><a href='word_statistics.php?word={$word}'>";
  284. echo "<svg t='1596783175334' class='icon' style='font-size: xxx-large; fill: var(--link-hover-color); margin: 5px;' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='7755' width='200' height='200'><path d='M1019.904 450.56L536.576 557.056l417.792 208.896C999.424 692.224 1024 606.208 1024 512c0-20.48 0-40.96-4.096-61.44z m-12.288-61.44C958.464 184.32 786.432 28.672 573.44 4.096L446.464 512l561.152-122.88zM737.28 970.752c73.728-36.864 139.264-90.112 188.416-159.744L507.904 602.112l229.376 368.64zM512 0C229.376 0 0 229.376 0 512s229.376 512 512 512c61.44 0 118.784-12.288 172.032-28.672L385.024 512 512 0z' p-id='7756'></path></svg>";
  285. echo "<span>{$_local->gui->click_to_chart}</span></a></div>";
  286. echo $right_word_list;
  287. /*
  288. echo "<div class='dict_word' ><b>{$_local->gui->undone_function}</b>";
  289. echo "<div class='' onclick=\"dict_show_edit()\">{$_local->gui->edit}</div>";
  290. echo "<div class='pali'>{$word}</div>";
  291. if ($iFetch > 0) {
  292. echo "<div id='user_word_edit' style='display:none'>";
  293. } else {
  294. echo "<div id='user_word_edit'>";
  295. }
  296. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->wordtype}</legend>";
  297. echo "<select id=\"id_type\" name=\"type\" >";
  298. foreach ($_local->type_str as $type) {
  299. echo "<option value=\"{$type->id}\" >{$type->value}</option>";
  300. }
  301. echo "</select>";
  302. echo "</fieldset>";
  303. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->gramma}</legend><input type='input' value=''/></fieldset>";
  304. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->parent}</legend><input type='input' value=''/></fieldset>";
  305. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->g_mean}</legend><input type='input' value=''/></fieldset>";
  306. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->note}</legend><textarea></textarea></fieldset>";
  307. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->factor}</legend><input type='input' value=''/></fieldset>";
  308. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->f_mean}</legend><input type='input' value=''/></fieldset>";
  309. echo "<div class=''><button>{$_local->gui->add_to} {$_local->gui->my_dictionary}</button></div>";
  310. echo "</div>";
  311. echo "</div>";
  312. */
  313. echo "</div>";
  314. //查用户词典结束
  315. PrefLog();
  316. function lookup_user($word){
  317. global $dict_list;
  318. global $redis;
  319. global $_local;
  320. global $PDO;
  321. global $count_return;
  322. $output ="";
  323. $Fetch=array();
  324. if($redis){
  325. $wordData = $redis->hGet("dict://user",$word);
  326. if($wordData){
  327. if(!empty($wordData)){
  328. $arrWord = json_decode($wordData,true);
  329. foreach ($arrWord as $one) {
  330. # code...
  331. $Fetch[] = array("id"=>$one[0],
  332. "pali"=>$one[1],
  333. "type"=>$one[2],
  334. "gramma"=>$one[3],
  335. "parent"=>$one[4],
  336. "mean"=>$one[5],
  337. "note"=>$one[6],
  338. "factors"=>$one[7],
  339. "factormean"=>$one[8],
  340. "status"=>$one[9],
  341. "confidence"=>$one[10],
  342. "creator"=>$one[11],
  343. "dict_name"=>$one[12],
  344. "lang"=>$one[13],
  345. );
  346. }
  347. }
  348. }
  349. else{
  350. # 没找到就不找了
  351. }
  352. }
  353. else{
  354. PDO_Connect("" . _FILE_DB_WBW_);
  355. $query = "SELECT * from " . _TABLE_DICT_REF_ . " where pali = ? limit 0,100";
  356. $Fetch = PDO_FetchAll($query, array($word));
  357. }
  358. $iFetch = count($Fetch);
  359. if ($iFetch > 0) {
  360. $count_return++;
  361. $userlist = array();
  362. foreach ($Fetch as $value) {
  363. if (isset($userlist[$value["creator"]])) {
  364. $userlist[$value["creator"]] += 1;
  365. } else {
  366. $userlist[$value["creator"]] = 1;
  367. }
  368. $userwordcase = $value["type"] . "#" . $value["gramma"];
  369. $parent = $value["parent"];
  370. if(empty($parent)){
  371. $parent = "_null_";
  372. }
  373. if (isset($userdict["{$parent}"])) {
  374. $userdict["{$parent}"]["mean"] .= "$". $value["mean"] ;
  375. $userdict["{$parent}"]["factors"] .= "@". $value["factors"];
  376. $userdict["{$parent}"]["case"] .= "@".$userwordcase;
  377. } else {
  378. $userdict["{$parent}"]["mean"] = $value["mean"];
  379. $userdict["{$parent}"]["factors"] = $value["factors"];
  380. $userdict["{$parent}"]["case"] = $userwordcase;
  381. }
  382. }
  383. $output .= "<div class='dict_word'>";
  384. $output .= "<div class='dict'>{$_local->gui->com_dict}</div><a name='net'></a>";
  385. $dict_list_a[] = array("net", $_local->gui->com_dict);
  386. foreach ($userdict as $key => $value) {
  387. #语法信息查重
  388. $thiscase = array();
  389. $strCase = "";
  390. $arrCase = explode("@",$value["case"]);
  391. foreach ($arrCase as $case) {
  392. # code...
  393. $thiscase[$case] = 1;
  394. }
  395. foreach ($thiscase as $case => $casevalue) {
  396. # code...
  397. $strCase .=$case . "; ";
  398. }
  399. #语法信息替换为本地字符串
  400. foreach ($_local->grammastr as $gr) {
  401. $strCase = str_replace($gr->id, $gr->value, $strCase);
  402. }
  403. #拆分查重复
  404. $thispart = array();
  405. $strPart = "";
  406. $arrPart = explode("@",$value["factors"]);
  407. foreach ($arrPart as $part) {
  408. # code...
  409. $thispart[$part] = 1;
  410. }
  411. foreach ($thispart as $part => $partvalue) {
  412. # code...
  413. $strPart .=$part . "; ";
  414. }
  415. #意思查重复
  416. $thismean = array();
  417. $strMean = "";
  418. $arrMean = explode("$",$value["mean"]);
  419. foreach ($arrMean as $mean) {
  420. # code...
  421. $thismean[$mean] = 1;
  422. }
  423. foreach ($thismean as $mean => $meanvalue) {
  424. # code...
  425. $strMean .=$mean . "; ";
  426. }
  427. $output .= "<div class='mean'><b>语法</b>:{$strCase}</div>";
  428. if($key!=="_null_"){
  429. $output .= "<div class='mean'><b>原型</b>:<a href='index.php?key={$key}'>{$key}</a></div>";
  430. }
  431. $output .= "<div class='mean'><b>意思</b>:{$strMean}</div>";
  432. $output .= "<div class='mean'><b>组成</b>:{$strPart}</div>";
  433. }
  434. $output .= "<div><span>{$_local->gui->contributor}:</span>";
  435. $userinfo = new UserInfo();
  436. foreach ($userlist as $key => $value) {
  437. $user = $userinfo->getName($key);
  438. $output .= $user["nickname"] . " ";
  439. }
  440. $output .= "</div>";
  441. $output .= "</div>";
  442. }
  443. return $output;
  444. }
  445. function lookup_term($word){
  446. global $dict_list;
  447. global $redis;
  448. global $_local;
  449. global $PDO;
  450. global $count_return;
  451. $output ="";
  452. $Fetch=array();
  453. if($redis){
  454. $wordData = $redis->hGet("dict://term",$word);
  455. if($wordData){
  456. if(!empty($wordData)){
  457. $arrWord = json_decode($wordData,true);
  458. foreach ($arrWord as $one) {
  459. # code...
  460. $Fetch[] = array("id"=>$one[0],
  461. "pali"=>$one[1],
  462. "type"=>$one[2],
  463. "gramma"=>$one[3],
  464. "parent"=>$one[4],
  465. "mean"=>$one[5],
  466. "note"=>$one[6],
  467. "factors"=>$one[7],
  468. "factormean"=>$one[8],
  469. "status"=>$one[9],
  470. "confidence"=>$one[10],
  471. "creator"=>$one[11],
  472. "dict_name"=>$one[12],
  473. "lang"=>$one[13],
  474. );
  475. }
  476. }
  477. }
  478. else{
  479. # 没找到就不找了
  480. }
  481. }
  482. else{
  483. PDO_Connect("" . _FILE_DB_WBW_);
  484. $query = "SELECT * from " . _TABLE_DICT_REF_ . " where pali = ? limit 0,100";
  485. $Fetch = PDO_FetchAll($query, array($word));
  486. }
  487. $iFetch = count($Fetch);
  488. $count_return += $iFetch;
  489. if ($iFetch > 0) {
  490. $userlist = array();
  491. foreach ($Fetch as $value) {
  492. if (isset($userlist[$value["creator"]])) {
  493. $userlist[$value["creator"]] += 1;
  494. } else {
  495. $userlist[$value["creator"]] = 1;
  496. }
  497. $userwordcase = $value["type"] . "#" . $value["gramma"];
  498. if (isset($userdict["{$userwordcase}"])) {
  499. $userdict["{$userwordcase}"]["mean"] .= $value["mean"] . ";";
  500. $userdict["{$userwordcase}"]["factors"] .= $value["factors"];
  501. } else {
  502. $userdict["{$userwordcase}"]["mean"] = $value["mean"];
  503. $userdict["{$userwordcase}"]["factors"] = $value["factors"];
  504. }
  505. }
  506. $output .= "<div class='dict_word'>";
  507. $output .= "<div class='dict'>{$_local->gui->wiki_term}</div><a name='net'></a>";
  508. $dict_list_a[] = array("net", $_local->gui->wiki_term);
  509. foreach ($userdict as $key => $value) {
  510. $output .= "<div class='mean'>{$key}:{$value["mean"]}</div>";
  511. }
  512. $output .= "<div><span>{$_local->gui->contributor}:</span>";
  513. $userinfo = new UserInfo();
  514. foreach ($userlist as $key => $value) {
  515. $user = $userinfo->getName($key);
  516. $output .= $user["nickname"] . " ";
  517. }
  518. $output .= "</div>";
  519. $output .= "</div>";
  520. }
  521. return $output;
  522. }