We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我最近在实现一个类库,其中调用了Jieba。但是如果我想在其他工程中调用的时候,就需要在每一个工程的config文件中都设置jieba的目录。 我建议给ConfigFileBaseDir添加一个set,这样在项目中就可以动态的指定根目录了。我可以把jieba的资源文件放到整个类库的资源文件中,传一个变量就可以加载。 例如这样子:
private static string _configFileBaseDir; public static string ConfigFileBaseDir { get { if (string.IsNullOrEmpty(_configFileBaseDir)) { _configFileBaseDir = ConfigurationManager.AppSettings["JiebaConfigFileDir"] ?? "Resources"; } return _configFileBaseDir; } set { _configFileBaseDir = value; } }
The text was updated successfully, but these errors were encountered:
@Eureka6174 嗯,可以考虑。不过一旦支持了setter,就需要支持动态修改词典路径,等下次修改我再仔细看看哈。
Sorry, something went wrong.
@Eureka6174 已经添加
No branches or pull requests
我最近在实现一个类库,其中调用了Jieba。但是如果我想在其他工程中调用的时候,就需要在每一个工程的config文件中都设置jieba的目录。
我建议给ConfigFileBaseDir添加一个set,这样在项目中就可以动态的指定根目录了。我可以把jieba的资源文件放到整个类库的资源文件中,传一个变量就可以加载。
例如这样子:
The text was updated successfully, but these errors were encountered: