dict_lookup.php 20 KB

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