belikemike23 / jcseg

Automatically exported from code.google.com/p/jcseg
0 stars 0 forks source link

配置文件装载路径问题 (已解决) #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
lexPro.load(new FileReader(ASegment.JAR_HOME+"/"+LEX_PROPERTY_FILE));

个人认为这个把配置文件写死的方式很不方便

1. 如果用maven, 用ide开发的时候我要放一个jcseg.properties放到 
maven仓库中去,  非常奇怪的事情.
2. 及时不用maven, 我的jar包也说不好在什么地方, 
但是要放一个jcseg.properties 和jar在一起, 挺奇怪的事情

通常的做法都是读取classpath里面的jcseg.properties  
或者读取当前路径下的jcseg.properties

Original issue reported on code.google.com by cnscud on 31 Oct 2012 at 2:40

GoogleCodeExporter commented 9 years ago
        //lexPro.load(new FileReader(ASegment.JAR_HOME+"/"+LEX_PROPERTY_FILE));
        lexPro.load(DictionaryFactory.class.getResourceAsStream("/" + LEX_PROPERTY_FILE));

就ok了

Original comment by cnscud on 31 Oct 2012 at 3:02

GoogleCodeExporter commented 9 years ago
感谢你的建议,我自己都这么用惯了。你那样确实方便不少��
�下个版本把它更改过来。

Original comment by chenxin6...@gmail.com on 4 Nov 2012 at 7:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
1.7.1以后的版本支持cnscud兄提议的配置文件查找方式,同时老
的配置文件装载方式也可以。

Original comment by chenxin6...@gmail.com on 15 Nov 2012 at 2:26

GoogleCodeExporter commented 9 years ago
很好很好的开源分词器,我正在应用于项目中,谢谢;

Original comment by byrss...@gmail.com on 8 Feb 2013 at 5:20

GoogleCodeExporter commented 9 years ago
感谢,呵呵……

Original comment by chenxin6...@gmail.com on 26 Feb 2013 at 8:33

GoogleCodeExporter commented 9 years ago

Original comment by chenxin6...@gmail.com on 10 May 2013 at 5:11