Skip to content

Commit

Permalink
支持通过JVM的启动参数指定data路径:java -DHANLP_ROOT=/opt/hanlp 则加载/opt/hanlp/data #…
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Sep 29, 2018
1 parent b2f93a0 commit b5a02ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/hankcs/hanlp/HanLP.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ public static final class Config
}
catch (Exception e)
{
String HANLP_ROOT = System.getenv("HANLP_ROOT");
String HANLP_ROOT = System.getProperty("HANLP_ROOT");
if (HANLP_ROOT == null) HANLP_ROOT = System.getenv("HANLP_ROOT");
if (HANLP_ROOT != null)
{
HANLP_ROOT = HANLP_ROOT.trim();
Expand Down

0 comments on commit b5a02ef

Please # to comment.