From 9de77f8212c26ba063078e4a8bf070f0fe67d423 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 19 Jan 2018 11:20:40 +0100 Subject: [PATCH] try a different path for resource inclusion --- src/main/java/io/bdrc/lucene/bo/TibWordTokenizer.java | 2 +- src/main/java/io/bdrc/lucene/bo/TibetanAnalyzer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/bdrc/lucene/bo/TibWordTokenizer.java b/src/main/java/io/bdrc/lucene/bo/TibWordTokenizer.java index 15d7a0f..5203c28 100644 --- a/src/main/java/io/bdrc/lucene/bo/TibWordTokenizer.java +++ b/src/main/java/io/bdrc/lucene/bo/TibWordTokenizer.java @@ -83,7 +83,7 @@ public TibWordTokenizer(String filename) throws FileNotFoundException, IOExcepti */ public TibWordTokenizer() throws FileNotFoundException, IOException { InputStream stream = null; - stream = TibWordTokenizer.class.getResourceAsStream("total_lexicon.txt"); + stream = TibWordTokenizer.class.getResourceAsStream("/total_lexicon.txt"); if (stream == null) { // we're not using the jar, there is no resource, assuming we're running the code init(new FileReader("resource/output/total_lexicon.txt")); diff --git a/src/main/java/io/bdrc/lucene/bo/TibetanAnalyzer.java b/src/main/java/io/bdrc/lucene/bo/TibetanAnalyzer.java index 00e8034..d7689d7 100644 --- a/src/main/java/io/bdrc/lucene/bo/TibetanAnalyzer.java +++ b/src/main/java/io/bdrc/lucene/bo/TibetanAnalyzer.java @@ -76,7 +76,7 @@ public TibetanAnalyzer(boolean segmentInWords, boolean lemmatize, boolean filter if (stopFilename != null) { if (stopFilename.isEmpty()) { InputStream stream = null; - stream = TibetanAnalyzer.class.getResourceAsStream("bo-stopwords.txt"); + stream = TibetanAnalyzer.class.getResourceAsStream("/bo-stopwords.txt"); if (stream == null) { // we're not using the jar, there is no resource, assuming we're running the code this.tibStopSet = null; } else {