Skip to content

Commit

Permalink
[Optimize] 移除无用的文件。移除对于 paradise-common 的依赖。
Browse files Browse the repository at this point in the history
  • Loading branch information
houbb committed Apr 30, 2019
1 parent 6bbea08 commit 7a876e5
Show file tree
Hide file tree
Showing 28 changed files with 131 additions and 1,579 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -16,3 +16,11 @@
|:---|:---|:---|:---|
| Fixed | 修正原来包的依赖 | 2018-06-22 11:03:46 | |
| Simple | 简化实现方式 | 2018-06-22 15:27:54 | |

# release_1.0.3

| 类型 | 变化 | 时间 | 备注 |
|:---|:---|:---|:---|
| Optimize | 移除对于 paradise 的依赖 | 2019-4-30 14:20:20 | |
| Optimize | 优化文件加载方式 | 2019-4-30 14:20:20 | |
| Remove | 移除无用的文件 | 2019-4-30 14:20:20 | |
13 changes: 0 additions & 13 deletions README-ENGLISH.md
Expand Up @@ -85,19 +85,6 @@ the result is:

[Issues & Bugs](https://github.com/houbb/opencc4j/issues), welcome to provide valuable suggestions.

# Donate

One cup of tea.

## AliPay

![AliPay](img/alipay.jpg)

## WeChat

![WeChat](img/wechat.jpg)





Expand Down
14 changes: 0 additions & 14 deletions README.md
Expand Up @@ -98,20 +98,6 @@ public static String convertToSimple(String original, boolean huabanSegment);

[需求和 BUG](https://github.com/houbb/opencc4j/issues) 在这里,欢迎提供宝贵的建议。

# 支持作者

一颗糖,一杯咖啡。

## 支付宝

![AliPay](img/alipay.jpg)

## 微信

![WeChat](img/wechat.jpg)






Binary file removed img/alipay.jpg
Binary file not shown.
Binary file removed img/wechat.jpg
Binary file not shown.
8 changes: 5 additions & 3 deletions pom.xml
Expand Up @@ -38,10 +38,12 @@

<dependencies>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>paradise-common</artifactId>
<version>${paradise-common.version}</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.huaban</groupId>
<artifactId>jieba-analysis</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/houbb/opencc4j/core/Segment.java
Expand Up @@ -3,7 +3,7 @@
import java.util.List;

/**
* <p> </p>
* <p> 分词接口 </p>
*
* <pre> Created: 2018/6/22 下午2:41 </pre>
* <pre> Project: opencc4j </pre>
Expand Down
@@ -1,7 +1,7 @@
package com.github.houbb.opencc4j.core;

/**
* <p> </p>
* <p> 中文转换接口 </p>
*
* <pre> Created: 2018/6/22 下午2:42 </pre>
* <pre> Project: opencc4j </pre>
Expand Down
@@ -1,7 +1,7 @@
package com.github.houbb.opencc4j.core.impl;

import com.github.houbb.opencc4j.core.Segment;
import com.github.houbb.paradise.common.util.StringUtil;
import com.github.houbb.opencc4j.util.StringUtil;

import java.util.ArrayList;
import java.util.Collections;
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/github/houbb/opencc4j/util/CollectionUtil.java
@@ -0,0 +1,24 @@
package com.github.houbb.opencc4j.util;

import java.util.Collection;

/**
* 集合工具类
* @author binbin.hou
* @date 2019/4/30
* @since 1.0.3
*/
public final class CollectionUtil {

private CollectionUtil(){}

/**
* 集合是否为空
* @param collection 集合
* @return 是否
*/
public static boolean isEmpty(final Collection collection) {
return null == collection || collection.isEmpty();
}

}
Expand Up @@ -2,7 +2,6 @@

import com.github.houbb.opencc4j.constant.AppConstant;
import com.github.houbb.opencc4j.exception.Opencc4jRuntimeException;
import com.github.houbb.paradise.common.util.StringUtil;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -29,19 +28,19 @@ private DataFileUtil(){}
/**
* 简写=》繁写 字符 Map
*/
private static Map<String, String> S2T_CHAR_MAP;
private static final Map<String, String> S2T_CHAR_MAP;
/**
* 简写=》繁写 词组 Map
*/
private static Map<String, String> S2T_PHASE_MAP;
private static final Map<String, String> S2T_PHASE_MAP;
/**
* 繁写=》简写 字符 Map
*/
private static Map<String, String> T2S_CHAR_MAP;
private static final Map<String, String> T2S_CHAR_MAP;
/**
* 繁写=》简写 词组 Map
*/
private static Map<String, String> T2S_PHASE_MAP;
private static final Map<String, String> T2S_PHASE_MAP;

static {
synchronized (DataFileUtil.class) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/github/houbb/opencc4j/util/FenciUtil.java
@@ -1,7 +1,5 @@
package com.github.houbb.opencc4j.util;

import com.github.houbb.paradise.common.util.ObjectUtil;
import com.github.houbb.paradise.common.util.StringUtil;
import com.huaban.analysis.jieba.JiebaSegmenter;

import java.util.Collections;
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/github/houbb/opencc4j/util/ObjectUtil.java
@@ -0,0 +1,30 @@
package com.github.houbb.opencc4j.util;

/**
* 对象工具类
* @author binbin.hou
* @date 2019/4/30
* @since 1.0.3
*/
public final class ObjectUtil {

private ObjectUtil(){}

/**
* 是否为 null
* @param object 对象
* @return 是否
*/
public static boolean isNull(final Object object) {
return null == object;
}

/**
* 是否为不 null
* @param object 对象
* @return 是否
*/
public static boolean isNotNull(final Object object) {
return !isNull(object);
}
}
56 changes: 56 additions & 0 deletions src/main/java/com/github/houbb/opencc4j/util/StringUtil.java
@@ -0,0 +1,56 @@
package com.github.houbb.opencc4j.util;

/**
* 字符串工具类
* 1. 为了移除外部依赖。
* @author binbin.hou
* @date 2019/4/30
* @since 1.0.3
*/
public final class StringUtil {

private StringUtil(){}

/**
* 空字符串
*/
public static final String EMPTY = "";

/**
* 空格
*/
public static final String BLANK = " ";

/**
* 是否为空
* @param string 字符串
* @return 是否为空
*/
public static boolean isEmpty(String string) {
return null == string || EMPTY.equals(string);
}

/**
* 是否不为空
* @param string 字符串
* @return 是否为空
*/
public static boolean isNotEmpty(String string) {
return !isEmpty(string);
}

/**
* 按照任意空格拆分
* @param string 字符串
* @return 拆分后的数组
*/
public static String[] splitByAnyBlank(String string) {
if (isEmpty(string)) {
return new String[0];
} else {
String pattern = "\\s+";
return string.split(pattern);
}
}

}
Expand Up @@ -6,8 +6,6 @@
import com.github.houbb.opencc4j.core.impl.HuabanSegment;
import com.github.houbb.opencc4j.core.impl.ToSimpleZhConvert;
import com.github.houbb.opencc4j.core.impl.ToTraditonZhConvert;
import com.github.houbb.paradise.common.util.CollectionUtil;
import com.github.houbb.paradise.common.util.StringUtil;

import java.util.List;

Expand Down
70 changes: 0 additions & 70 deletions src/main/resources/data/dictionary/HKVariants.txt

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/resources/data/dictionary/HKVariantsPhrases.txt

This file was deleted.

0 comments on commit 7a876e5

Please sign in to comment.