Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
68b1ae8b29
!21 [sync] PR-20: 修复简转繁命令错误
From: @openeuler-sync-bot 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
2023-03-29 09:05:02 +00:00
wu-leilei
eafa788d0f Modify some trans error
(cherry picked from commit 04e4e498c8ae3ff746ef2e38b30659c57b35de38)
2022-11-29 09:53:47 +08:00
openeuler-ci-bot
2c8677cd46 !16 Upgrade to 1.1.3 version
Merge pull request !16 from houyingchao/openEuler-22.03-LTS-Next
2021-12-30 07:09:43 +00:00
houyingchao
5f3cc87d62 Upgrade to 1.1.3 version 2021-12-30 10:02:34 +08:00
openeuler-ci-bot
a2354fa441 !8 Modify some trans error
From: @si-gui
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-08-28 09:58:04 +00:00
sunguoshuai
be96c181de modify some trans error 2021-08-28 17:49:49 +08:00
openeuler-ci-bot
728745ada9 !4 fix build error
Merge pull request !4 from huanghaitao/master
2020-06-29 16:52:13 +08:00
hht8
7534467fa0 fix build error 2020-06-29 16:41:43 +08:00
openeuler-ci-bot
c50a2340fc !2 Add yaml file
Merge pull request !2 from 李振华/master
2020-05-09 11:23:35 +08:00
lizhenhua
b45ee0497c Add yaml file 2020-05-06 18:49:15 +08:00
7 changed files with 51 additions and 65 deletions

Binary file not shown.

BIN
OpenCC-ver.1.1.3.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,32 @@
diff -Nur a/data/dictionary/STPhrases.txt b/data/dictionary/STPhrases.txt
--- a/data/dictionary/STPhrases.txt 2021-09-03 22:26:10.000000000 +0800
+++ b/data/dictionary/STPhrases.txt 2022-11-28 16:36:39.216286051 +0800
@@ -49042,3 +49042,7 @@
龚胜 龔勝
龟卜 龜卜
龟鉴 龜鑑
+芯片面积 芯片面積
+正則表達式 正則表示式
+衍生发行版 衍生發行版
+可是只有他才能完成这个任务 可是只有他才能完成這個任務
diff -Nur a/data/dictionary/TSPhrases.txt b/data/dictionary/TSPhrases.txt
--- a/data/dictionary/TSPhrases.txt 2021-09-03 22:26:10.000000000 +0800
+++ b/data/dictionary/TSPhrases.txt 2022-11-28 16:43:32.650279186 +0800
@@ -30,7 +30,7 @@
乾隆年間 乾隆年间
乾隆皇帝 乾隆皇帝
以免藉口 以免借口
-以功覆過 以功复过
+以功覆過 以功覆过
侔德覆載 侔德复载
傢俱 家具
傷亡枕藉 伤亡枕藉
@@ -125,7 +125,7 @@
無序 无序
牴牾 抵牾
牴觸 抵触
-狐藉虎威 狐借虎威
+狐藉虎威 狐藉虎威
珍珠項鍊 珍珠项链
甚鉅 甚钜
申覆 申复

View File

@ -1,35 +0,0 @@
Index: OpenCC-ver.1.0.5/src/BinaryDict.cpp
===================================================================
--- OpenCC-ver.1.0.5.orig/src/BinaryDict.cpp
+++ OpenCC-ver.1.0.5/src/BinaryDict.cpp
@@ -63,6 +63,12 @@ void BinaryDict::SerializeToFile(FILE* f
}
BinaryDictPtr BinaryDict::NewFromFile(FILE* fp) {
+ size_t offsetBound, savedOffset;
+ savedOffset = ftell(fp);
+ fseek(fp, 0L, SEEK_END);
+ offsetBound = ftell(fp) - savedOffset;
+ fseek(fp, savedOffset, SEEK_SET);
+
BinaryDictPtr dict(new BinaryDict(LexiconPtr(new Lexicon)));
// Number of items
@@ -109,7 +115,7 @@ BinaryDictPtr BinaryDict::NewFromFile(FI
// Key offset
size_t keyOffset;
unitsRead = fread(&keyOffset, sizeof(size_t), 1, fp);
- if (unitsRead != 1) {
+ if (unitsRead != 1 || keyOffset >= offsetBound) {
throw InvalidFormat("Invalid OpenCC binary dictionary (keyOffset)");
}
const char* key = dict->keyBuffer.c_str() + keyOffset;
@@ -118,7 +124,7 @@ BinaryDictPtr BinaryDict::NewFromFile(FI
for (size_t j = 0; j < numValues; j++) {
size_t valueOffset;
unitsRead = fread(&valueOffset, sizeof(size_t), 1, fp);
- if (unitsRead != 1) {
+ if (unitsRead != 1 || valueOffset >= offsetBound) {
throw InvalidFormat("Invalid OpenCC binary dictionary (valueOffset)");
}
const char* value = dict->valueBuffer.c_str() + valueOffset;

View File

@ -1,26 +0,0 @@
Index: OpenCC-ver.1.0.5/CMakeLists.txt
===================================================================
--- OpenCC-ver.1.0.5.orig/CMakeLists.txt
+++ OpenCC-ver.1.0.5/CMakeLists.txt
@@ -68,7 +68,7 @@ set (DIR_PREFIX ${CMAKE_INSTALL_PREFIX})
set (DIR_INCLUDE ${DIR_PREFIX}/include/)
set (DIR_SHARE ${DIR_PREFIX}/share/)
set (DIR_ETC ${DIR_PREFIX}/etc/)
-set (DIR_LIBRARY ${DIR_PREFIX}/lib${LIB_SUFFIX}/)
+set (DIR_LIBRARY ${LIB_INSTALL_DIR})
if (DEFINED SHARE_INSTALL_PREFIX)
set (DIR_SHARE ${SHARE_INSTALL_PREFIX})
Index: OpenCC-ver.1.0.5/data/CMakeLists.txt
===================================================================
--- OpenCC-ver.1.0.5.orig/data/CMakeLists.txt
+++ OpenCC-ver.1.0.5/data/CMakeLists.txt
@@ -1,6 +1,6 @@
set(OPENCC_DICT_BIN opencc_dict)
-set(DICT_MERGE_BIN python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/merge.py)
-set(DICT_REVERSE_BIN python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/reverse.py)
+set(DICT_MERGE_BIN python3 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/merge.py)
+set(DICT_REVERSE_BIN python3 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/reverse.py)
set(DICT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dictionary)
set(DICT_GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR})

View File

@ -1,12 +1,11 @@
Name: opencc
Version: 1.0.5
Release: 4
Version: 1.1.3
Release: 2
Summary: Simplified Chinese Traditional Conversion Library
License: ASL 2.0
URL: https://github.com/BYVoid/OpenCC
Source0: https://github.com/BYVoid/OpenCC/archive/ver.%{version}.tar.gz#/OpenCC-ver.%{version}.tar.gz
Patch0001: opencc-fixes-cmake.patch
Patch0002: opencc-check-bounds.patch
Patch0001: modify-some-trans-error.patch
Provides: %{name}-tools = %{version}-%{release}
Obsoletes: %{name}-tools < %{version}-%{release}
@ -67,5 +66,17 @@ ctest
%{_datadir}/opencc/doc
%changelog
* Mon Nov 28 2022 wulei <wulei80@h-partners.com> - 1.1.3-2
- Modify some trans error
* Thu Dec 30 2021 houyingchao <houyingchao@huawei.com> - 1.1.3-1
- Upgrade to 1.1.3 version
* Sat Aug 28 2021 sunguoshuai <sunguoshuai@huawei.com> - 1.0.5-6
- Modify some trans error
* Mon Jun 29 2020 huanghaitao <huanghaitao8@huawei.com> - 1.0.5-5
- Fix build error
* Thu Dec 12 2019 fengbing <fengbing7@huawei.com> - 1.0.5-4
- Package init

4
opencc.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: BYVoid/OpenCC
tag_prefix: ^v
seperator: .