Skip to content

Commit

Permalink
release branch 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
houbb committed Jun 22, 2018
1 parent 55f6033 commit 487a897
Show file tree
Hide file tree
Showing 35 changed files with 440 additions and 931 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,3 +15,4 @@
| 类型 | 变化 | 时间 | 备注 |
|:---|:---|:---|:---|
| Fixed | 修正原来包的依赖 | 2018-06-22 11:03:46 | |
| Simple | 简化实现方式 | 2018-06-22 15:27:54 | |
7 changes: 1 addition & 6 deletions README-ENGLISH.md
Expand Up @@ -39,7 +39,7 @@ supporting character-level conversion, phrase-level conversion for java.
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>opencc4j</artifactId>
<version>1.0.0</version>
<version>1.0.2</version>
</dependency>
```

Expand Down Expand Up @@ -69,11 +69,6 @@ the result is:
生命不息,奮鬥不止
```

## Other support

You can also use `StringBuilder` for argument when you use the two methods.

More details,you can see [ZhConverterUtilTest.java](src/test/java/com/github/houbb/opencc4j/util/ZhConverterUtilTest.java)


# Thanks
Expand Down
14 changes: 11 additions & 3 deletions README.md
Expand Up @@ -71,10 +71,18 @@ String result = ZhConverterUtil.convertToTraditional(original);

## 其他支持

上述 2 个方法,都支持 `StringBuilder` 作为入参。

更多详情,可参见测试用例 [ZhConverterUtilTest.java](src/test/java/com/github/houbb/opencc4j/util/ZhConverterUtilTest.java)
上述两个方法都默认使用的花瓣分词,都有第二个参数,是否启用花瓣分词。
如果不启用,则默认使用普通的一个 char 作为一个转换的对象。(不建议,唯一的优势性能好一点,但是准确性不行)

```java
/**
* 转换为简体
* @param original 原始内容
* @param huabanSegment 是否花瓣分词
* @return 转换后的内容
*/
public static String convertToSimple(String original, boolean huabanSegment);
```

# 技术鸣谢

Expand Down
49 changes: 49 additions & 0 deletions release_rm.sh
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
echo "============================= RELEASE START..."

## 版本号信息(需要手动指定)
oldVersion="1.0.2"
newVersion="1.0.2"
projectName="metadata"

# 删除分支
oldBranchName="release_"${oldVersion}
git branch -d ${oldBranchName}
git push origin --delete ${oldBranchName}

echo "1. Branch remove success..."

# 拉取新的分支
newBranchName="release_"${newVersion}
git branch ${newBranchName}
git checkout ${newBranchName}
git push --set-upstream origin ${newBranchName}

echo "2. NEW BRANCH DONE."

# 修改新分支的版本号
## snapshot 版本号
snapshot_new_version=${newVersion}"-SNAPSHOT"
mvn versions:set -DgroupId=com.github.houbb -DartifactId=${projectName} -DoldVersion=${release_version} -DnewVersion=${snapshot_new_version}
mvn -N versions:update-child-modules
mvn versions:commit

git add .
git commit -m "modify branch ${release_version} TO ${snapshot_new_version}"
git push
git status
echo "3. MODIFY ${release_version} TO ${snapshot_new_version} DONE."

echo "============================= BRANCH RE-CREATE END..."

echo "============================= BRANCH LIST ============================="
git branch -a

# 使用方式:
# 注意:本脚本用于删除分支,谨慎使用!
# 1. 赋值权限: chmod +x ./release_rm.sh
# 2. 执行: ./release_rm.sh
# Last Update Time: 2018-06-21 11:10:42
# Author: houbb


24 changes: 24 additions & 0 deletions src/main/java/com/github/houbb/opencc4j/core/Segment.java
@@ -0,0 +1,24 @@
package com.github.houbb.opencc4j.core;

import java.util.List;

/**
* <p> </p>
*
* <pre> Created: 2018/6/22 下午2:41 </pre>
* <pre> Project: opencc4j </pre>
*
* @author houbinbin
* @version 1.0
* @since JDK 1.7
*/
public interface Segment {

/**
* 分词
* @param original 原始信息
* @return 分词后的列表
*/
List<String> seg(final String original);

}
22 changes: 22 additions & 0 deletions src/main/java/com/github/houbb/opencc4j/core/ZhConvert.java
@@ -0,0 +1,22 @@
package com.github.houbb.opencc4j.core;

/**
* <p> </p>
*
* <pre> Created: 2018/6/22 下午2:42 </pre>
* <pre> Project: opencc4j </pre>
*
* @author houbinbin
* @version 1.0
* @since JDK 1.7
*/
public interface ZhConvert {

/**
* 对中文进行转化
* @param original 原始信息
* @return 转换后的信息
*/
String convert(final String original);

}
55 changes: 0 additions & 55 deletions src/main/java/com/github/houbb/opencc4j/core/ZhConverter.java

This file was deleted.

This file was deleted.

36 changes: 36 additions & 0 deletions src/main/java/com/github/houbb/opencc4j/core/impl/CharSegment.java
@@ -0,0 +1,36 @@
package com.github.houbb.opencc4j.core.impl;

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* <p> 简单的转化为 char 列表 </p>
*
* <pre> Created: 2018/6/22 下午2:43 </pre>
* <pre> Project: opencc4j </pre>
*
* @author houbinbin
* @version 1.0
* @since JDK 1.7
*/
public class CharSegment implements Segment {

@Override
public List<String> seg(String original) {
if(StringUtil.isEmpty(original)) {
return Collections.emptyList();
}

char[] chars = original.toCharArray();
List<String> stringList = new ArrayList<>();
for(char c : chars) {
stringList.add(String.valueOf(c));
}
return stringList;
}

}

0 comments on commit 487a897

Please sign in to comment.