dict_lookup.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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. _load_book_index();
  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. $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($case[$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 "</div>";
  186. echo "<input type='hidden' id='word_count' value='{$count_return}' />";
  187. //查连读词
  188. /*
  189. if ($count_return < 2) {
  190. echo "<div>Junction</div>";
  191. $newWord = array();
  192. for ($row = 0; $row < count($un); $row++) {
  193. $len = mb_strlen($un[$row][1], "UTF-8");
  194. $end = mb_substr($word, 0 - $len, null, "UTF-8");
  195. if ($end == $un[$row][1]) {
  196. $base = mb_substr($word, 0, mb_strlen($word, "UTF-8") - $len, "UTF-8") . $un[$row][0];
  197. $arr_un = explode("+", $base);
  198. foreach ($arr_un as $oneword) {
  199. echo "<a onclick='dict_pre_word_click(\"$oneword\")'>$oneword</a> + ";
  200. }
  201. echo "<br />";
  202. }
  203. }
  204. }
  205. */
  206. //拆复合词
  207. echo "<div id='auto_split'></div>";
  208. //查内容
  209. if ($count_return < 2) {
  210. $word1 = $org_word;
  211. $wordInMean = "%$org_word%";
  212. echo "包含 $org_word 的:<br />";
  213. $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";
  214. $Fetch = PDO_FetchAll($query, array($wordInMean));
  215. $iFetch = count($Fetch);
  216. $count_return += $iFetch;
  217. if ($iFetch > 0) {
  218. for ($i = 0; $i < $iFetch; $i++) {
  219. $mean = $Fetch[$i]["mean"];
  220. $pos = mb_stripos($mean, $word, 0, "UTF-8");
  221. if ($pos) {
  222. if ($pos > 20) {
  223. $start = $pos - 20;
  224. } else {
  225. $start = 0;
  226. }
  227. $newmean = mb_substr($mean, $start, 100, "UTF-8");
  228. } else {
  229. $newmean = $mean;
  230. }
  231. $pos = mb_stripos($newmean, $word1, 0, "UTF-8");
  232. $head = mb_substr($newmean, 0, $pos, "UTF-8");
  233. $mid = mb_substr($newmean, $pos, mb_strlen($word1, "UTF-8"), "UTF-8");
  234. $end = mb_substr($newmean, $pos + mb_strlen($word1, "UTF-8"), null, "UTF-8");
  235. $heigh_light_mean = "$head<hl>$mid</hl>$end";
  236. echo "<div class='dict_word'>";
  237. echo "<div class='pali'><a href='index.php?key={$Fetch[$i]["word"]}'>" . $Fetch[$i]["word"] . "</a></div>";
  238. echo "<div class='dict'>" . $Fetch[$i]["shortname"] . "</div>";
  239. echo "<div class='mean'>" . $heigh_light_mean . "</div>";
  240. echo "<div><a href='index.php?key={$Fetch[$i]["word"]}&hightlight={$org_word}'>详情</a></div>";
  241. echo "</div>";
  242. }
  243. }
  244. }
  245. else{
  246. }
  247. echo "<div id='dictlist'>";
  248. foreach ($dict_list_a as $x_value) {
  249. if (substr($x_value[0], 0, 4) == "word") {
  250. echo "<div class='pali_spell'>";
  251. echo "<a href='#{$x_value[0]}'>$x_value[1]</a></div>";
  252. } else {
  253. echo "<div><a href='#{$x_value[0]}'>$x_value[1]</a></div>";
  254. }
  255. }
  256. echo "<div>";
  257. $arrWords = countWordInPali($word, true);
  258. $weight = 0;
  259. foreach ($arrWords as $oneword) {
  260. $weight += $oneword["count"] * $oneword["len"];
  261. }
  262. //echo "<div>{$_local->gui->word_weight}:$weight {$_local->gui->characters}</div>";
  263. //echo "<div>{$_local->gui->real_declension}:".count($arrWords)." {$_local->gui->forms}</div>";
  264. $right_word_list .= "<div>{$_local->gui->word_weight}:$weight {$_local->gui->characters}</div>";
  265. $right_word_list .= "<div>{$_local->gui->real_declension}:" . count($arrWords) . " {$_local->gui->forms}</div>";
  266. foreach ($arrWords as $oneword) {
  267. if ($oneword["bold"] > 0) {
  268. //echo "<div><b>{$oneword["word"]}</b> {$oneword["count"]} {$_local->gui->times}</div>";
  269. $right_word_list .= "<div><b>{$oneword["word"]}</b> {$oneword["count"]} {$_local->gui->times}</div>";
  270. } else {
  271. //echo "<div>{$oneword["word"]} {$oneword["count"]}{$_local->gui->times}</div>";
  272. $right_word_list .= "<div>{$oneword["word"]} {$oneword["count"]}{$_local->gui->times}</div>";
  273. }
  274. }
  275. echo "</div>";
  276. echo "</div>";
  277. echo "</div>";
  278. //参考字典查询结束
  279. //用户词典编辑窗口
  280. echo "<div id='dict_user' >";
  281. echo "<div><a href='word_statistics.php?word={$word}'>";
  282. 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>";
  283. echo "<span>{$_local->gui->click_to_chart}</span></a></div>";
  284. echo $right_word_list;
  285. /*
  286. echo "<div class='dict_word' ><b>{$_local->gui->undone_function}</b>";
  287. echo "<div class='' onclick=\"dict_show_edit()\">{$_local->gui->edit}</div>";
  288. echo "<div class='pali'>{$word}</div>";
  289. if ($iFetch > 0) {
  290. echo "<div id='user_word_edit' style='display:none'>";
  291. } else {
  292. echo "<div id='user_word_edit'>";
  293. }
  294. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->wordtype}</legend>";
  295. echo "<select id=\"id_type\" name=\"type\" >";
  296. foreach ($_local->type_str as $type) {
  297. echo "<option value=\"{$type->id}\" >{$type->value}</option>";
  298. }
  299. echo "</select>";
  300. echo "</fieldset>";
  301. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->gramma}</legend><input type='input' value=''/></fieldset>";
  302. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->parent}</legend><input type='input' value=''/></fieldset>";
  303. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->g_mean}</legend><input type='input' value=''/></fieldset>";
  304. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->note}</legend><textarea></textarea></fieldset>";
  305. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->factor}</legend><input type='input' value=''/></fieldset>";
  306. echo "<fieldset class='broder-1 broder-r'><legend>{$_local->gui->f_mean}</legend><input type='input' value=''/></fieldset>";
  307. echo "<div class=''><button>{$_local->gui->add_to} {$_local->gui->my_dictionary}</button></div>";
  308. echo "</div>";
  309. echo "</div>";
  310. */
  311. echo "</div>";
  312. //查用户词典结束
  313. function lookup_user($word){
  314. global $dict_list;
  315. global $redis;
  316. global $_local;
  317. global $PDO;
  318. global $count_return;
  319. $output ="";
  320. $Fetch=array();
  321. if($redis){
  322. $wordData = $redis->hGet("dict://user",$word);
  323. if($wordData){
  324. if(!empty($wordData)){
  325. $arrWord = json_decode($wordData,true);
  326. foreach ($arrWord as $one) {
  327. # code...
  328. $Fetch[] = array("id"=>$one[0],
  329. "pali"=>$one[1],
  330. "type"=>$one[2],
  331. "gramma"=>$one[3],
  332. "parent"=>$one[4],
  333. "mean"=>$one[5],
  334. "note"=>$one[6],
  335. "factors"=>$one[7],
  336. "factormean"=>$one[8],
  337. "status"=>$one[9],
  338. "confidence"=>$one[10],
  339. "creator"=>$one[11],
  340. "dict_name"=>$one[12],
  341. "lang"=>$one[13],
  342. );
  343. }
  344. }
  345. }
  346. else{
  347. # 没找到就不找了
  348. }
  349. }
  350. else{
  351. PDO_Connect("" . _FILE_DB_WBW_);
  352. $query = "SELECT * from " . _TABLE_DICT_REF_ . " where pali = ? limit 0,100";
  353. $Fetch = PDO_FetchAll($query, array($word));
  354. }
  355. $iFetch = count($Fetch);
  356. $count_return += 1;
  357. if ($iFetch > 0) {
  358. $userlist = array();
  359. foreach ($Fetch as $value) {
  360. if (isset($userlist[$value["creator"]])) {
  361. $userlist[$value["creator"]] += 1;
  362. } else {
  363. $userlist[$value["creator"]] = 1;
  364. }
  365. $userwordcase = $value["type"] . "#" . $value["gramma"];
  366. $parent = $value["parent"];
  367. if(empty($parent)){
  368. $parent = "_null_";
  369. }
  370. if (isset($userdict["{$parent}"])) {
  371. $userdict["{$parent}"]["mean"] .= "$". $value["mean"] ;
  372. $userdict["{$parent}"]["factors"] .= "@". $value["factors"];
  373. $userdict["{$parent}"]["case"] .= "@".$userwordcase;
  374. } else {
  375. $userdict["{$parent}"]["mean"] = $value["mean"];
  376. $userdict["{$parent}"]["factors"] = $value["factors"];
  377. $userdict["{$parent}"]["case"] = $userwordcase;
  378. }
  379. }
  380. $output .= "<div class='dict_word'>";
  381. $output .= "<div class='dict'>{$_local->gui->com_dict}</div><a name='net'></a>";
  382. $dict_list_a[] = array("net", $_local->gui->com_dict);
  383. foreach ($userdict as $key => $value) {
  384. #语法信息查重
  385. $thiscase = array();
  386. $strCase = "";
  387. $arrCase = explode("@",$value["case"]);
  388. foreach ($arrCase as $case) {
  389. # code...
  390. $thiscase[$case] = 1;
  391. }
  392. foreach ($thiscase as $case => $casevalue) {
  393. # code...
  394. $strCase .=$case . "; ";
  395. }
  396. #语法信息替换为本地字符串
  397. foreach ($_local->grammastr as $gr) {
  398. $strCase = str_replace($gr->id, $gr->value, $strCase);
  399. }
  400. #拆分查重复
  401. $thispart = array();
  402. $strPart = "";
  403. $arrPart = explode("@",$value["factors"]);
  404. foreach ($arrPart as $part) {
  405. # code...
  406. $thispart[$part] = 1;
  407. }
  408. foreach ($thispart as $part => $partvalue) {
  409. # code...
  410. $strPart .=$part . "; ";
  411. }
  412. #意思查重复
  413. $thismean = array();
  414. $strMean = "";
  415. $arrMean = explode("$",$value["mean"]);
  416. foreach ($arrMean as $mean) {
  417. # code...
  418. $thismean[$mean] = 1;
  419. }
  420. foreach ($thismean as $mean => $meanvalue) {
  421. # code...
  422. $strMean .=$mean . "; ";
  423. }
  424. $output .= "<div class='mean'><b>语法</b>:{$strCase}</div>";
  425. if($key!=="_null_"){
  426. $output .= "<div class='mean'><b>原型</b>:<a href='index.php?key={$key}'>{$key}</a></div>";
  427. }
  428. $output .= "<div class='mean'><b>意思</b>:{$strMean}</div>";
  429. $output .= "<div class='mean'><b>组成</b>:{$strPart}</div>";
  430. }
  431. $output .= "<div><span>{$_local->gui->contributor}:</span>";
  432. $userinfo = new UserInfo();
  433. foreach ($userlist as $key => $value) {
  434. $user = $userinfo->getName($key);
  435. $output .= $user["nickname"] . " ";
  436. }
  437. $output .= "</div>";
  438. $output .= "</div>";
  439. }
  440. return $output;
  441. }
  442. function lookup_term($word){
  443. global $dict_list;
  444. global $redis;
  445. global $_local;
  446. global $PDO;
  447. global $count_return;
  448. $output ="";
  449. $Fetch=array();
  450. if($redis){
  451. $wordData = $redis->hGet("dict://term",$word);
  452. if($wordData){
  453. if(!empty($wordData)){
  454. $arrWord = json_decode($wordData,true);
  455. foreach ($arrWord as $one) {
  456. # code...
  457. $Fetch[] = array("id"=>$one[0],
  458. "pali"=>$one[1],
  459. "type"=>$one[2],
  460. "gramma"=>$one[3],
  461. "parent"=>$one[4],
  462. "mean"=>$one[5],
  463. "note"=>$one[6],
  464. "factors"=>$one[7],
  465. "factormean"=>$one[8],
  466. "status"=>$one[9],
  467. "confidence"=>$one[10],
  468. "creator"=>$one[11],
  469. "dict_name"=>$one[12],
  470. "lang"=>$one[13],
  471. );
  472. }
  473. }
  474. }
  475. else{
  476. # 没找到就不找了
  477. }
  478. }
  479. else{
  480. PDO_Connect("" . _FILE_DB_WBW_);
  481. $query = "SELECT * from " . _TABLE_DICT_REF_ . " where pali = ? limit 0,100";
  482. $Fetch = PDO_FetchAll($query, array($word));
  483. }
  484. $iFetch = count($Fetch);
  485. $count_return += $iFetch;
  486. if ($iFetch > 0) {
  487. $userlist = array();
  488. foreach ($Fetch as $value) {
  489. if (isset($userlist[$value["creator"]])) {
  490. $userlist[$value["creator"]] += 1;
  491. } else {
  492. $userlist[$value["creator"]] = 1;
  493. }
  494. $userwordcase = $value["type"] . "#" . $value["gramma"];
  495. if (isset($userdict["{$userwordcase}"])) {
  496. $userdict["{$userwordcase}"]["mean"] .= $value["mean"] . ";";
  497. $userdict["{$userwordcase}"]["factors"] .= $value["factors"];
  498. } else {
  499. $userdict["{$userwordcase}"]["mean"] = $value["mean"];
  500. $userdict["{$userwordcase}"]["factors"] = $value["factors"];
  501. }
  502. }
  503. $output .= "<div class='dict_word'>";
  504. $output .= "<div class='dict'>{$_local->gui->wiki_term}</div><a name='net'></a>";
  505. $dict_list_a[] = array("net", $_local->gui->wiki_term);
  506. foreach ($userdict as $key => $value) {
  507. $output .= "<div class='mean'>{$key}:{$value["mean"]}</div>";
  508. }
  509. $output .= "<div><span>{$_local->gui->contributor}:</span>";
  510. $userinfo = new UserInfo();
  511. foreach ($userlist as $key => $value) {
  512. $user = $userinfo->getName($key);
  513. $output .= $user["nickname"] . " ";
  514. }
  515. $output .= "</div>";
  516. $output .= "</div>";
  517. }
  518. return $output;
  519. }