【正文】
,但隨著 Java Servlet 的推出, Java 在電子商務(wù)方面開(kāi)始嶄露頭角,最新的 JSP(Java Server Page)技術(shù)的推出,更是讓 Java 成為基于 Web的應(yīng)用程序的首選開(kāi)發(fā)工具,目前的 Java 技術(shù)已成為所有大型電子商務(wù)項(xiàng)目的必然選擇。 內(nèi)蒙古工業(yè)大學(xué)本科畢業(yè)設(shè)計(jì)說(shuō)明書(shū) 2 第一章 技術(shù)概述 本設(shè)計(jì)中所用到的技術(shù) 包括 Java、 Hibernate、 Struts 和 JSP 等。 本課題主要研究的是中文分詞 在搜索引擎中的 分詞算法 。 一個(gè)是 歧義識(shí)別 ,一個(gè)是 新詞識(shí)別 。 中文分詞技術(shù)屬于自然語(yǔ)言處理技術(shù)范疇,對(duì)于一句話, 人 們 可以通過(guò)自己的知識(shí)來(lái) 劃分 哪些是詞,哪些不是詞 。 關(guān)鍵詞: 中文分詞 ; 詞典 ; 搜索 引擎 內(nèi)蒙古工業(yè)大學(xué)本科畢業(yè)設(shè)計(jì)說(shuō)明書(shū) Abstract With the information rapid growth, the search engine became the people to search the information the first choice tool, in the polling message process, the inquiry content already included the western languages also to include Chinese, Chinese and the western languages is different, Western writing (for example English) between the word had the blank space achievement to separate, the puter was very easy the word to separate. But in Chinese sentence, between the word and the word the obvious separating character, cannot analyze Chinese sentence to use Chinese word segmentation technology. This design mainly studies Chinese word segmentation algorithm, carries on the application in the puter specialized search system. In system39。 本系統(tǒng)中設(shè)計(jì)的中文分詞算法,主要是 采用最大正向分詞算法 把兩 字以上的詞語(yǔ) 拆分出來(lái)。 而在中文句子里,詞和詞 之間 沒(méi)有 明顯的 分隔符,要把中文句子拆分成詞就需要使用中文分詞技術(shù)。 本 設(shè)計(jì) 主要是研究中文分詞算法, 在 計(jì)算機(jī)專(zhuān)業(yè)搜索系統(tǒng) 進(jìn)行應(yīng)用 。這樣 既 可以提高分詞的速度, 又可以 提高搜索的速度和效率。s Chinese word segmentation algorithm uses the mechanical participle algorithm, through with the lexicon parison, carries on Chinese words and expressions resolution. The search engine is not carries on the match to entire inquiry content to inquire, but is divides the key word to carry on the inquiry. In this system designs Chinese word segmentation algorithm, are mainly uses most Taisho to analyze to the participle algorithm two characters above words and expressions? Like this both may enhance the participle the speed, and may enhance the search the speed and the efficiency. This system take the Java technology as a foundation, involves to related technologies and so on Struts, Hibernate, JSP. This system has the good readability, the feasibility, to be possible Unger, the extendibility and the probability. Key words: Chinese word segmentation。 但如何讓計(jì)算機(jī) 識(shí)別那些是詞,那些不是詞 ?其處理過(guò)程就是分詞算法。 歧義是指同樣的一句話,可能有兩種或者更多的切分方法。 分詞準(zhǔn)確性對(duì)搜索引擎來(lái)說(shuō)十分重要,但 如 果 分詞速度太慢,即使準(zhǔn)確性再高,對(duì)于搜索引擎來(lái)說(shuō)也是不可用的 。 下面 簡(jiǎn)單的介紹下這 些技術(shù)。 Hibernate概述 Hibernate是 JDBC( Java Database Connectivity) 的輕量級(jí)的對(duì)象封裝 。 Hibernate 是一個(gè)和 JDBC 密切關(guān)聯(lián)的框架,所以 Hibernate 的兼容性和 JDBC 驅(qū)動(dòng),和數(shù)據(jù)庫(kù)都有一定的關(guān)系,但是和使用它的 Java 程序,和 App Server沒(méi)有任何關(guān)系,也不存在兼容性問(wèn)題。MVC即 ModelViewController的縮寫(xiě),是一種常用的設(shè)計(jì)模式。 Struts 跟 Tomcat、 Turbine 等諸多 Apache 項(xiàng)目一樣,是開(kāi) 源軟件,這是它的一大優(yōu)點(diǎn),使開(kāi)發(fā)者能更深入的了解其內(nèi)部實(shí)現(xiàn)機(jī)制 。 JSP 技術(shù)是行 業(yè)協(xié)作的結(jié)果,它的設(shè)計(jì)是開(kāi)放的,符合行業(yè)標(biāo)準(zhǔn)的,并支持絕大多數(shù)的服務(wù)器、瀏覽器和相關(guān)工具。 內(nèi)蒙古工業(yè)大學(xué)本科畢業(yè)設(shè)計(jì)說(shuō)明書(shū) 4 第二章 系統(tǒng)分析 系統(tǒng)功能分析 系統(tǒng)功能框圖 計(jì)算機(jī)專(zhuān)業(yè)搜索系統(tǒng)的功能框圖如圖 21所示 圖 21 功能框圖 系統(tǒng)功能介紹 ( 1) 信息搜索功能 1) 中文分詞 這塊是本設(shè)計(jì)的主要內(nèi)容,用來(lái)把中文句子拆分 成 一個(gè)一個(gè)的詞語(yǔ)。 2) 用戶登錄 填寫(xiě)好登錄用戶名和密碼后,提交到數(shù)據(jù)庫(kù)進(jìn)行 查詢 , 當(dāng) 用戶名和密碼正確后,轉(zhuǎn)到 頁(yè)面。數(shù)據(jù)庫(kù)是表的集合,通常一個(gè)系統(tǒng)只需一個(gè)數(shù)據(jù)庫(kù)。 圖 22 用戶注冊(cè)用例圖 ( 2) 忘記密碼用例圖 這部分實(shí)現(xiàn)的是會(huì)員當(dāng)忘記密碼時(shí),可以通過(guò)這里進(jìn)行找回密碼,這里找回的密碼是系統(tǒng)新設(shè)定的密碼。 內(nèi)蒙古工業(yè)大學(xué)本科畢業(yè)設(shè)計(jì)說(shuō)明書(shū) 6 圖 23 忘記 密碼用例圖 圖 24 用戶登 錄 用例圖 ( 4) 系統(tǒng) 核心 用例圖 搜索中心 提供 中文信息搜索。 圖 25 系統(tǒng) 核心 用例圖 系統(tǒng)開(kāi)發(fā)環(huán)境 ( 1) 硬件環(huán)境 設(shè)計(jì) 本系統(tǒng) 時(shí),要求的硬件環(huán)境如表 21所示 表 21 硬件環(huán)境表 內(nèi)存 1G CPU Inter(R) Celeron (R) CPU 內(nèi)蒙古工業(yè)大學(xué)本科畢業(yè)設(shè)計(jì)說(shuō)明書(shū) 7 ( 2) 軟件環(huán)境 設(shè)計(jì)本系統(tǒng)時(shí),要求的軟件環(huán)境如表 22所示 表 22 軟件環(huán)境表 操作系統(tǒng) Linux 開(kāi)發(fā)工具及相關(guān)技術(shù) MyEclipse、 Java、 Hibernate、 Struts 內(nèi)蒙古工業(yè)大學(xué)本科畢業(yè)設(shè)計(jì)說(shuō)明書(shū) 8 第三章 系統(tǒng)總體設(shè)計(jì) 系統(tǒng)設(shè)計(jì)目的 在搜索中文句子時(shí),和搜索英文句子不一樣。 開(kāi)發(fā)設(shè)計(jì)思想 本系統(tǒng)主要是實(shí)現(xiàn)中文分詞算法,通過(guò)中文分詞算法進(jìn)行中文搜索。 然后在程序中通過(guò) List中的內(nèi)容和拆分的詞進(jìn)行比較。 ( 2) 業(yè)務(wù)邏輯層 處理外部視圖的命令和設(shè)計(jì)中文分詞算法來(lái)實(shí)現(xiàn)中文搜索。 ( 4) 數(shù)據(jù)庫(kù)層 創(chuàng)建數(shù)據(jù)庫(kù)。 取 出 中 文 字 符串與 詞 典 進(jìn) 行 順 序 比 較保 存 這 個(gè) 詞字 符 串 正 向 自減 一 個(gè) 字 符字 符 串 長(zhǎng) 度 是 否 為 1YYN開(kāi) 始結(jié) 束N 圖 41 中文分詞流程圖 ( 2) 中文分詞算法描述 詞典,用來(lái) 保存 中文 詞語(yǔ) 的文件,在進(jìn)行中文分詞時(shí),與拆分出的詞進(jìn)行比較。 減少一個(gè)字, 再 與 詞典 中的各行詞比較, 結(jié)果相同 保存到 內(nèi)容 中。 List l = new ArrayList()。 } 計(jì)算機(jī)專(zhuān)業(yè)搜索 此模塊主要 實(shí)現(xiàn)搜索功能。不相同就繼續(xù)上次操作,直到全部結(jié)束。 //1 調(diào)用 IParticipleService 接口 IParticipleService service=(IParticipleService)