Skip to content

Commit d1efebc

Browse files
committed
remove word dependency to remove GPL license
1 parent 66b1674 commit d1efebc

File tree

5 files changed

+1
-125
lines changed

5 files changed

+1
-125
lines changed

hugegraph-core/pom.xml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<jraft.version>1.3.11</jraft.version>
3333
<ohc.version>0.7.4</ohc.version>
3434
<lz4.version>1.8.0</lz4.version>
35-
<apdplat-word.version>1.3.1</apdplat-word.version>
3635
<mmseg4j-core.version>1.10.0</mmseg4j-core.version>
3736
<jcseg.version>2.6.2</jcseg.version>
3837
<hanlp.version>portable-1.8.3</hanlp.version>
@@ -125,25 +124,6 @@
125124
</exclusions>
126125
</dependency>
127126

128-
<dependency>
129-
<groupId>org.apdplat</groupId>
130-
<artifactId>word</artifactId>
131-
<version>${apdplat-word.version}</version>
132-
<exclusions>
133-
<exclusion>
134-
<groupId>ch.qos.logback</groupId>
135-
<artifactId>logback-classic</artifactId>
136-
</exclusion>
137-
<exclusion>
138-
<groupId>org.apache.lucene</groupId>
139-
<artifactId>lucene-core</artifactId>
140-
</exclusion>
141-
<exclusion>
142-
<groupId>org.apache.lucene</groupId>
143-
<artifactId>lucene-analyzers-common</artifactId>
144-
</exclusion>
145-
</exclusions>
146-
</dependency>
147127
<dependency>
148128
<groupId>org.ansj</groupId>
149129
<artifactId>ansj_seg</artifactId>

hugegraph-core/src/main/java/com/baidu/hugegraph/analyzer/AnalyzerFactory.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public class AnalyzerFactory {
3636
public static Analyzer analyzer(String name, String mode) {
3737
name = name.toLowerCase();
3838
switch (name) {
39-
case "word":
40-
return new WordAnalyzer(mode);
4139
case "ansj":
4240
return new AnsjAnalyzer(mode);
4341
case "hanlp":

hugegraph-core/src/main/java/com/baidu/hugegraph/analyzer/WordAnalyzer.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

hugegraph-core/src/main/java/com/baidu/hugegraph/config/CoreOptions.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ public static synchronized CoreOptions instance() {
571571
"search.text_analyzer",
572572
"Choose a text analyzer for searching the " +
573573
"vertex/edge properties, available type are " +
574-
"[word, ansj, hanlp, smartcn, jieba, jcseg, " +
574+
"[ansj, hanlp, smartcn, jieba, jcseg, " +
575575
"mmseg4j, ikanalyzer].",
576576
disallowEmpty(),
577577
"ikanalyzer"
@@ -582,13 +582,6 @@ public static synchronized CoreOptions instance() {
582582
"search.text_analyzer_mode",
583583
"Specify the mode for the text analyzer, " +
584584
"the available mode of analyzer are " +
585-
"{word: [MaximumMatching, ReverseMaximumMatching, " +
586-
"MinimumMatching, ReverseMinimumMatching, " +
587-
"BidirectionalMaximumMatching, " +
588-
"BidirectionalMinimumMatching, " +
589-
"BidirectionalMaximumMinimumMatching, " +
590-
"FullSegmentation, MinimalWordCount, " +
591-
"MaxNgramScore, PureEnglish], " +
592585
"ansj: [BaseAnalysis, IndexAnalysis, ToAnalysis, " +
593586
"NlpAnalysis], " +
594587
"hanlp: [standard, nlp, index, nShort, shortest, speed], " +

hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/AnalyzerTest.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,6 @@ public void teardown() {
4747
// pass
4848
}
4949

50-
@Test
51-
public void testWordAnalyzer() {
52-
// MaximumMatching mode
53-
Analyzer analyzer = AnalyzerFactory.analyzer("word", "MaximumMatching");
54-
Assert.assertEquals(setOf("england", "wins", "world", "cup"),
55-
analyzer.segment(TEXT_1));
56-
Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国",
57-
"国歌", "百度", "科技园", "位于", "北京市",
58-
"海淀区", "西北旺", "东路", "10号", "院"),
59-
analyzer.segment(TEXT_2));
60-
61-
// ReverseMaximumMatching mode
62-
analyzer = AnalyzerFactory.analyzer("word", "ReverseMaximumMatching");
63-
Assert.assertEquals(setOf("england", "wins", "world", "cup"),
64-
analyzer.segment(TEXT_1));
65-
Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国",
66-
"国歌", "百度", "科技园", "位于", "北京市",
67-
"海淀区", "西北旺", "东路", "10号", "院"),
68-
analyzer.segment(TEXT_2));
69-
}
70-
7150
@Test
7251
public void testAnsjAnalyzer() {
7352
// BaseAnalysis mode

0 commit comments

Comments
 (0)