Giter Site home page Giter Site logo

Comments (3)

anderscui avatar anderscui commented on May 26, 2024 1

我猜应该是数据文件路径不正确,app.config或web.config里面配置过吗?

from jieba.net.

LinZap avatar LinZap commented on May 26, 2024 1

@anderscui 謝謝你,對的

根據你的說法我測試過後,的確是「数据文件路径不正确」所引起
原因是在 Debug 階段時,預設 resource 位置在 project/bin/Debug/
如果 app.configweb.config 中使用預設的

<appSettings>
    <add key="MainDictFile" value="Resources\dict.txt" />
    <add key="ProbTransFile" value="Resources\prob_trans.json" />
    <add key="ProbEmitFile" value="Resources\prob_emit.json" />

    <add key="PosProbStartFile" value="Resources\pos_prob_start.json" />
    <add key="PosProbTransFile" value="Resources\pos_prob_trans.json" />
    <add key="PosProbEmitFile" value="Resources\pos_prob_emit.json" />
    <add key="CharStateTabFile" value="Resources\char_state_tab.json" />

    <add key="StopWordsFile" value="Resources\stopwords.txt" />
    <add key="IdfFile" value="Resources\idf.txt" />
</appSettings>

那麼就要自行將 project/packages/jieba.NET.0.38/Resources 這個目錄複製到 project/bin/Debug/ 下就可以解決。

建議可以把這項訊息加到 README 中,避免踩雷

from jieba.net.

anderscui avatar anderscui commented on May 26, 2024

@LinZap 現在配置方式已經簡化,將那些文件複製到一個目錄下,然後添加一項配置:

<appSettings>
    <add key="JiebaConfigFileDir" value="C:\jiebanet\config" />
</appSettings>

from jieba.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.