<p style="text-align: left;">string DictPath = Path.Combine(Environment.CurrentDirectory, "Data") + <br /> Path.DirectorySeparatorChar; <br /> Console.WriteLine("正在初始化字典庫,請稍候..."); <br /> WordSegmentSample sample = new WordSegmentSample(DictPath, 5); </p> <p style="text-align: left;"> result = sample.Segment(@"王曉平在1月份灤南大會上說的確實在理"); <br />這個在哪里使用?是搜索的時候,還是建立索引時用?謝謝</p>
2 回答

守候你守候我
TA貢獻1802條經驗 獲得超10個贊
首先你需要通過IndexWriter建立索引,然后會在對應的目錄下生成索引文件。在通過IndexSearcher來使用創建的索引,記住建立索引時用的什么分詞器,搜索的時候就用什么分詞器。
- 2 回答
- 0 關注
- 508 瀏覽
添加回答
舉報
0/150
提交
取消