Reset // Preparing for Operation Caduceus.

- This also makes SwiftyOpenCC and OpenCC offline for conveniences.
- ParselessLM has been introduced together with the upgraded libvchewing-data module.
- We changed the way of deploying the CNS data in the libvchewing-data submodule this time.
- It takes a long time to reimplement vChewing-specific features back.
This commit is contained in:
ShikiSuen 2022-02-06 15:26:16 +08:00
parent 339e677011
commit cc4045fe9f
913 changed files with 245532 additions and 6150 deletions

View File

@ -18,7 +18,7 @@ private let kTargetFullBinPartialPath = "~/Library/Input Methods/vChewing.app/Co
private let kTranslocationRemovalTickInterval: TimeInterval = 0.5
private let kTranslocationRemovalDeadline: TimeInterval = 60.0
@main
@NSApplicationMain
@objc (AppDelegate)
class AppDelegate: NSWindowController, NSApplicationDelegate {
@IBOutlet weak private var installButton: NSButton!

View File

@ -91,7 +91,7 @@
<rect key="frame" x="91" y="166" width="427" height="160"/>
<clipView key="contentView" drawsBackground="NO" id="NrY-FL-PVu" userLabel="appEULAContentClip">
<rect key="frame" x="1" y="1" width="425" height="158"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="bar" smartInsertDelete="YES" id="47J-tO-8TZ" userLabel="appEULAContent">
<rect key="frame" x="0.0" y="-2" width="425" height="158"/>

View File

@ -1,5 +0,0 @@
/* Localized versions of Info.plist keys */
CFBundleName = "威注音入力 実装用アプリ";
NSHumanReadableCopyright = "© 2011-2022 OpenVanilla Project & © 2021-2022 vChewing Project.";
CFEULAContent = "ソースコード形式かバイナリ形式か、変更するかしないかを問わず、以下の条件を満たす場合に限り、再頒布および使用が許可されます。\n\n① ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、および下記免責条項を含めること。\n② バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の資料に、上記の著作権表示、本条件一覧、および下記免責条項を含めること。\n③ 書面による特別の許可なしに、本ソフトウェアから派生した製品の宣伝または販売促進に、「威注音」の名前または諸貢献者の名前を使用してはならない。\n\n本ソフトウェアは、著作権者および諸貢献者によって「現状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、および特定の目的に対する適合性に関する暗黙の保証も含め、またそれに限定されない、いかなる保証もありません。著作権者も諸貢献者も、事由のいかんを問わず、 損害発生の原因いかんを問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その他の)不法行為であるかを問わず、仮にそのような損害が発生する可能性を知らされていたとしても、本ソフトウェアの使用によって発生した(代替品または代用サービスの調達、使用の喪失、データの喪失、利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害について、一切責任を負わないものとします。\n";

View File

@ -1,18 +0,0 @@
"Upgrade" = "承認と更新";
"Cancel" = "取消";
"Cannot activate the input method." = "入力アプリ、起動失敗。";
"Cannot copy the file to the destination." = "目標へファイルのコピーできません。";
"Install Failed" = "実装失敗。";
"Installation Successful" = "実装完了";
"OK" = "うむ";
"vChewing is ready to use." = "威注音入力、利用準備完了。";
"Stopping the old version. This may take up to one minute…" = "古いバージョンを強制停止中。1分かかると恐れ入りますが……";
"Attention" = "ご注意";
"vChewing is upgraded, but please log out or reboot for the new version to be fully functional." = "威注音入力の更新は実装完了しましたが、うまく作動できるために、このパソコンの再起動および再ログインが必要だと恐れ入ります。";
"Fatal Error" = "致命錯乱";
"Abort" = "中止";
"Cannot register input source %@ at %@." = "「%2$@」で入力アプリ「\"%1$@\"」の実装は失敗しました。";
"Cannot find input source %@ after registration." = "登録済みですが「%@」は見つけませんでした。";
"Warning" = "お知らせ";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "入力アプリの自動起動はうまく出来なかったかもしれません。ご自分で「システム環境設定→キーボード→入力ソース」で起動してください。";
"Continue" = "続行";

View File

@ -1,72 +0,0 @@
/* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */
"29.title" = "AMainMenu";
/* Class = "NSMenuItem"; title = "vChewing Installer"; ObjectID = "56"; */
"56.title" = "威注音入力 実装用アプリ";
/* Class = "NSMenu"; title = "vChewing Installer"; ObjectID = "57"; */
"57.title" = "威注音入力 実装用アプリ";
/* Class = "NSMenuItem"; title = "About vChewing Installer"; ObjectID = "58"; */
"58.title" = "威注音入力 実装用アプリについて…";
/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */
"83.title" = "ファイル";
/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */
"130.title" = "サービス";
/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */
"131.title" = "サービス";
/* Class = "NSMenuItem"; title = "Hide vChewing Installer"; ObjectID = "134"; */
"134.title" = "全ウィンドウ隠す";
/* Class = "NSMenuItem"; title = "Quit vChewing Installer"; ObjectID = "136"; */
"136.title" = "威注音入力 実装用アプリ を終了";
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
"145.title" = "他のアプリのウィンドウを隠す";
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
"150.title" = "隠したウィンドウを全部表示する";
/* Class = "NSWindow"; title = "vChewing Installer"; ObjectID = "371"; */
"371.title" = "威注音入力 実装用アプリ";
/* Class = "NSButtonCell"; title = "I Accept"; ObjectID = "576"; */
"576.title" = "承認する";
/* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "593"; */
"593.title" = "取消";
/* Class = "NSTextFieldCell"; title = "3-Clause BSD License:"; ObjectID = "AVS-ih-FXM"; */
"AVS-ih-FXM.title" = "3条項BSDライセンス (3-Clause BSD License):";
/* Class = "NSTextFieldCell"; title = "vChewing for macOS"; ObjectID = "GNc-8S-1VG"; */
"GNc-8S-1VG.title" = "vChewing for macOS";
/* Class = "NSTextFieldCell"; title = "version_placeholder"; ObjectID = "JRP-At-H9q"; */
"JRP-At-H9q.title" = "version_placeholder";
/* Class = "NSTextFieldCell"; title = "DISCLAIMER: The vChewing project, having no relationship of cooperation or affiliation with the OpenVanilla project, is not responsible for the phrase database shipped in the original McBopomofo project. Certain geopolitical and ideological contents, which are potentially harmful to the global spread of this software, have been removed from vChewing official phrase database."; ObjectID = "Q9M-ni-kUM"; */
"Q9M-ni-kUM.title" = "免責事項vChewing Project は、OpenVanilla と協力関係や提携関係にあるわけではなく、OpenVanilla が小麦注音プロジェクトに同梱した辞書データについて、vChewing Project は一切責任負い兼ねる。特定な地政学的・観念形態的な内容は、vChewing アプリの世界的な普及に妨害する恐れがあるため、vChewing 公式辞書データから削除済みである。";
/* Class = "NSTextFieldCell"; title = "Derived from OpenVanilla McBopopmofo Project."; ObjectID = "QYf-Nf-hoi"; */
"QYf-Nf-hoi.title" = "OpenVanilla 小麦注音プロジェクトから派生。";
/* Class = "NSTextFieldCell"; title = "McBopomofo Engine by Mengjuei Hsieh, Lukhnos Liu, Zonble Yang, et al.\nvChewing macOS Development Reinforced by Hiraku Wang.\nvChewing Phrase Database Maintained by Shiki Suen."; ObjectID = "VW8-s5-Wpn"; */
"VW8-s5-Wpn.title" = "小麦注音入力エンジン開発Mengjuei Hsieh, Lukhnos Liu, Zonble Yang, など。\nmacOS 版の開発協力Hiraku Wang。\n威注音語彙データの維持孫志貴 (Shiki Suen)。";
/* Class = "NSTextFieldCell"; title = "Placeholder for showing copyright information."; ObjectID = "eo3-TK-0rB"; */
"eo3-TK-0rB.title" = "Placeholder for showing copyright information.";
/* Class = "NSWindow"; title = "Window"; ObjectID = "gHl-Hx-eQn"; */
"gHl-Hx-eQn.title" = "Window";
/* Class = "NSTextFieldCell"; title = "By installing the software, you must accept the terms above."; ObjectID = "mf8-6e-z7X"; */
"mf8-6e-z7X.title" = "このアプリを実装するために、上記の条約を承認すべきである。";
/* Class = "NSTextFieldCell"; title = "Stopping the old version. This may take up to one minute…"; ObjectID = "nTo-dx-qfZ"; */
"nTo-dx-qfZ.title" = "古いバージョンを強制停止中。1分かかると恐れ入りますが……";

View File

@ -1,5 +0,0 @@
/* Localized versions of Info.plist keys */
CFBundleName = "威注音安装程式";
NSHumanReadableCopyright = "© 2011-2022 OpenVanilla Project & © 2021-2022 vChewing Project.";
CFEULAContent = "该授权条款,在使用者符合以下诸条件之情形下,授予使用者使用及再散播本软件套件装原始码及二进位可执行形式之权利,无论此包装是否经改作皆然:\n\n对于本软件原始码之再散播必须保留上述之著作权宣告、此诸条件表列以及下述之免责声明。\n对于本套件二进位可执行形式之再散播必须连带以档案以及或者其他附于散播包装中之媒介方式重制上述之著作权宣告、此诸条件表列以及下述之免责声明。\n未获事前取得书面授权不得使用威注音或本软件贡献者之名称来为本软件之衍生物做任何表示支援、认可或推广、促销之行为。\n\n免责声明本软件由威注音及本软件之贡献者以现状「as is」提供本软件套件装不负任何明示或默示之担保责任包括但不限于就适售性以及特定目之之适用性为默示性担保。威注音及本软件之贡献者无论任何条件、无论成因或任何责任主义、无论此责任为因合约关系、无过失责任主义或因非违约之侵权包括过失或其他原因等而起对于任何因使用本软件套件装所产生之任何直接性、间接性、偶发性、特殊性、惩罚性或任何结果之损害包括但不限于替代商品或劳务之购用、使用损失、资料损失、利益损失、业务中断等等不负任何责任即在该种使用已获事前告知可能会造成此类损害之情形下亦然。\n";

View File

@ -1,18 +0,0 @@
"Upgrade" = "接受并升级";
"Cancel" = "取消";
"Cannot activate the input method." = "无法启用输入法。";
"Cannot copy the file to the destination." = "无法将输入法拷贝至目的地。";
"Install Failed" = "安装失败";
"Installation Successful" = "安装成功";
"OK" = "确定";
"vChewing is ready to use." = "威注音输入法安装成功";
"Finish" = "结束";
"Attention" = "请注意";
"vChewing is upgraded, but please log out or reboot for the new version to be fully functional." = "vChewing 安装完成,但建议您登出或重新开机,以便顺利使用新版。";
"Fatal Error" = "安装错误";
"Abort" = "放弃安装";
"Cannot register input source %@ at %@." = "无法从档案位置 %2$@ 安装输入法 \"%1$@\"。";
"Cannot find input source %@ after registration." = "在注册完输入法 \"%@\" 仍然无法找到输入法。";
"Warning" = "安装不完整";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "输入法已经安装好,但可能没有完全启用。请从“系统偏好设定” > “键盘” > “输入方式”分页加入输入法。";
"Continue" = "继续";

View File

@ -1,73 +0,0 @@
/* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */
"29.title" = "AMainMenu";
/* Class = "NSMenuItem"; title = "vChewing Installer"; ObjectID = "56"; */
"56.title" = "威注音安装程式";
/* Class = "NSMenu"; title = "vChewing Installer"; ObjectID = "57"; */
"57.title" = "威注音安装程式";
/* Class = "NSMenuItem"; title = "About vChewing Installer"; ObjectID = "58"; */
"58.title" = "关于威注音安装程式";
/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */
"83.title" = "档案";
/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */
"130.title" = "服务";
/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */
"131.title" = "服务";
/* Class = "NSMenuItem"; title = "Hide vChewing Installer"; ObjectID = "134"; */
"134.title" = "隐藏威注音安装程式";
/* Class = "NSMenuItem"; title = "Quit vChewing Installer"; ObjectID = "136"; */
"136.title" = "结束威注音安装程式";
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
"145.title" = "隐藏其他程式";
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
"150.title" = "显示所有程式";
/* Class = "NSWindow"; title = "vChewing Installer"; ObjectID = "371"; */
"371.title" = "威注音输入法安装程式";
/* Class = "NSButtonCell"; title = "I Accept"; ObjectID = "576"; */
"576.title" = "我接受";
/* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "593"; */
"593.title" = "取消安装";
/* Class = "NSTextFieldCell"; title = "3-Clause BSD License:"; ObjectID = "AVS-ih-FXM"; */
"AVS-ih-FXM.title" = "伯克利软件三款型授权合约 (3-Clause BSD License):";
/* Class = "NSTextFieldCell"; title = "vChewing for macOS"; ObjectID = "GNc-8S-1VG"; */
"GNc-8S-1VG.title" = "vChewing for macOS";
/* Class = "NSTextFieldCell"; title = "version_placeholder"; ObjectID = "JRP-At-H9q"; */
// "JRP-At-H9q.title" = "version_placeholder";
/* Class = "NSTextFieldCell"; title = "DISCLAIMER: The vChewing project, having no relationship of cooperation or affiliation with the OpenVanilla project, is not responsible for the phrase database shipped in the original McBopomofo project. Certain geopolitical and ideological contents, which are potentially harmful to the global spread of this software, have been removed from vChewing official phrase database."; ObjectID = "Q9M-ni-kUM"; */
"Q9M-ni-kUM.title" = "免责声明:威注音专案对小麦注音官方专案内赠的小麦注音原版词库内容不负任何责任。威注音输入法专用的威注音官方词库已清除任何「会在法理上妨碍威注音在全球传播」的「与地缘政治及政治意识形态有关的」内容。威注音专案与 OpenVanilla 专案之间无合作关系、无隶属关系。";
/* Class = "NSTextFieldCell"; title = "Derived from OpenVanilla McBopopmofo Project."; ObjectID = "QYf-Nf-hoi"; */
"QYf-Nf-hoi.title" = "该专案由 OpenVanilla 小麦注音专案衍生而来。";
/* Class = "NSTextFieldCell"; title = "McBopomofo Engine by Mengjuei Hsieh, Lukhnos Liu, Zonble Yang, et al.\nvChewing macOS Development Reinforced by Hiraku Wang.
vChewing Phrase Database Maintained by Shiki Suen."; ObjectID = "VW8-s5-Wpn"; */
"VW8-s5-Wpn.title" = "小麦注音引擎研发Mengjuei Hsieh, Lukhnos Liu, Zonble Yang, 等。\n威注音 macOS 程式研发协力Hiraku Wang。\n威注音词库维护孙志贵 (Shiki Suen)。";
/* Class = "NSTextFieldCell"; title = "Placeholder for showing copyright information."; ObjectID = "eo3-TK-0rB"; */
// "eo3-TK-0rB.title" = "Placeholder for showing copyright information.";
/* Class = "NSWindow"; title = "Window"; ObjectID = "gHl-Hx-eQn"; */
"gHl-Hx-eQn.title" = "视窗";
/* Class = "NSTextFieldCell"; title = "By installing the software, click the \"I Accept\" to the terms above:"; ObjectID = "mf8-6e-z7X"; */
"mf8-6e-z7X.title" = "若要安装该软件,请接受上述条款。";
/* Class = "NSTextFieldCell"; title = "Stopping the old version. This may take up to one minute…"; ObjectID = "nTo-dx-qfZ"; */
"nTo-dx-qfZ.title" = "等待旧版完全停用,大约需要一分钟…";

View File

@ -1,5 +0,0 @@
/* Localized versions of Info.plist keys */
CFBundleName = "威注音安裝程式";
NSHumanReadableCopyright = "© 2011-2022 OpenVanilla Project & © 2021-2022 vChewing Project.";
CFEULAContent = "該授權條款,在使用者符合以下諸條件之情形下,授予使用者使用及再散播本軟體套件裝原始碼及二進位可執行形式之權利,無論此包裝是否經改作皆然:\n\n對於本軟體原始碼之再散播必須保留上述之著作權宣告、此諸條件表列以及下述之免責聲明。\n對於本套件二進位可執行形式之再散播必須連帶以檔案以及或者其他附於散播包裝中之媒介方式重製上述之著作權宣告、此諸條件表列以及下述之免責聲明。\n未獲事前取得書面授權不得使用威注音或本軟體貢獻者之名稱來為本軟體之衍生物做任何表示支援、認可或推廣、促銷之行為。\n\n免責聲明本軟體由威注音及本軟體之貢獻者以現狀「as is」提供本軟體套件裝不負任何明示或默示之擔保責任包括但不限於就適售性以及特定目之之適用性為默示性擔保。威注音及本軟體之貢獻者無論任何條件、無論成因或任何責任主義、無論此責任為因合約關係、無過失責任主義或因非違約之侵權包括過失或其他原因等而起對於任何因使用本軟體套件裝所產生之任何直接性、間接性、偶發性、特殊性、懲罰性或任何結果之損害包括但不限於替代商品或勞務之購用、使用損失、資料損失、利益損失、業務中斷等等不負任何責任即在該種使用已獲事前告知可能會造成此類損害之情形下亦然。\n";

View File

@ -1,20 +0,0 @@
"Upgrade" = "接受並升級";
"Cancel" = "取消";
"Cannot activate the input method." = "無法啟用輸入法。";
"Cannot copy the file to the destination." = "無法將輸入法拷貝至目的地。";
"Install Failed" = "安裝失敗";
"Installation Successful" = "安裝成功";
"OK" = "確定";
"vChewing is ready to use." = "威注音輸入法安裝成功";
"Finish" = "結束";
"Attention" = "請注意";
"vChewing is upgraded, but please log out or reboot for the new version to be fully functional." = "vChewing 安裝完成,但建議您登出或重新開機,以便順利使用新版。";
"Fatal Error" = "安裝錯誤";
"Abort" = "放棄安裝";
"Cannot register input source %@ at %@." = "無法從檔案位置 %2$@ 安裝輸入法 \"%1$@\"。";
"Cannot find input source %@ after registration." = "在註冊完輸入法 \"%@\" 仍然無法找到輸入法。";
"Warning" = "安裝不完整";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "輸入法已經安裝好,但可能沒有完全啟用。請從「系統偏好設定」 > 「鍵盤」 > 「輸入方式」分頁加入輸入法。";
"Continue" = "繼續";

View File

@ -1,73 +0,0 @@
/* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */
"29.title" = "AMainMenu";
/* Class = "NSMenuItem"; title = "vChewing Installer"; ObjectID = "56"; */
"56.title" = "威注音安裝程式";
/* Class = "NSMenu"; title = "vChewing Installer"; ObjectID = "57"; */
"57.title" = "威注音安裝程式";
/* Class = "NSMenuItem"; title = "About vChewing Installer"; ObjectID = "58"; */
"58.title" = "關於威注音安裝程式";
/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */
"83.title" = "檔案";
/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */
"130.title" = "服務";
/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */
"131.title" = "服務";
/* Class = "NSMenuItem"; title = "Hide vChewing Installer"; ObjectID = "134"; */
"134.title" = "隱藏威注音安裝程式";
/* Class = "NSMenuItem"; title = "Quit vChewing Installer"; ObjectID = "136"; */
"136.title" = "結束威注音安裝程式";
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
"145.title" = "隱藏其他程式";
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
"150.title" = "顯示所有程式";
/* Class = "NSWindow"; title = "vChewing Installer"; ObjectID = "371"; */
"371.title" = "威注音輸入法安裝程式";
/* Class = "NSButtonCell"; title = "I Accept"; ObjectID = "576"; */
"576.title" = "我接受";
/* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "593"; */
"593.title" = "取消安裝";
/* Class = "NSTextFieldCell"; title = "3-Clause BSD License:"; ObjectID = "AVS-ih-FXM"; */
"AVS-ih-FXM.title" = "柏克萊軟體三款型授權合約 (3-Clause BSD License):";
/* Class = "NSTextFieldCell"; title = "vChewing for macOS"; ObjectID = "GNc-8S-1VG"; */
"GNc-8S-1VG.title" = "vChewing for macOS";
/* Class = "NSTextFieldCell"; title = "version_placeholder"; ObjectID = "JRP-At-H9q"; */
// "JRP-At-H9q.title" = "version_placeholder";
/* Class = "NSTextFieldCell"; title = "DISCLAIMER: The vChewing project, having no relationship of cooperation or affiliation with the OpenVanilla project, is not responsible for the phrase database shipped in the original McBopomofo project. Certain geopolitical and ideological contents, which are potentially harmful to the global spread of this software, have been removed from vChewing official phrase database."; ObjectID = "Q9M-ni-kUM"; */
"Q9M-ni-kUM.title" = "免責聲明:威注音專案對小麥注音官方專案內贈的小麥注音原版詞庫內容不負任何責任。威注音輸入法專用的威注音官方詞庫已清除任何「會在法理上妨礙威注音在全球傳播」的「與地緣政治及政治意識形態有關的」內容。威註音專案與 OpenVanilla 專案之間無合作關係、無隸屬關係。";
/* Class = "NSTextFieldCell"; title = "Derived from OpenVanilla McBopopmofo Project."; ObjectID = "QYf-Nf-hoi"; */
"QYf-Nf-hoi.title" = "該專案由 OpenVanilla 小麥注音專案衍生而來。";
/* Class = "NSTextFieldCell"; title = "McBopomofo Engine by Mengjuei Hsieh, Lukhnos Liu, Zonble Yang, et al.\nvChewing macOS Development Reinforced by Hiraku Wang.
vChewing Phrase Database Maintained by Shiki Suen."; ObjectID = "VW8-s5-Wpn"; */
"VW8-s5-Wpn.title" = "小麥注音引擎研發Mengjuei Hsieh, Lukhnos Liu, Zonble Yang, 等。\n威注音 macOS 程式研發協力Hiraku Wang。\n威注音詞庫維護孫志貴 (Shiki Suen)。";
/* Class = "NSTextFieldCell"; title = "Placeholder for showing copyright information."; ObjectID = "eo3-TK-0rB"; */
// "eo3-TK-0rB.title" = "Placeholder for showing copyright information.";
/* Class = "NSWindow"; title = "Window"; ObjectID = "gHl-Hx-eQn"; */
"gHl-Hx-eQn.title" = "視窗";
/* Class = "NSTextFieldCell"; title = "By installing the software, click the \"I Accept\" to the terms above:"; ObjectID = "mf8-6e-z7X"; */
"mf8-6e-z7X.title" = "若要安裝該軟體,請接受上述條款。";
/* Class = "NSTextFieldCell"; title = "Stopping the old version. This may take up to one minute…"; ObjectID = "nTo-dx-qfZ"; */
"nTo-dx-qfZ.title" = "等待舊版完全停用,大約需要一分鐘…";

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 DengXiang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

17
Packages/SwiftyOpenCC/OpenCC/.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
*.pyc
*.tgz
.project
.cproject
/.vscode
/.mypy_cache
/build
/other
/doc/html
/dist
/opencc.xcodeproj
/test/dict.ocd
/test/dict.txt
/test/dict.bin
/xcode
/node_modules
/*.egg-info

View File

@ -0,0 +1,12 @@
Author:
Carbo Kuo <byvoid@byvoid.com>
Contributors:
Peng Huang <shawn.p.huang@gmail.com>
Kefu Chai <tchaikov@gmail.com>
LI Daobing <lidaobing@gmail.com>
Asias <asias.hejun@gmail.com>
Peng Wu <alexepico@gmail.com>
Xiaojun Ma <damage3025@gmail.com>
佛振 <chen.sst@gmail.com>

View File

@ -0,0 +1,230 @@
#
# Open Chinese Convert
#
# Copyright 2010-2020 Carbo Kuo <byvoid@byvoid.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
######## Project settings
cmake_minimum_required(VERSION 2.8)
set (PACKAGE_NAME opencc)
project (${PACKAGE_NAME} CXX)
include (CTest)
######## Options
option(BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
option(BUILD_SHARED_LIBS "Build opencc as shared library" ON)
option(ENABLE_GTEST "Build all tests." OFF)
option(ENABLE_BENCHMARK "Build benchmark tests." OFF)
option(ENABLE_DARTS "Build DartsDict (ocd format)." ON)
option(BUILD_PYTHON "Build python library" OFF)
option(USE_SYSTEM_DARTS "Use system version of Darts" OFF)
option(USE_SYSTEM_GOOGLE_BENCHMARK "Use system version of Google Benchmark" OFF)
option(USE_SYSTEM_GTEST "Use system version of GoogleTest" OFF)
option(USE_SYSTEM_MARISA "Use system version of Marisa" OFF)
option(USE_SYSTEM_PYBIND11 "Use system version of pybind11" OFF)
option(USE_SYSTEM_RAPIDJSON "Use system version of RapidJSON" OFF)
option(USE_SYSTEM_TCLAP "Use system version of TCLAP" OFF)
######## Package information
set (PACKAGE_URL https://github.com/BYVoid/Opencc)
set (PACKAGE_BUGREPORT https://github.com/BYVoid/Opencc/issues)
set (OPENCC_VERSION_MAJOR 1)
set (OPENCC_VERSION_MINOR 1)
set (OPENCC_VERSION_REVISION 2)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (version_suffix .Debug)
endif (CMAKE_BUILD_TYPE MATCHES Debug)
set (
OPENCC_VERSION
${OPENCC_VERSION_MAJOR}.${OPENCC_VERSION_MINOR}.${OPENCC_VERSION_REVISION}${version_suffix}
)
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${PACKAGE_NAME}-${OPENCC_VERSION_MAJOR}.${OPENCC_VERSION_MINOR}.${OPENCC_VERSION_REVISION}"
)
set(CPACK_SOURCE_IGNORE_FILES
"/build/;/test/dict.ocd;/test/dict.txt;/test/dict.bin;/other/;/opencc.xcodeproj/;/.git/;.gitignore;~$;.pyc;${CPACK_SOURCE_IGNORE_FILES}"
)
include(CPack)
######## Windows
#if (WIN32)
# set(CMAKE_SHARED_LIBRARY_PREFIX ${CMAKE_INSTALL_PREFIX})
# set(CMAKE_STATIC_LIBRARY_PREFIX ${CMAKE_INSTALL_PREFIX})
#endif (WIN32)
######## Mac OS X
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_MACOSX_RPATH 1)
endif()
######## Directory
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}/)
if (DEFINED SHARE_INSTALL_PREFIX)
set (DIR_SHARE ${SHARE_INSTALL_PREFIX})
endif (DEFINED SHARE_INSTALL_PREFIX)
if (DEFINED INCLUDE_INSTALL_DIR)
set (DIR_INCLUDE ${INCLUDE_INSTALL_DIR})
endif (DEFINED INCLUDE_INSTALL_DIR)
if (DEFINED SYSCONF_INSTALL_DIR)
set (DIR_ETC ${SYSCONF_INSTALL_DIR})
endif (DEFINED SYSCONF_INSTALL_DIR)
if (DEFINED LIB_INSTALL_DIR)
set (DIR_LIBRARY ${LIB_INSTALL_DIR})
endif (DEFINED LIB_INSTALL_DIR)
set (DIR_SHARE_OPENCC ${DIR_SHARE}/opencc/)
set (DIR_SHARE_LOCALE ${DIR_SHARE}/locale/)
######## Configuration
configure_file(
opencc.pc.in
opencc.pc
@ONLY
)
install(
FILES
${CMAKE_BINARY_DIR}/opencc.pc
DESTINATION
${DIR_LIBRARY}/pkgconfig
)
######## Compiler flags
add_definitions(
-DPKGDATADIR="${DIR_SHARE_OPENCC}"
-DLOCALEDIR="${DIR_SHARE_LOCALE}"
-DVERSION="${OPENCC_VERSION}"
-DPACKAGE_NAME="${PACKAGE_NAME}"
)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_definitions(
-std=c++14
-Wall
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-O0 -g3)
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions(
-std=c++14
-Wall
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-O0 -g3)
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(
/W4
/D "_CRT_SECURE_NO_WARNINGS"
)
endif()
if (NOT BUILD_SHARED_LIBS)
add_definitions(
-DOpencc_BUILT_AS_STATIC
)
endif (NOT BUILD_SHARED_LIBS)
if (ENABLE_GTEST)
add_definitions(
-DPROJECT_BINARY_DIR="${PROJECT_BINARY_DIR}"
-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
)
endif()
if (ENABLE_BENCHMARK)
add_definitions(
-DPROJECT_BINARY_DIR="${PROJECT_BINARY_DIR}"
-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
)
endif()
if (ENABLE_DARTS)
add_definitions(
-DENABLE_DARTS
)
endif()
######## Dependencies
if(NOT USE_SYSTEM_MARISA)
message(STATUS "Use bundled marisa library.")
add_subdirectory(deps/marisa-0.2.6)
else()
find_library(LIBMARISA NAMES marisa)
if (LIBMARISA)
message(STATUS "libmarisa found: ${LIBMARISA}")
else()
message(FATAL_ERROR "libmarisa not found.")
endif()
endif()
######## Subdirectories
add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(data)
add_subdirectory(test)
######## Testing
if (ENABLE_GTEST)
if(NOT USE_SYSTEM_GTEST)
add_subdirectory(deps/gtest-1.11.0)
endif()
enable_testing()
endif()
if (ENABLE_BENCHMARK)
set(BENCHMARK_ENABLE_TESTING OFF)
if(NOT USE_SYSTEM_GOOGLE_BENCHMARK)
add_subdirectory(deps/google-benchmark)
endif()
enable_testing()
endif()
######## Python
if (BUILD_PYTHON)
if(USE_SYSTEM_PYBIND11)
include(pybind11Config)
include(pybind11Common)
include(pybind11Tools)
else()
add_subdirectory(deps/pybind11-2.5.0)
endif()
pybind11_add_module(opencc_clib src/py_opencc.cpp)
target_link_libraries(opencc_clib PRIVATE libopencc)
endif()

View File

@ -0,0 +1,56 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View File

@ -0,0 +1,103 @@
#
# Open Chinese Convert
#
# Copyright 2010-2020 Carbo Kuo <byvoid@byvoid.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
PREFIX = /usr
.PHONY: build clean node test xcode-build
build:
mkdir -p build/rel
(cd build/rel; cmake \
-DBUILD_DOCUMENTATION:BOOL=ON \
-DENABLE_GTEST:BOOL=OFF \
-DENABLE_BENCHMARK:BOOL=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
../..)
make -C build/rel VERBOSE=${VERBOSE} PREFIX=${PREFIX}
package: build
make -C build/rel package_source VERBOSE=${VERBOSE}
make -C build/rel package_source VERBOSE=${VERBOSE} PREFIX=${PREFIX}
test:
mkdir -p build/dbg/root
(cd build/dbg; cmake \
-DBUILD_DOCUMENTATION:BOOL=OFF \
-DENABLE_GTEST:BOOL=ON \
-DENABLE_BENCHMARK:BOOL=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=`pwd`/root \
../..)
make -C build/dbg VERBOSE=${VERBOSE}
(cd build/dbg; ctest --verbose)
make -C build/dbg install VERBOSE=${VERBOSE}
benchmark:
mkdir -p build/perf
(cd build/perf; cmake \
-DBUILD_DOCUMENTATION:BOOL=OFF \
-DENABLE_GTEST:BOOL=OFF \
-DENABLE_BENCHMARK:BOOL=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=`pwd`/root \
../..)
make -C build/perf VERBOSE=${VERBOSE} PREFIX=${PREFIX}
(cd build/perf; ctest --verbose)
node:
node-gyp configure
node-gyp build
node-test: node
npm test
xcode-build:
mkdir -p xcode
(cd xcode; cmake \
-G "Xcode" \
-DBUILD_DOCUMENTATION:BOOL=OFF \
-DENABLE_GTEST:BOOL=ON \
-DENABLE_BENCHMARK:BOOL=ON \
..; \
xcodebuild build)
python-build:
python setup.py build_ext
python-install: python-build
python setup.py install
python-dist: python-build
python setup.py bdist_wheel
python-test: python-build
cd python; pytest .
test-all: test node-test python-test
format:
find "src" "node" "test" -iname "*.hpp" -o -iname "*.cpp" -o -iname "*.cc" \
-o -iname "*.c" -o -iname "*.h" \
| xargs clang-format -i
clean:
rm -rf build xcode python/opencc/clib *.egg-info
install: build
make -C build/rel install VERBOSE=${VERBOSE} PREFIX=${PREFIX}

View File

@ -0,0 +1,233 @@
# Change History of OpenCC
## Version 1.1.2
2021年3月2日
* 新增香港繁體轉換。
* 根據《通用漢字規範表》修正大量簡體異體字轉換。調整臺灣標準,避免過度轉換。
* 修正編譯兼容性問題,包括並行編譯。
* 修正1.1.0以來引入的性能嚴重下降問題。
## Version 1.1.1
2020年5月22日
* 正式提供[Python](https://pypi.org/project/OpenCC/)接口和TypeScript類型標註。
* 更新動態鏈接庫`SOVERSION`到`1.1`由於C++內部接口發生變更。
* 進一步改進與Windows MSVC的兼容性。
* 簡化頭文件結構,加快編譯速度。刪除不必要的`using`。
* 修復部分香港標準字。
## Version 1.1.0
2020年5月10日
* 新辭典格式`ocd2`基於Marisa Trie 0.2.5。辭典大小大幅減少。`STPhrases.ocd`從4.3MB減少到`STPhrases.ocd2`的924KB。
* 升級依賴的rapidjson版本到1.1.0tclap到1.2.2gtest到1.11.0。
* 更改「涌/湧」的默認轉換,修正多個詞組轉換。
* 提供Windows的預編譯版本下載AppVeyor
* 增加基準測試結果。
## Version 1.0.6
2020年4月13日
* 正式支持日本語新字體轉換。
* 升級Node.js依賴改進兼容性。
* 修復多處多平臺編譯和兼容性問題。
* 修正大量轉換錯誤。
## Version 1.0.5
2017年2月6日
* 修正Windows下CMake和Visual Studio的問題。
* 修正FNV Hash的32位編譯警告。
* 增加若干臺灣常用詞彙轉換和異體字轉換。
* 增加和修正若干轉換問題。
* 加快Node模塊編譯速度。
* 增加Node模塊的詞典轉換接口和Promise接口。
## Version 1.0.4
2016年4月1日
* 使編譯時的腳本兼容Python 3。
* 修正Visual C++ 2015的編譯問題。
* 增補臺灣、香港地區用字用詞轉換。
* 更新nan以修正Node.js擴展編譯兼容性問題。
## Version 1.0.3
2015年7月22日
* 添加化學元素臺灣用字轉換。
* 增補100餘組缺失的簡繁轉換字對。
* 增補香港標準字。
* 使用nan解決Node.js擴展編譯兼容性問題。
* 命令行轉換工具支持就地轉換。
* 測試框架遷移到GTest。
* 修正Visual C++的編譯問題。
* 實現無詞典詞彙抽取和分詞算法。
* 優化轉換性能。
## Version 1.0.2
2014年11月8日
* 修正C語言接口的編譯錯誤問題
* 修正默認簡繁轉換文件名錯誤問題
* `DictEntry`增加`Values()`方法
## Version 1.0.1
2014年10月18日
* 使用C++11完全重寫OpenCC
* 修復大量轉換錯誤
* 增加香港繁體轉換
## Version 0.4.3
2013年5月17日
* 增加接口`opencc_convert_utf8_free`
* 修正Node.js插件內存泄漏問題
* 修正Windows下獲取當前目錄的問題
## Version 0.4.2
2013年4月14日
* 修正「阪」、「薰」繁簡轉換
* 增加四對缺失的簡繁轉換
* 增加API文檔由Doxygen生成
* 重構大量代碼
## Version 0.4.1
2013年3月21日
* 修正Node.js 0.10兼容性問題。
* 從Unihan數據庫增加若干缺失的簡繁轉換單字。
## Version 0.4.0
2013年3月2日
* 修正「雕」「谥」「峯」轉換,新增數百條臺灣科技詞彙。
* 修正命令行-h錯誤。
* 修正長行讀取錯誤。
* 修正錯誤類型拼寫錯誤。
* 修正UTF-8編碼轉換錯誤。
* 自動跳過UTF-8的BOM。
* 修正配置和數據文件相對路徑問題。
* 增加了gyp編譯系統。
* 增加了Node.js接口。
## Version 0.3.0
2011年12月2日
* 增加中國大陸、臺灣地區異體字和習慣用詞轉換功能。
* 修正詞典轉換鏈爲奇數時的緩衝區複製Bug。
* 修正Big Endian平臺上的UTF-8轉換錯誤。
* 修正「齣」「薑」詞組的問題。
* 修正「钁」「卷」「干」「薰」「糉」「蝨」「麺」。
* 增加「綑」到「捆」的繁簡轉換。
* 增加「跡」「蹟」對立。
* 增加「夫」「伕」對立。
* 增加「毀」「譭」「燬」對立。
* 增加「背」「揹」對立。
## Version 0.2.0
2010年12月23日
* 取消libopencc對iconv的依賴。
* 增加UTF8編碼格式錯誤時提示信息。
* 重構Python封裝。
* 修正讀取一行長度超過緩衝區時的UTF8截斷錯誤。
* 使用CMake代替Autotools構建編譯框架。
* 修正包括「拿不準」在內諸多簡繁轉換問題。
## Version 0.1.2
2010年9月16日
* 增加「僅分詞」和「顯示多重候選字詞」的轉換接口。
* 改進辭典文件的結構。
* 修正轉換緩衝區永遠不足的Bug。
* 修正多辭典轉換時略過某個辭典的Bug。
* 修正輸入爲空時轉換的Bug。
* 改進opencc命令行工具參數提示和幫助。
## Version 0.1.1
2010年8月10日
* 增加簡繁混雜到簡體或繁體的轉換。
* 增加多詞典/詞典組的轉換支持。
* 修正big endian平臺上的兼容性問題。
* 修正apple平臺下編譯iconv依賴的問題。
* 修正辭典中詞條長度長度不相等時轉換錯誤的Bug。
* 重構辭典代碼抽象。
* 增加編譯時的測試。
* 分離辭典爲字典和詞典。
## Version 0.1.0
2010年7月28日
* 修正文件名緩衝區不足的Bug。
* libopencc版本更新至1.0.0。
* 分離臺灣特有的繁簡轉換「著」「么」。
* 修改「众」「教」「查」「污」對應默認異體。
* 加入「齧啮」「灩滟」繁簡轉換。
* 增加「岳嶽」一簡對多繁轉換。
* 隱藏不必要的類型,更新接口註釋。
## Version 0.0.5
2010年7月21日
* 修正`wchar_t`兼容性問題,使用`ucs4`。
* 增加Windows移植分支。
* 修正一個文件名緩衝區分配的問題。
* 增加「囉」「溼」「廕」「彷」「徵」繁簡轉換。
## Version 0.0.4
2010年7月16日
* 增加「卹」「牴」「皁」「羶」「薹」等轉換。
* 精簡辭典中大量不必要的數詞(含「千」「萬」)。
* 修正最短路徑分詞時優先後向匹配的實現問題。
* 修正辭典加載兼容性問題當無法mmap時直接申請內存。
* 修正C++接口在64位平臺下編譯的問題。
## Version 0.0.3
2010年6月22日
* 加入繁體到簡體的轉換。
* 增加提示信息的中文翻譯,使用`GNU Gettext`。
* 增加辭典配置文件支持。
* 修正一些兼容性Bug。
## Version 0.0.2
2010年6月19日
* 分離詞庫。
* 增加平面文件詞庫讀取的支持。
* 增加平面文件詞庫到`Datrie`詞庫的轉換工具`opencc_dict`。
* 提供UTF8文本直接轉換的接口。
## Version 0.0.1
2010年6月11日
* OpenCC初始版本釋出。
* 支持簡繁轉換。

View File

@ -0,0 +1,277 @@
# Open Chinese Convert 開放中文轉換
[![Travis](https://img.shields.io/travis/BYVoid/OpenCC.svg)](https://travis-ci.org/BYVoid/OpenCC)
[![AppVeyor](https://img.shields.io/appveyor/ci/Carbo/OpenCC.svg)](https://ci.appveyor.com/project/Carbo/OpenCC)
[![Python package](https://github.com/BYVoid/OpenCC/workflows/Python%20package/badge.svg?branch=master)](https://github.com/BYVoid/OpenCC/actions?query=workflow%3A%22Python+package%22)
## Introduction 介紹
![OpenCC](https://opencc.byvoid.com/img/opencc.png)
Open Chinese Convert (OpenCC, 開放中文轉換) is an opensource project for conversions between Traditional Chinese, Simplified Chinese and Japanese Kanji (Shinjitai). It supports character-level and phrase-level conversion, character variant conversion and regional idioms among Mainland China, Taiwan and Hong Kong. This is not translation tool between Mandarin and Cantonese, etc.
中文簡繁轉換開源項目,支持詞彙級別的轉換、異體字轉換和地區習慣用詞轉換(中國大陸、臺灣、香港、日本新字體)。不提供普通話與粵語的轉換。
Discussion (Telegram): https://t.me/open_chinese_convert
### Features 特點
* 嚴格區分「一簡對多繁」和「一簡對多異」。
* 完全兼容異體字,可以實現動態替換。
* 嚴格審校一簡對多繁詞條,原則爲「能分則不合」。
* 支持中國大陸、臺灣、香港異體字和地區習慣用詞轉換,如「裏」「裡」、「鼠標」「滑鼠」。
* 詞庫和函數庫完全分離,可以自由修改、導入、擴展。
## Installation 安裝
See [Download](https://github.com/BYVoid/OpenCC/wiki/Download).
## Usage 使用
### Online demo 線上轉換展示
Warning: **This is NOT an API.** You will be banned if you make calls programmatically.
https://opencc.byvoid.com/
### Node.js
[npm](https://www.npmjs.com/opencc) `npm install opencc`
#### JavaScript
```js
const OpenCC = require('opencc');
const converter = new OpenCC('s2t.json');
converter.convertPromise("汉字").then(converted => {
console.log(converted); // 漢字
});
```
#### TypeScript
```ts
import { OpenCC } from 'opencc';
async function main() {
const converter: OpenCC = new OpenCC('s2t.json');
const result: string = await converter.convertPromise('汉字');
console.log(result);
}
```
See [demo.js](https://github.com/BYVoid/OpenCC/blob/master/node/demo.js) and [ts-demo.ts](https://github.com/BYVoid/OpenCC/blob/master/node/ts-demo.ts).
### Python
[PyPI](https://pypi.org/project/OpenCC/) `pip install opencc` (Windows, Linux, Mac)
```python
import opencc
converter = opencc.OpenCC('s2t.json')
converter.convert('汉字') # 漢字
```
### C++
```c++
#include "opencc.h"
int main() {
const SimpleConverter converter("s2t.json");
converter.Convert("汉字"); // 漢字
return 0;
}
```
### C
```c
#include "opencc.h"
int main() {
opencc_t opencc = opencc_open("s2t.json");
const char* input = "汉字";
char* converted = opencc_convert_utf8(opencc, input, strlen(input)); // 漢字
opencc_convert_utf8_free(converted);
opencc_close(opencc);
return 0;
}
```
Document 文檔: https://byvoid.github.io/OpenCC/
### Command Line
* `opencc --help`
* `opencc_dict --help`
* `opencc_phrase_extract --help`
### Others (Unofficial)
* Swift (iOS): [SwiftyOpenCC](https://github.com/XQS6LB3A/SwiftyOpenCC)
* Java: [opencc4j](https://github.com/houbb/opencc4j)
* Android: [android-opencc](https://github.com/qichuan/android-opencc)
* PHP: [opencc4php](https://github.com/nauxliu/opencc4php)
* Pure JavaScript: [opencc-js](https://github.com/nk2028/opencc-js)
* WebAssembly: [wasm-opencc](https://github.com/oyyd/wasm-opencc)
### Configurations 配置文件
#### 預設配置文件
* `s2t.json` Simplified Chinese to Traditional Chinese 簡體到繁體
* `t2s.json` Traditional Chinese to Simplified Chinese 繁體到簡體
* `s2tw.json` Simplified Chinese to Traditional Chinese (Taiwan Standard) 簡體到臺灣正體
* `tw2s.json` Traditional Chinese (Taiwan Standard) to Simplified Chinese 臺灣正體到簡體
* `s2hk.json` Simplified Chinese to Traditional Chinese (Hong Kong variant) 簡體到香港繁體
* `hk2s.json` Traditional Chinese (Hong Kong variant) to Simplified Chinese 香港繁體到簡體
* `s2twp.json` Simplified Chinese to Traditional Chinese (Taiwan Standard) with Taiwanese idiom 簡體到繁體(臺灣正體標準)並轉換爲臺灣常用詞彙
* `tw2sp.json` Traditional Chinese (Taiwan Standard) to Simplified Chinese with Mainland Chinese idiom 繁體(臺灣正體標準)到簡體並轉換爲中國大陸常用詞彙
* `t2tw.json` Traditional Chinese (OpenCC Standard) to Taiwan Standard 繁體OpenCC 標準)到臺灣正體
* `hk2t.json` Traditional Chinese (Hong Kong variant) to Traditional Chinese 香港繁體到繁體OpenCC 標準)
* `t2hk.json` Traditional Chinese (OpenCC Standard) to Hong Kong variant 繁體OpenCC 標準)到香港繁體
* `t2jp.json` Traditional Chinese Characters (Kyūjitai) to New Japanese Kanji (Shinjitai) 繁體OpenCC 標準,舊字體)到日文新字體
* `jp2t.json` New Japanese Kanji (Shinjitai) to Traditional Chinese Characters (Kyūjitai) 日文新字體到繁體OpenCC 標準,舊字體)
* `tw2t.json` Traditional Chinese (Taiwan standard) to Traditional Chinese 臺灣正體到繁體OpenCC 標準)
## Build 編譯
### Build with CMake
#### Linux & Mac OS X
g++ 4.6+ or clang 3.2+ is required.
```bash
make
```
#### Windows Visual Studio:
```bash
build.cmd
```
### Test 測試
#### Linux & Mac OS X
```
make test
```
#### Windows Visual Studio:
```bash
test.cmd
```
### Benchmark 基準測試
```
make benchmark
```
Example results (from Github CI):
```
1: ------------------------------------------------------------------
1: Benchmark Time CPU Iterations
1: ------------------------------------------------------------------
1: BM_Initialization/hk2s 1.56 ms 1.56 ms 442
1: BM_Initialization/hk2t 0.144 ms 0.144 ms 4878
1: BM_Initialization/jp2t 0.260 ms 0.260 ms 2604
1: BM_Initialization/s2hk 23.8 ms 23.8 ms 29
1: BM_Initialization/s2t 25.6 ms 25.6 ms 28
1: BM_Initialization/s2tw 24.0 ms 23.9 ms 30
1: BM_Initialization/s2twp 24.6 ms 24.6 ms 28
1: BM_Initialization/t2hk 0.052 ms 0.052 ms 12897
1: BM_Initialization/t2jp 0.141 ms 0.141 ms 5012
1: BM_Initialization/t2s 1.30 ms 1.30 ms 540
1: BM_Initialization/tw2s 1.39 ms 1.39 ms 529
1: BM_Initialization/tw2sp 1.69 ms 1.69 ms 426
1: BM_Initialization/tw2t 0.089 ms 0.089 ms 7707
1: BM_Convert2M 582 ms 582 ms 1
1: BM_Convert/100 1.07 ms 1.07 ms 636
1: BM_Convert/1000 11.0 ms 11.0 ms 67
1: BM_Convert/10000 113 ms 113 ms 6
1: BM_Convert/100000 1176 ms 1176 ms 1
```
## Projects using OpenCC 使用 OpenCC 的項目
* [ibus-pinyin](https://github.com/ibus/ibus-pinyin)
* [fcitx](https://github.com/fcitx/fcitx)
* [rimeime](https://rime.im/)
* [libgooglepinyin](http://code.google.com/p/libgooglepinyin/)
* [ibus-libpinyin](https://github.com/libpinyin/ibus-libpinyin)
* [alfred-chinese-converter](https://github.com/amowu/alfred-chinese-converter)
* [GoldenDict](https://github.com/goldendict/goldendict)
## License 許可協議
Apache License 2.0
## Third Party Library 第三方庫
* [darts-clone](https://github.com/s-yata/darts-clone) BSD License
* [marisa-trie](https://github.com/s-yata/marisa-trie) BSD License
* [tclap](http://tclap.sourceforge.net/) MIT License
* [rapidjson](https://github.com/Tencent/rapidjson) MIT License
* [Google Test](https://github.com/google/googletest) BSD License
All these libraries are statically linked by default.
## Change History 版本歷史
* [NEWS](https://github.com/BYVoid/OpenCC/blob/master/NEWS.md)
### Links 相關鏈接
* Introduction 詳細介紹 https://github.com/BYVoid/OpenCC/wiki/%E7%B7%A3%E7%94%B1
* 現代漢語常用簡繁一對多字義辨析表 http://ytenx.org/byohlyuk/KienxPyan
## Contributors 貢獻者
* [BYVoid](http://www.byvoid.com/)
* [佛振](https://github.com/lotem)
* [Peng Huang](https://github.com/phuang)
* [LI Daobing](https://github.com/lidaobing)
* [Kefu Chai](https://github.com/tchaikov)
* [Kan-Ru Chen](http://kanru.info/)
* [Ma Xiaojun](https://twitter.com/damage3025)
* [Jiang Jiang](http://jjgod.org/)
* [Ruey-Cheng Chen](https://github.com/rueycheng)
* [Paul Meng](http://home.mno2.org/)
* [Lawrence Lau](https://github.com/ktslwy)
* [瑾昀](https://github.com/kunki)
* [內木一郎](https://github.com/SyaoranHinata)
* [Marguerite Su](https://www.marguerite.su/)
* [Brian White](http://mscdex.net)
* [Qijiang Fan](https://fqj.me/)
* [LEOYoon-Tsaw](https://github.com/LEOYoon-Tsaw)
* [Steven Yao](https://github.com/stevenyao)
* [Pellaeon Lin](https://github.com/pellaeon)
* [stony](https://github.com/stony-shixz)
* [steelywing](https://github.com/steelywing)
* [吕旭东](https://github.com/lvxudong)
* [Weng Xuetian](https://github.com/wengxt)
* [Ma Tao](https://github.com/iwater)
* [Heinz Wiesinger](https://github.com/pprkut)
* [J.W](https://github.com/jakwings)
* [Amo Wu](https://github.com/amowu)
* [Mark Tsai](https://github.com/mxgit1090)
* [Zhe Wang](https://github.com/0x1997)
* [sgqy](https://github.com/sgqy)
* [Qichuan (Sean) ZHANG](https://github.com/qichuan)
* [Flandre Scarlet](https://github.com/XadillaX)
* [宋辰文](https://github.com/songchenwen)
* [iwater](https://github.com/iwater)
* [Xpol Wan](https://github.com/xpol)
* [Weihang Lo](https://github.com/weihanglo)
* [Cychih](https://github.com/pi314)
* [kyleskimo](https://github.com/kyleskimo)
* [Ryuan Choi](https://github.com/bunhere)
* [Tony Able](https://github.com/TonyAble)
* [Xiao Liang](https://github.com/yxliang01)
Please update this list you have contributed OpenCC.

View File

@ -0,0 +1,8 @@
{
"includes": [
"node/global.gypi",
"node/configs.gypi",
"node/dicts.gypi",
"node/node_opencc.gypi",
]
}

View File

@ -0,0 +1,2 @@
cmake -S. -Bbuild -DCMAKE_INSTALL_PREFIX:PATH=.
cmake --build build --config Release --target install

View File

@ -0,0 +1,186 @@
find_package(PythonInterp REQUIRED)
set(OPENCC_DICT_BIN opencc_dict)
set(DICT_MERGE_BIN "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/merge.py")
set(DICT_REVERSE_BIN "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/reverse.py")
set(DICT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dictionary)
set(DICT_GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(
DICTS_RAW
STCharacters
STPhrases
TSCharacters
TSPhrases
TWVariants
TWVariantsRevPhrases
HKVariants
HKVariantsRevPhrases
JPVariants
JPShinjitaiCharacters
JPShinjitaiPhrases
)
set(
DICTS_GENERATED
TWPhrases
TWPhrasesRev
TWVariantsRev
HKVariantsRev
JPVariantsRev
)
set(DICTS ${DICTS_RAW} ${DICTS_GENERATED})
foreach(DICT ${DICTS})
set(DICT_TARGETS ${DICT_TARGETS} ${DICT}.ocd2)
endforeach(DICT)
add_custom_target(
Dictionaries
ALL
DEPENDS
${DICT_TARGETS}
)
foreach(DICT ${DICTS_RAW})
set(DICT_${DICT}_INPUT ${DICT_DIR}/${DICT}.txt)
endforeach(DICT)
foreach(DICT ${DICTS_GENERATED})
set(DICT_${DICT}_INPUT ${DICT_GENERATED_DIR}/${DICT}.txt)
endforeach(DICT)
set(
DICT_TWPhrases_GENERATING_INPUT
${DICT_DIR}/TWPhrasesIT.txt
${DICT_DIR}/TWPhrasesName.txt
${DICT_DIR}/TWPhrasesOther.txt
)
set(
DICT_TWPhrases_GENERATING_COMMAND
${DICT_MERGE_BIN} ${DICT_TWPhrases_GENERATING_INPUT} TWPhrases.txt
)
set(
DICT_TWVariantsRev_GENERATING_INPUT
${DICT_DIR}/TWVariants.txt
)
set(
DICT_TWVariantsRev_GENERATING_COMMAND
${DICT_REVERSE_BIN} ${DICT_TWVariantsRev_GENERATING_INPUT} TWVariantsRev.txt
)
set(
DICT_TWPhrasesRev_GENERATING_INPUT
${DICT_GENERATED_DIR}/TWPhrases.txt
)
set(
DICT_TWPhrasesRev_GENERATING_COMMAND
${DICT_REVERSE_BIN} ${DICT_TWPhrasesRev_GENERATING_INPUT} TWPhrasesRev.txt
)
set(
DICT_HKVariantsRev_GENERATING_INPUT
${DICT_DIR}/HKVariants.txt
)
set(
DICT_HKVariantsRev_GENERATING_COMMAND
${DICT_REVERSE_BIN} ${DICT_HKVariantsRev_GENERATING_INPUT} HKVariantsRev.txt
)
set(
DICT_JPVariantsRev_GENERATING_INPUT
${DICT_DIR}/JPVariants.txt
)
set(
DICT_JPVariantsRev_GENERATING_COMMAND
${DICT_REVERSE_BIN} ${DICT_JPVariantsRev_GENERATING_INPUT} JPVariantsRev.txt
)
foreach(DICT ${DICTS_GENERATED})
add_custom_command(
OUTPUT
${DICT}.txt
COMMENT
"Generating ${DICT}.txt"
COMMAND
${DICT_${DICT}_GENERATING_COMMAND}
DEPENDS
${DICT_${DICT}_GENERATING_INPUT}
)
set_directory_properties(
PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES
"${DICT_GENERATED_DIR}/${DICT}.txt"
)
endforeach(DICT)
add_custom_target(
copy_libopencc_to_dir_of_opencc_dict
COMMENT
"Copying libopencc to directory of opencc_dict"
COMMAND
${CMAKE_COMMAND} -E copy "$<TARGET_FILE:libopencc>" "$<TARGET_FILE_DIR:${OPENCC_DICT_BIN}>"
)
if (WIN32)
set(DICT_WIN32_DEPENDS copy_libopencc_to_dir_of_opencc_dict)
else()
set(DICT_WIN32_DEPENDS)
endif()
foreach(DICT ${DICTS})
add_custom_command(
OUTPUT
${DICT}.ocd2
COMMENT
"Building ${DICT}.ocd2"
COMMAND
${OPENCC_DICT_BIN}
--input ${DICT_${DICT}_INPUT}
--output ${DICT}.ocd2
--from text
--to ocd2
DEPENDS
${DICT_WIN32_DEPENDS}
${OPENCC_DICT_BIN}
${DICT_${DICT}_INPUT}
)
install(
FILES
${DICT_GENERATED_DIR}/${DICT}.ocd2
DESTINATION
${DIR_SHARE_OPENCC}
)
set_directory_properties(
PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES
"${DICT_GENERATED_DIR}/${DICT}.ocd2"
)
endforeach(DICT)
set(CONFIG_FILES
config/hk2s.json
config/hk2t.json
config/jp2t.json
config/s2hk.json
config/s2t.json
config/s2tw.json
config/s2twp.json
config/t2hk.json
config/t2jp.json
config/t2s.json
config/t2tw.json
config/tw2s.json
config/tw2sp.json
config/tw2t.json
)
install(
FILES
${CONFIG_FILES}
DESTINATION
${DIR_SHARE_OPENCC}
)

View File

@ -0,0 +1,33 @@
{
"name": "Traditional Chinese (Hong Kong variant) to Simplified Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TSPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "HKVariantsRevPhrases.ocd2"
}, {
"type": "ocd2",
"file": "HKVariantsRev.ocd2"
}]
}
}, {
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TSPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TSCharacters.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,22 @@
{
"name": "Traditional Chinese (Hong Kong variant) to Traditional Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "HKVariantsRevPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "HKVariantsRevPhrases.ocd2"
}, {
"type": "ocd2",
"file": "HKVariantsRev.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,25 @@
{
"name": "New Japanese Kanji (Shinjitai) to Traditional Chinese Characters (Kyūjitai)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "JPShinjitaiPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "JPShinjitaiPhrases.ocd2"
}, {
"type": "ocd2",
"file": "JPShinjitaiCharacters.ocd2"
}, {
"type": "ocd2",
"file": "JPVariantsRev.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,27 @@
{
"name": "Simplified Chinese to Traditional Chinese (Hong Kong variant)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "STPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "STPhrases.ocd2"
}, {
"type": "ocd2",
"file": "STCharacters.ocd2"
}]
}
}, {
"dict": {
"type": "ocd2",
"file": "HKVariants.ocd2"
}
}]
}

View File

@ -0,0 +1,22 @@
{
"name": "Simplified Chinese to Traditional Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "STPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "STPhrases.ocd2"
}, {
"type": "ocd2",
"file": "STCharacters.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,27 @@
{
"name": "Simplified Chinese to Traditional Chinese (Taiwan standard)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "STPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "STPhrases.ocd2"
}, {
"type": "ocd2",
"file": "STCharacters.ocd2"
}]
}
}, {
"dict": {
"type": "ocd2",
"file": "TWVariants.ocd2"
}
}]
}

View File

@ -0,0 +1,32 @@
{
"name": "Simplified Chinese to Traditional Chinese (Taiwan standard, with phrases)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "STPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "STPhrases.ocd2"
}, {
"type": "ocd2",
"file": "STCharacters.ocd2"
}]
}
}, {
"dict": {
"type": "ocd2",
"file": "TWPhrases.ocd2"
}
}, {
"dict": {
"type": "ocd2",
"file": "TWVariants.ocd2"
}
}]
}

View File

@ -0,0 +1,16 @@
{
"name": "Traditional Chinese to Traditional Chinese (Hong Kong variant)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "HKVariants.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "ocd2",
"file": "HKVariants.ocd2"
}
}]
}

View File

@ -0,0 +1,16 @@
{
"name": "Traditional Chinese Characters (Kyūjitai) to New Japanese Kanji (Shinjitai)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "JPVariants.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "ocd2",
"file": "JPVariants.ocd2"
}
}]
}

View File

@ -0,0 +1,22 @@
{
"name": "Traditional Chinese to Simplified Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TSPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TSPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TSCharacters.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,16 @@
{
"name": "Traditional Chinese to Traditional Chinese (Taiwan standard)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TWVariants.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "ocd2",
"file": "TWVariants.ocd2"
}
}]
}

View File

@ -0,0 +1,33 @@
{
"name": "Traditional Chinese (Taiwan standard) to Simplified Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TSPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TWVariantsRevPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TWVariantsRev.ocd2"
}]
}
}, {
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TSPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TSCharacters.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,36 @@
{
"name": "Traditional Chinese (Taiwan standard) to Simplified Chinese (with phrases)",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TSPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TWPhrasesRev.ocd2"
}, {
"type": "ocd2",
"file": "TWVariantsRevPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TWVariantsRev.ocd2"
}]
}
}, {
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TSPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TSCharacters.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,22 @@
{
"name": "Traditional Chinese (Taiwan standard) to Traditional Chinese",
"segmentation": {
"type": "mmseg",
"dict": {
"type": "ocd2",
"file": "TWVariantsRevPhrases.ocd2"
}
},
"conversion_chain": [{
"dict": {
"type": "group",
"dicts": [{
"type": "ocd2",
"file": "TWVariantsRevPhrases.ocd2"
}, {
"type": "ocd2",
"file": "TWVariantsRev.ocd2"
}]
}
}]
}

View File

@ -0,0 +1,63 @@
僞 偽
兌 兑
叄 叁
只 只 衹
啓 啓 啟
喫 吃
囪 囱
妝 妝 粧
媼 媪
嬀 媯
悅 悦
慍 愠
戶 户
挩 捝
搵 揾
擡 抬
敓 敚
敘 敍 敘
柺 枴
梲 棁
棱 稜 棱
榲 榅
檯 枱
氳 氲
涗 涚
溫 温
溼 濕
潙 溈
潨 潀
熅 煴
爲 為
癡 痴
皁 皂
祕 秘
稅 税
竈 灶
糉 粽 糉 糭
縕 緼
纔 才
脣 唇
脫 脱
膃 腽
臥 卧
臺 台
菸 煙
蒕 蒀
蔥 葱
蔿 蒍
蘊 藴
蛻 蜕
衆 眾
衛 衞
覈 核
說 説
踊 踴
轀 輼
醞 醖
鉢 缽
鉤 鈎
銳 鋭
鍼 針
閱 閲
鰮 鰛

View File

@ -0,0 +1,156 @@
一口吃個 一口喫個
一口吃成 一口喫成
一家三口 一家三口
一家五口 一家五口
一家六口 一家六口
一家四口 一家四口
七星巖 七星巖
世胄 世胄
介胄 介冑
傅巖 傅巖
免胄 免冑
冠胄 冠冑
千巖競秀 千巖競秀
千巖萬壑 千巖萬壑
千巖萬谷 千巖萬谷
口吃 口吃
台山 台山
台州 台州
台州地區 台州地區
台州市 台州市
吃口 喫口 吃口
吃口令 吃口令
吃口飯 喫口飯
吃吃 喫喫 吃吃
吃子 喫子 吃子
名胄 名胄
國胄 國胄
圍巖 圍巖
地胄 地胄
壓胄子 壓冑子
士胄 士胄
大巖桐 大巖桐
天台女 天台女
天台宗 天台宗
天台山 天台山
天台縣 天台縣
天潢貴胄 天潢貴胄
奇巖 奇巖
寶胄 寶胄
小巖洞 小巖洞
岫巖縣 岫巖縣
峯巖 峯巖
嵌巖 嵌巖
巉巖 巉巖
巖壁 巖壁
巖居 巖居
巖居穴處 巖居穴處
巖居谷飲 巖居谷飲
巖岸 巖岸
巖巉 巖巉
巖巖 巖巖
巖徼 巖徼
巖手縣 巖手縣
巖村 巖村
巖洞 巖洞
巖流圈 巖流圈
巖牆 巖牆
巖牆之下 巖牆之下
巖畫 巖畫
巖穴 巖穴
巖穴之士 巖穴之士
巖薔薇 巖薔薇
巖邑 巖邑
巖郎 巖郎
巖阻 巖阻
巖陛 巖陛
帝胄 帝胄
幽巖 幽巖
幽棲巖谷 幽棲巖谷
張口 張口
懸巖 懸巖
懸巖峭壁 懸巖峭壁
懸胄 懸冑
攀巖 攀巖
支胄 支胄
教胄 教胄
景胄 景胄
望胄 望胄
末胄 末胄
村胄 村胄
枕巖漱流 枕巖漱流
枝胄 枝胄
氏胄 氏胄
洪胄 洪胄
浙江天台縣 浙江天台縣
清胄 清胄
灰巖殘丘 灰巖殘丘
玄胄 玄胄
甲胄 甲冑
甲胄魚類 甲冑魚類
皇胄 皇胄
石灰巖洞 石灰巖洞
神胄 神胄
簪纓世胄 簪纓世胄
系胄 系胄
紅巖 紅巖
絕巖 絕巖
緒胄 緒胄
纂胄 纂胄
胃口 胃口
胄嗣 胄嗣
胄子 胄子
胄序 胄序
胄族 胄族
胄甲 冑甲
胄監 胄監
胄科 冑科
胄緒 胄緒
胄胤 胄胤
胄裔 胄裔
胄裔繁衍 胄裔繁衍
胄閥 胄閥
胡雪巖 胡雪巖
胤胄 胤胄
苗胄 苗胄
英胄 英胄
華胄 華胄
血胄 血胄
裔胄 裔胄
訓胄 訓胄
試胄 試胄
豪門貴胄 豪門貴胄
貝胄 貝冑
貴胄 貴胄
賢胄 賢胄
蹇吃 蹇吃
躬擐甲胄 躬擐甲冑
遐胄 遐胄
遙胄 遙胄
遙遙華胄 遙遙華胄
遠胄 遠胄
遺胄 遺胄
鄧艾吃 鄧艾吃
重巖疊嶂 重巖疊嶂
金胄 金胄
鎧胄 鎧冑
鑿巖 鑿巖
門胄 門胄
開口 開口
雲巖區 雲巖區
非層巖 非層巖
韓侂胄 韓侂冑
飮胄 飮冑
骨巖巖 骨巖巖
高胄 高胄
魚胄 魚冑
鮮胄 鮮胄
鴻胄 鴻胄
黃巖區 黃巖區
黃巖島 黃巖島
黃炎貴胄 黃炎貴胄
齒胄 齒胄
龍巖 龍巖
龍巖市 龍巖市
龍巖村 龍巖村
龍胄 龍胄

View File

@ -0,0 +1,6 @@
両 兩 輛
弁 辨 辯 瓣 辦 弁
御 御 禦
欠 缺 欠
糸 絲 糸
芸 藝 芸

View File

@ -0,0 +1,176 @@
一獲千金 一攫千金
丁寧 叮嚀
丁重 鄭重
三差路 三叉路
世論 輿論
亜鈴 啞鈴
交差 交叉
供宴 饗宴
俊馬 駿馬
保塁 堡壘
個条書 箇条書
偏平 扁平
停泊 碇泊
優俊 優駿
先兵 尖兵
先鋭 尖鋭
共役 共軛
冗舌 饒舌
凶器 兇器
削岩 鑿岩
包丁 庖丁
包帯 繃帯
区画 區劃
厳然 儼然
友宜 友誼
反乱 叛乱
収集 蒐集
叙情 抒情
台頭 擡頭
合弁 合辦
喜遊曲 嬉遊曲
嘆願 歎願
回転 廻転
回遊 回游
奉持 捧持
委縮 萎縮
展転 輾轉
希少 稀少
幻惑 眩惑
広範 廣汎
広野 曠野
廃虚 廢墟
建坪率 建蔽率
弁当 辨當
弁膜 瓣膜
弁護 辯護
弁髪 辮髮
弦歌 絃歌
恩義 恩誼
意向 意嚮
慰謝料 慰藉料
憶断 臆断
憶病 臆病
戦没 戰歿
扇情 煽情
手帳 手帖
技量 伎倆
抜粋 抜萃
披歴 披瀝
抵触 牴触
抽選 抽籤
拘引 勾引
拠出 醵出
拠金 醵金
掘削 掘鑿
控除 扣除
援護 掩護
放棄 抛棄
散水 撒水
敬謙 敬虔
敷延 敷衍
断固 断乎
族生 簇生
昇叙 陞敘
暖房 煖房
暗唱 暗誦
暗夜 闇夜
暴露 曝露
枯渇 涸渇
格好 恰好
格幅 恰幅
棄損 毀損
模索 摸索
橋頭保 橋頭堡
欠缺 欠缺
死体 屍體
殿部 臀部
母指 拇指
気迫 気魄
決別 訣別
決壊 決潰
沈殿 沈澱
油送船 油槽船
波乱 波瀾
注釈 註釋
洗浄 洗滌 洗浄
活発 活潑
浸透 滲透
浸食 浸蝕
消却 銷卻
混然 渾然
湾曲 彎曲
溶接 熔接
漁労 漁撈
漂然 飄然
激高 激昂
火炎 火焰
焦燥 焦躁
班点 斑点
留飲 溜飲
略奪 掠奪
疎通 疏通
発酵 醱酵
白亜 白堊
相克 相剋
知恵 智慧
破棄 破毀
確固 確乎
禁固 禁錮
符丁 符牒
粉装 扮装
紫班 紫斑
終息 終熄
総合 綜合
編集 編輯
義援 義捐
耕運機 耕耘機
肝心 肝腎
肩甲骨 肩胛骨
背徳 悖德
脈拍 脈搏
膨張 膨脹
芳純 芳醇
英知 叡智
蒸留 蒸溜
薫蒸 燻蒸
薫製 燻製
衣装 衣裳
衰退 衰退 衰頽
裕然 悠然
補佐 輔佐
訓戒 訓誡
試練 試煉
詭弁 詭辯
講和 媾和
象眼 象嵌
貫録 貫禄
買弁 買辦
賛辞 讚辭
踏襲 蹈襲
車両 車輛
転倒 顛倒
輪郭 輪廓
退色 褪色
途絶 杜絶
連係 連繫
連合 聯合
選考 銓衡
酢酸 醋酸
野卑 野鄙
鉱石 礦石
間欠 間歇
関数 函數
防御 防禦
険阻 嶮岨
障壁 牆壁
障害 障礙
隠滅 湮滅
集落 聚落
雇用 雇傭
風諭 諷喩
飛語 蜚語
香典 香奠
骨格 骨骼
高進 亢進
鳥観 鳥瞰

View File

@ -0,0 +1,367 @@
乘 乗
亂 乱
亙 亘
亞 亜
佛 仏
來 来
假 仮
傳 伝
僞 偽
價 価
儉 倹
兒 児
內 内
兩 両
剎 刹
剩 剰
劍 剣
劑 剤
勞 労
勳 勲
勵 励
勸 勧
勻 匀
區 区
卷 巻
卻 却
參 参
吳 呉
咒 呪
啞 唖
單 単
噓 嘘
嚙 噛
嚴 厳
囑 嘱
圈 圏
國 国
圍 囲
圓 円
圖 図
團 団
增 増
墮 堕
壓 圧
壘 塁
壞 壊
壤 壌
壯 壮
壹 壱
壽 寿
奧 奥
奬 奨
妝 粧
孃 嬢
學 学
寢 寝
實 実
寫 写
寬 寛
寶 宝
將 将
專 専
對 対
屆 届
屬 属
峯 峰
峽 峡
嶽 岳
巖 巌
巢 巣
帶 帯
廁 厠
廢 廃
廣 広
廳 庁
彈 弾
彌 弥
彎 弯
彥 彦
徑 径
從 従
徵 徴
德 徳
恆 恒
悅 悦
惠 恵
惡 悪
惱 悩
慘 惨
應 応
懷 懐
戀 恋
戰 戦
戲 戯
戶 戸
戾 戻
拂 払
拔 抜
拜 拝
挾 挟
插 挿
揭 掲
搔 掻
搖 揺
搜 捜
摑 掴
擇 択
擊 撃
擔 担
據 拠
擴 拡
攝 摂
攪 撹
收 収
效 効
敕 勅
敘 叙
數 数
斷 断
晉 晋
晚 晩
晝 昼
暨 曁
曆 暦
曉 暁
曾 曽
會 会
枡 桝
查 査
條 条
棧 桟
棱 稜 棱
榆 楡
榮 栄
樂 楽
樓 楼
樞 枢
樣 様
橫 横
檢 検
櫻 桜
權 権
歐 欧
歡 歓
步 歩
歲 歳
歷 歴
歸 帰
殘 残
殼 殻
毆 殴
每 毎
氣 気
污 汚
沒 没
涉 渉
淚 涙
淨 浄
淺 浅
渴 渇
溌 潑
溪 渓
溫 温
溼 湿
滯 滞
滿 満
潛 潜
澀 渋
澤 沢
濟 済
濤 涛
濱 浜
濾 沪
瀧 滝
瀨 瀬
灣 湾
焔 焰
燈 灯
燒 焼
營 営
爐 炉
爭 争
爲 為
牀 床
犧 犠
狀 状
狹 狭
獨 独
獵 猟
獸 獣
獻 献
瓣 弁
產 産
畫 画
當 当
疊 畳
疎 疏
痹 痺
瘦 痩
癡 痴
發 発
皋 皐
盜 盗
盡 尽
碎 砕
祕 秘
祿 禄
禦 御
禪 禅
禮 礼
禱 祷
稅 税
稱 称
稻 稲
穎 頴
穗 穂
穩 穏
穰 穣
竃 竈
竊 窃
粹 粋
糉 粽
絕 絶
絲 糸
經 経
綠 緑
緖 緒
緣 縁
縣 県
縱 縦
總 総
繋 繫
繡 繍
繩 縄
繪 絵
繼 継
續 続
纔 才
纖 繊
缺 欠
罐 缶
羣 群
聯 連
聰 聡
聲 声
聽 聴
肅 粛
脣 唇
脫 脱
腦 脳
腳 脚
膽 胆
臟 臓
臺 台
與 与
舉 挙
舊 旧
舍 舎
荔 茘
莊 荘
莖 茎
菸 煙
萊 莱
萬 万
蔣 蒋
蔥 葱
薰 薫
藏 蔵
藝 芸
藥 薬
蘆 芦
處 処
虛 虚
號 号
螢 蛍
蟲 虫
蠟 蝋
蠶 蚕
蠻 蛮
裝 装
覺 覚
覽 覧
觀 観
觸 触
說 説
謠 謡
證 証
譯 訳
譽 誉
讀 読
變 変
讓 譲
豐 豊
豫 予
貓 猫
貳 弐
賣 売
賴 頼
贊 賛
贗 贋
踐 践
輕 軽
輛 輌
轉 転
辨 弁
辭 辞
辯 弁
遞 逓
遥 遙
遲 遅
邊 辺
鄉 郷
酢 醋
醉 酔
醗 醱
醫 医
醬 醤
釀 醸
釋 釈
鋪 舗
錄 録
錢 銭
鍊 錬
鐵 鉄
鑄 鋳
鑛 鉱
閱 閲
關 関
陷 陥
隨 随
險 険
隱 隠
雙 双
雜 雑
雞 鶏
霸 覇
靈 霊
靜 静
顏 顔
顯 顕
餘 余
騷 騒
驅 駆
驗 験
驛 駅
髓 髄
體 体
髮 髪
鬥 闘
鱉 鼈
鷗 鴎
鹼 鹸
鹽 塩
麥 麦
麪 麺
麴 麹
黃 黄
黑 黒
默 黙
點 点
黨 党
齊 斉
齋 斎
齒 歯
齡 齢
龍 竜
龜 亀

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,276 @@
一目瞭然 一目了然
上鍊 上链
不瞭解 不了解
么麼 幺麽
么麽 幺麽
乾乾淨淨 干干净净
乾乾脆脆 干干脆脆
乾元 乾元
乾卦 乾卦
乾嘉 乾嘉
乾圖 乾图
乾坤 乾坤
乾坤一擲 乾坤一掷
乾坤再造 乾坤再造
乾坤大挪移 乾坤大挪移
乾宅 乾宅
乾斷 乾断
乾旦 乾旦
乾曜 乾曜
乾清宮 乾清宫
乾盛世 乾盛世
乾紅 乾红
乾綱 乾纲
乾縣 乾县
乾象 乾象
乾造 乾造
乾道 乾道
乾陵 乾陵
乾隆 乾隆
乾隆年間 乾隆年间
乾隆皇帝 乾隆皇帝
以免藉口 以免借口
以功覆過 以功复过
侔德覆載 侔德复载
傢俱 家具
傷亡枕藉 伤亡枕藉
八濛山 八濛山
凌藉 凌借
出醜狼藉 出丑狼藉
函覆 函复
千鍾粟 千锺粟
反反覆覆 反反复复
反覆 反复
反覆思維 反复思维
反覆思量 反复思量
反覆性 反复性
名覆金甌 名复金瓯
哪吒 哪吒
回覆 回复
壺裏乾坤 壶里乾坤
大目乾連冥間救母變文 大目乾连冥间救母变文
宫商角徵羽 宫商角徵羽
射覆 射复
尼乾陀 尼乾陀
幺麼 幺麽
幺麼小丑 幺麽小丑
幺麼小醜 幺麽小丑
康乾 康乾
張法乾 张法乾
彷彿 仿佛
彷徨 彷徨
徵弦 徵弦
徵絃 徵弦
徵羽摩柯 徵羽摩柯
徵聲 徵声
徵調 徵调
徵音 徵音
情有獨鍾 情有独钟 情有独锺
憑藉 凭借
憑藉着 凭借着
手鍊 手链
扭轉乾坤 扭转乾坤
找藉口 找借口
拉鍊 拉链
拉鍊工程 拉链工程
拜覆 拜复
據瞭解 据了解
文錦覆阱 文锦复阱
於世成 於世成
於乎 於乎
於仲完 於仲完
於倫 於伦
於其一 於其一
於則 於则
於勇明 於勇明
於呼哀哉 於呼哀哉
於單 於单
於坦 於坦
於崇文 於崇文
於忠祥 於忠祥
於惟一 於惟一
於戲 於戏
於敖 於敖
於梨華 於梨华
於清言 於清言
於潛 於潜
於琳 於琳
於穆 於穆
於竹屋 於竹屋
於菟 於菟
於邑 於邑
於陵子 於陵子
旋乾轉坤 旋乾转坤
旋轉乾坤 旋转乾坤
旋轉乾坤之力 旋转乾坤之力
明瞭 明了
明覆 明复
書中自有千鍾粟 书中自有千锺粟
有序 有序
朝乾夕惕 朝乾夕惕
木吒 木吒
李乾德 李乾德
李澤鉅 李泽钜
李鍊福 李链福
李鍾郁 李锺郁
樊於期 樊於期
沈沒 沉没
沈沒成本 沉没成本
沈積 沉积
沈船 沉船
沈默 沉默
流徵 流徵
浪蕩乾坤 浪荡乾坤
滑藉 滑借
無序 无序
牴牾 抵牾
牴觸 抵触
狐藉虎威 狐借虎威
珍珠項鍊 珍珠项链
甚鉅 甚钜
申覆 申复
畢昇 毕昇
發覆 发复
盼既示覆 盼既示复
瞭如 了如
瞭如指掌 了如指掌
瞭望 瞭望
瞭然 了然
瞭然於心 了然于心
瞭若指掌 了若指掌
瞭解 了解
瞭解到 了解到
示覆 示复
神祇 神祇
稟覆 禀复
答覆 答复
篤麼 笃麽
簡單明瞭 简单明了
籌畫 筹划
素藉 素借
老態龍鍾 老态龙钟 老态龙锺
肘手鍊足 肘手链足
茵藉 茵借
萬鍾 万锺
蒜薹 蒜薹
蕓薹 芸薹
蕩覆 荡复
蕭乾 萧乾
藉代 借代
藉以 借以
藉助 借助
藉助於 借助于
藉卉 借卉
藉口 借口
藉喻 借喻
藉寇兵 借寇兵
藉寇兵齎盜糧 借寇兵赍盗粮
藉手 借手
藉據 借据
藉故 借故
藉故推辭 借故推辞
藉方 借方
藉條 借条
藉槁 借槁
藉機 借机
藉此 借此
藉此機會 借此机会
藉甚 借甚
藉由 借由
藉着 借着
藉端 借端
藉端生事 借端生事
藉箸代籌 借箸代筹
藉草枕塊 借草枕块
藉藉 藉藉
藉藉无名 藉藉无名
藉詞 借词
藉讀 借读
藉資 借资
衹得 只得
衹見樹木 只见树木
衹見樹木不見森林 只见树木不见森林
袖裏乾坤 袖里乾坤
覆上 复上
覆住 复住
覆信 复信
覆冒 复冒
覆呈 复呈
覆命 复命
覆墓 复墓
覆宗 复宗
覆帳 复帐
覆幬 复帱
覆成 复成
覆按 复按
覆文 复文
覆杯 复杯
覆校 复校
覆瓿 复瓿
覆盂 复盂
覆盆 覆盆
覆盆子 覆盆子
覆盤 覆盘
覆育 复育
覆蕉尋鹿 复蕉寻鹿
覆逆 复逆
覆醢 复醢
覆醬瓿 复酱瓿
覆電 复电
覆露 复露
覆鹿尋蕉 复鹿寻蕉
覆鹿遺蕉 复鹿遗蕉
覆鼎 复鼎
見覆 见复
角徵 角徵
角徵羽 角徵羽
計畫 计划
變徵 变徵
變徵之聲 变徵之声
變徵之音 变徵之音
貂覆額 貂复额
買臣覆水 买臣复水
踅門瞭戶 踅门了户
躪藉 躏借
郭子乾 郭子乾
酒逢知己千鍾少 酒逢知己千锺少
酒逢知己千鍾少話不投機半句多 酒逢知己千锺少话不投机半句多
醞藉 酝借
重覆 重复
金吒 金吒
金鍊 金链
鈞覆 钧复
鉅子 钜子
鉅萬 钜万
鉅防 钜防
鉸鍊 铰链
銀鍊 银链
錢鍾書 钱锺书
鍊墜 链坠
鍊子 链子
鍊形 链形
鍊條 链条
鍊錘 链锤
鍊鎖 链锁
鍛鍾 锻锺
鍾繇 钟繇 锺繇
鍾萬梅 锺万梅
鍾重發 锺重发
鍾鍛 锺锻
鍾馗 锺馗
鎖鍊 锁链
鐵鍊 铁链
鑽石項鍊 钻石项链
雁杳魚沈 雁杳鱼沉
雖覆能復 虽覆能复
電覆 电复
露覆 露复
項鍊 项链
頗覆 颇复
頸鍊 颈链
顛乾倒坤 颠乾倒坤
顛倒乾坤 颠倒乾坤
顧藉 顾借
麼些族 麽些族
黄鍾公 黄锺公
龍鍾 龙钟 龙锺

View File

@ -0,0 +1,386 @@
PN結 PN接面
SQL注入 SQL隱碼攻擊
SQL注入攻擊 SQL隱碼攻擊
U盤 隨身碟
三極管 三極體
下拉列表 下拉選單
並行計算 平行計算
中間件 中介軟體
串口 串列埠
串行 序列
串行端口 串列埠
主引導記錄 主開機記錄
主板 主機板
二極管 二極體
互聯網 網際網路
交互 互動
交互式 互動式
人工智能 人工智慧
代碼 程式碼 代碼
代碼頁 內碼表
以太網 乙太網
任務欄 工作列
任務管理器 工作管理員
仿真 模擬
位圖 點陣圖
低級 低階 低級
便攜式 行動式 攜帶型
保存 儲存
信噪比 訊雜比
信息 資訊
信息安全 資訊保安
信息技術 資訊科技
信息論 資訊理論
信號 訊號 信號
信道 通道
傳感 感測
像素 畫素
僞代碼 虛擬碼
優先級 優先順序
優化 最佳化
元數據 後設資料
元編程 超程式設計
光標 游標
光盤 光碟
光驅 光碟機
免提 擴音
內存 記憶體
內核 核心
內置 內建
內聯函數 行內函數
全局 全域性
全角 全形
兼容 相容
冒泡排序 氣泡排序
函數 函式
函數式編程 函數語言程式設計
刀片服務器 刀鋒伺服器
分佈式 分散式
分區 分割槽
分辨率 解析度
刷新 重新整理
刻錄 燒錄
前綴 字首
剪切 剪下
剪貼板 剪貼簿
創建 建立
加載 載入
半角 半形
博客 部落格
卸載 解除安裝
原代碼 原始碼
參數 引數
參數表 參數列
句柄 控制代碼
可視化 視覺化
呼出 撥出
呼叫轉移 來電轉駁
命令式編程 指令式程式設計
命令行 命令列
命名空間 名稱空間
哈希 雜湊
單片機 微控制器
回調 回撥
固件 韌體
圖像 影象
圖庫 相簿
圖標 圖示
在線 線上
地址 地址 位址
地址欄 位址列
城域網 都會網路
堆棧 堆疊
場效應管 場效電晶體
壁紙 桌布 壁紙
外置 外接
外鍵 外來鍵
多任務 多工
多態 多型
多線程 多執行緒
字庫 字型檔
字段 欄位
字符 字元
字符串 字串
字符集 字符集
字節 位元組
字體 字型
存儲 儲存
存盤 存檔
宏 宏 巨集
宏內核 單核心
寄存器 暫存器
密鑰 金鑰
實例 例項 實例
實模式 真實模式
審覈 稽覈
寫保護 防寫
寬帶 寬頻
尋址 定址
對話框 對話方塊
對象 物件 對象
導入 匯入
導出 匯出
局域網 區域網
局部 區域性
屏幕 螢幕
屏蔽 遮蔽
嵌套 巢狀
布爾 布林
帶寬 頻寬
引導程序 載入程式
彙編 彙編 組譯
彙編語言 組合語言
後綴 字尾
循環 迴圈 循環
性價比 價效比
性能 效能
截取 擷取
截屏 截圖
打印 列印
打印機 印表機
打開 開啟 打開
批量 批次
拋出 丟擲
拷貝 複製
持久性 永續性
指針 指標
捲積 摺積
掃描儀 掃描器
掛斷 結束通話
採樣 取樣
採樣率 取樣率
接口 介面
控件 控制元件
插件 外掛
搜索 搜尋
操作數 運算元
操作符 運算子
操作系統 作業系統
擴展 擴充套件
擴展名 副檔名
支持 支援
支持者 支持者
散列 雜湊
數字 數字 數位
數字印刷 數位印刷
數字電子 數位電子
數字電路 數位電路
數據 資料
數據倉庫 資料倉儲
數據報 資料包
數據庫 資料庫
數據挖掘 資料探勘
數據源 資料來源
數組 陣列
文件 檔案
文件名 檔名
文件夾 資料夾
文件擴展名 副檔名
文字處理 文書處理
文本 文字
文檔 文件
映射 對映
時分多址 分時多重進接
時分複用 分時多工
時鐘頻率 時脈頻率
晶閘管 閘流體
晶體管 電晶體
智能 智慧
最終用戶 終端使用者
有損壓縮 有失真壓縮
服務器 伺服器
本地代碼 原生代碼
析構函數 解構函式
枚舉 列舉
查找 查詢
查看 檢視
桌面型 桌上型
構造函數 建構函式
標識符 識別符號
模塊 模組
模擬 模擬 類比
模擬電子 類比電子
模擬電路 類比電路
權限 許可權
正則表達式 正規表示式
死機 宕機
殺毒 防毒
比特 位元
比特幣 比特幣
比特率 位元率
波分複用 波長分波多工
消息 訊息 消息
添加 新增
源代碼 原始碼
源文件 原始檔
源碼 原始碼
溢出 溢位
滾動條 捲軸
演示文稿 簡報
激光 鐳射
激活 啟用
無損壓縮 無失真壓縮
物理內存 實體記憶體
物理地址 實體地址
狀態欄 狀態列
用戶 使用者
用戶名 使用者名稱
界面 介面
異步 非同步
登錄 登入
發佈 釋出
發送 傳送
皮膚 面板
盤片 碟片
盤符 碟符
目標代碼 目的碼
相冊 相簿
矢量 向量
知識產權 智慧財產權
短信 簡訊
硬件 硬體
硬盤 硬碟
碼分多址 分碼多重進接
碼率 位元速率
磁盤 磁碟
磁道 磁軌
社區 社羣 社區
移動硬盤 行動硬碟
移動網絡 行動網路
移動資料 行動資料
移動通信 行動通訊
移動電話 行動電話
程序 程式
程序員 程式設計師
空分多址 分空間多重進接
空分複用 空間多工
窗口 視窗
端口 埠
筆記本電腦 膝上型電腦
算子 運算元
算法 演算法
範式 正規化
粘貼 貼上 粘貼
紅心大戰 傷心小棧
組件 元件
綁定 繫結
網上鄰居 網路上的芳鄰
網卡 網絡卡
網吧 網咖
網絡 網路
網關 閘道器
線程 執行緒
編程 程式設計
編程語言 程式語言
緩存 快取
縮略圖 縮圖
縮進 縮排
總線 匯流排
缺省 預設
聯繫 聯絡
聯繫歷史 通話記錄
聲卡 音效卡
聲明 宣告
脫機 離線
腳本 指令碼
自動轉屏 自動旋轉螢幕
臺式機 桌上型電腦
航天飛機 太空梭
芯片 晶片
花屏 破圖
菜單 選單 菜單
萬維網 全球資訊網
藍屏 藍色畫面
藍牙 藍芽
虛函數 虛擬函式
虛擬機 虛擬機器
表達式 表示式 運算式
複印 影印
複選按鈕 覈取按鈕
複選框 覈取方塊
視圖 檢視
視頻 影片 視訊
解釋器 直譯器
觸摸 觸控
觸摸屏 觸控式螢幕
計算機安全 電腦保安
計算機科學 電腦科學
訪問 訪問 存取
設備 裝置
設置 設定
註冊機 序號產生器
註冊表 登錄檔
註銷 登出
調制 調變
調度 排程
調用 呼叫
調色板 調色盤
調製解調器 數據機
調試 除錯 偵錯
調試器 偵錯程式
變量 變數
軟件 軟體
軟驅 軟碟機
轉義字符 跳脫字元
通信 通訊
通訊卡 通話卡
通配符 萬用字元
連接 連線
連接器 聯結器
進制 進位制
進程 程序 進程
運算符 運算子
運行 執行
過程式編程 程序式程式設計
遞歸 遞迴
遠程 遠端
適配器 介面卡
邏輯門 邏輯閘
重命名 重新命名
重裝 重灌
重載 過載
金屬氧化物半導體 金氧半導體
錄像 錄影
鏈接 連結
鏈表 連結串列
鏡像 映象
門戶網站 入口網站
門電路 閘電路
閃存 快閃記憶體
關係數據庫 關聯式資料庫
隊列 佇列
集成 整合
集成電路 積體電路
集羣 叢集
雲存儲 雲端儲存
雲計算 雲端計算
面向對象 物件導向
面向過程 程序導向
音頻 音訊
頁眉 頁首
頁腳 頁尾
項目 專案
預處理器 前處理器
頭文件 標頭檔案
頻分多址 分頻多重進接
頻分複用 分頻多工
類型 型別
類模板 類别範本
顯像管 映象管
顯卡 顯示卡
顯存 視訊記憶體
飛行模式 飛航模式
首席信息官 資訊長
首席執行官 執行長
首席技術官 技術長
首席運營官 營運長
高性能計算 高效能運算
高清 高畫質
高端 高階 進階
高級 高階 進階 高級
高速緩存 快取記憶體
黑客 駭客
默認 預設
默認值 預設值
點擊 點選
鼠標 滑鼠

View File

@ -0,0 +1,84 @@
乍得 查德
也門 葉門
仙童半導體 快捷半導體
伯利茲 貝里斯
佛得角 維德角
傅里葉 傅立葉
克羅地亞 克羅埃西亞
列支敦士登 列支敦斯登
利比里亞 賴比瑞亞
加納 迦納
加蓬 加彭
博茨瓦納 波札那
卡塔爾 卡達
危地馬拉 瓜地馬拉
厄瓜多爾 厄瓜多
厄立特里亞 厄利垂亞
吉布堤 吉布地
哈薩克斯坦 哈薩克
哥斯達黎加 哥斯大黎加
喫茶小舖 喫茶小舖
圖瓦盧 吐瓦魯
土庫曼斯坦 土庫曼
圭亞那 蓋亞那
坦桑尼亞 坦尚尼亞
埃塞俄比亞 衣索比亞
基里巴斯 吉里巴斯
塔吉克斯坦 塔吉克
塞拉利昂 獅子山
塞浦路斯 塞普勒斯
塞舌爾 塞席爾
多米尼加 多明尼加
安提瓜和巴布達 安地卡及巴布達
尼日利亞 奈及利亞
尼日爾 尼日
岡比亞 甘比亞
巴巴多斯 巴貝多
巴布亞新幾內亞 巴布亞紐幾內亞
布基納法索 布吉納法索
布隆迪 蒲隆地
帕勞 帛琉
幾內亞比紹 幾內亞比索
意大利 義大利
所羅門羣島 索羅門羣島
文萊 汶萊
斯威士蘭 史瓦濟蘭
斯洛文尼亞 斯洛維尼亞
新西蘭 紐西蘭
格林納達 格瑞那達
格魯吉亞 喬治亞
歐拉 尤拉
毛里塔尼亞 茅利塔尼亞
毛里求斯 模里西斯
沙特阿拉伯 沙烏地阿拉伯
波斯尼亞黑塞哥維那 波士尼亞赫塞哥維納
津巴布韋 辛巴威
洪都拉斯 宏都拉斯
溫納圖萬 那杜
烏茲別克斯坦 烏茲別克
特立尼達和多巴哥 千里達及托巴哥
瑙魯 諾魯
瓦努阿圖 萬那杜
盧旺達 盧安達
科摩羅 葛摩
科特迪瓦 象牙海岸
突尼斯 突尼西亞
純喫茶 純喫茶
索馬里 索馬利亞
老撾 寮國
聖基茨和尼維斯 聖克里斯多福及尼維斯
聖文森特和格林納丁斯 聖文森及格瑞那丁
聖盧西亞 聖露西亞
聖馬力諾 聖馬利諾
肯尼亞 肯亞
莫桑比克 莫三比克
萊索托 賴索托
萬象 永珍
蘇里南 蘇利南
貝寧 貝南
贊比亞 尚比亞
阿塞拜疆 亞塞拜然
阿拉伯聯合酋長國 阿拉伯聯合大公國
香農 夏農
馬爾代夫 馬爾地夫
馬里共和國 馬利共和國

View File

@ -0,0 +1,36 @@
元音 母音
冰棍 冰棒
出租車 計程車
咖喱 咖哩
塑料 塑膠
奔馳 賓士
奶酪 乳酪
幾率 機率
方便麪 泡麵 速食麵
李彥宏 李彥宏
概率 機率
海內存知己 海內存知己
涼菜 冷盤
的士 計程車
砹 砈
硅 矽
程序不正義 程序不正義
程序正義 程序正義
空氣淨化器 空氣清淨機
納米 奈米
自行車 腳踏車
詞組 片語
蹦極 高空彈跳
輔音 子音
通過 透過 通過
酰 醯
鈁 鍅
鈈 鈽
錇 鉳
鍀 鎝
鎄 鑀
鎇 鋂
鎿 錼
鐦 鉲
鑥 鎦
黃宏 黃宏

View File

@ -0,0 +1,39 @@
僞 偽
啓 啟
喫 吃
嫺 嫻
嬀 媯
峯 峰
幺 么
擡 抬
棱 稜
檐 簷
污 汙
泄 洩
潙 溈
潨 潀
爲 為
牀 床
痹 痺
癡 痴
皁 皂
着 著
睾 睪
祕 秘
竈 灶
糉 粽
繮 韁
纔 才
羣 群
脣 唇
蔘 參
蔿 蒍
衆 眾
裏 裡
覈 核
踊 踴
鉢 缽
鍼 針
鮎 鯰
麪 麵
齶 顎

View File

@ -0,0 +1,68 @@
一口吃個 一口喫個
一口吃成 一口喫成
一家三口 一家三口
一家五口 一家五口
一家六口 一家六口
一家四口 一家四口
凶事 凶事
凶信 凶信
凶兆 凶兆
凶吉 凶吉
凶地 凶地
凶多吉少 凶多吉少
凶宅 凶宅
凶年 凶年
凶德 凶德
凶怪 凶怪
凶日 凶日
凶服 凶服
凶歲 凶歲
凶死 凶死
凶氣 凶氣
凶煞 凶煞
凶燄 凶燄
凶神 凶神
凶禮 凶禮
凶耗 凶耗
凶肆 凶肆
凶荒 凶荒
凶訊 凶訊
凶豎 凶豎
凶身 凶身
凶逆 凶逆
凶門 凶門
口吃 口吃
吃口 喫口 吃口
吃口令 吃口令
吃口飯 喫口飯
吃吃 喫喫 吃吃
吃子 喫子 吃子
合著 合著
吉凶 吉凶
名著 名著
四凶 四凶
大凶 大凶
巨著 巨著
張口 張口
昭著 昭著
歲凶 歲凶
胃口 胃口
著作 著作
著名 著名
著式 著式
著志 著志
著於 著於
著書 著書
著白 著白
著稱 著稱
著者 著者
著述 著述
著錄 著錄
蹇吃 蹇吃
逢凶 逢凶
避凶 避凶
鄧艾吃 鄧艾吃
鉅著 鉅著
開口 開口
閔凶 閔凶
顯著 顯著

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="100px" height="100px" viewBox="-10 -10.48 100 100"
overflow="visible" enable-background="new -10 -10.48 100 100" xml:space="preserve">
<defs>
</defs>
<g>
<path d="M47.2,24.959c0.746,0,2.346,0.64,4.8,1.92c2.026,1.12,3.04,2.16,3.04,3.12c0,0.428-0.56,0.88-1.68,1.36
c-2.4,1.174-4.641,2.56-6.721,4.16l-3.92,2.96c-0.427,0.268-0.8,0.507-1.12,0.72c0.693,0.427,1.093,1.014,1.2,1.759
c0.106,1.068,0.187,2.107,0.24,3.121c1.066-0.107,2.133-0.188,3.2-0.24c6.826-0.641,12.053-1.36,15.68-2.16
c1.546-0.32,2.48-0.48,2.8-0.48c0.32,0,1.761,0.48,4.32,1.44c2.08,1.067,3.12,2.054,3.12,2.96c0,0.854-1.44,1.279-4.32,1.279H55.76
c-3.308,0-7.467,0.16-12.479,0.48c0.319,4.48,0.479,8.48,0.479,12c0,6.027-0.587,10.267-1.76,12.721
c-1.067,1.706-2.054,2.56-2.96,2.56c-0.48,0-1.04-0.374-1.68-1.12c-2.668-3.414-5.094-6-7.28-7.76
c-0.48-0.267-0.72-0.533-0.72-0.801c0-0.212,0.106-0.319,0.32-0.319c0.692,0,1.786,0.427,3.28,1.28
c2.026,0.64,3.333,0.959,3.92,0.959c0.427,0,0.772-0.292,1.04-0.879c0.427-0.961,0.772-2.507,1.04-4.641
c0.267-2.452,0.4-5.732,0.4-9.84c0-1.387-0.028-2.666-0.08-3.84c-0.748,0.054-1.468,0.107-2.16,0.16
c-5.388,0.373-11.254,1.279-17.6,2.72c-1.654,0.427-2.748,0.64-3.28,0.64c-0.908,0-2.32-0.372-4.24-1.119
c-1.974-0.801-2.96-1.467-2.96-2c0-0.693,0.64-1.094,1.92-1.201c6.826-0.105,11.866-0.451,15.12-1.039
c4.052-0.533,8.346-1.013,12.88-1.44C38.8,43.493,38.612,42.693,38.4,42c-0.374-1.387-0.96-2.347-1.761-2.88
c-0.479-0.266-0.72-0.506-0.72-0.72c0-0.586,0.532-0.88,1.6-0.88c0.427,0,1.2,0.24,2.32,0.72c2.24-2.613,4.08-5.066,5.521-7.36
c0.372-0.586,0.56-0.986,0.56-1.2c0-0.426-0.294-0.64-0.88-0.64c-0.428,0-1.36,0.134-2.8,0.4C39.68,29.919,36,30.773,31.2,32
c-1.12,0.32-1.84,0.48-2.16,0.48c-0.48,0-1.308-0.292-2.48-0.88c-1.228-0.692-1.84-1.227-1.84-1.6c0-0.426,0.506-0.64,1.52-0.64
c4.16-0.266,7.706-0.772,10.64-1.52c2.88-0.64,5.732-1.412,8.561-2.32C46.347,25.147,46.933,24.959,47.2,24.959z M35.04,5.919
c1.12,0,2.532,0.454,4.24,1.36c1.706,1.068,2.826,2.108,3.359,3.12c0.533,1.12,0.801,2.24,0.801,3.36c0,1.173-0.32,2-0.96,2.48
c5.065-0.64,10.372-1.44,15.92-2.4c1.652-0.48,2.72-0.72,3.199-0.72c0.801,0,2.267,0.907,4.4,2.72
c2.452,1.974,3.68,3.468,3.68,4.48c0,1.12-1.04,1.76-3.12,1.92c-3.04,0.427-6.693,1.333-10.96,2.72
c-0.213,0-0.319-0.106-0.319-0.32c2.933-3.84,4.399-6.106,4.399-6.8c0-0.64-0.507-0.96-1.52-0.96
c-7.84,0.214-18.88,1.708-33.12,4.48c-1.228,0.107-1.974,0.16-2.24,0.16c-0.907,0-1.68-0.106-2.32-0.32
c-0.16,0.907-0.48,1.947-0.96,3.12c-0.854,1.974-1.654,3.334-2.4,4.08c-0.534,0.428-1.04,0.64-1.52,0.64
c-0.534,0-1.094-0.346-1.68-1.04c-0.32-0.586-0.48-1.28-0.48-2.08c0-0.746,0.16-1.386,0.48-1.92c1.066-1.333,2.32-4.132,3.76-8.4
c0.16-0.64,0.4-0.96,0.72-0.96c0.533,0,1.066,0.667,1.6,2c0.16,0.534,0.292,1.014,0.4,1.44h0.88c5.653-0.16,11.867-0.64,18.64-1.44
c-0.854-0.586-1.84-1.973-2.96-4.16c-1.707-3.36-2.56-5.44-2.56-6.24C34.4,6.08,34.612,5.973,35.04,5.919z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,207 @@
划 劃 畫 划 「划」讀音hua2意義爲「撥水前進」、「合算」。「劃」讀作hua2時意義爲「戳傷」讀作hua4是意義爲「分界」、「設計」。「畫」基本意義爲「繪畫」。 劃分 劃破 圖畫 畫押 划船 划算
卤 滷 鹵 「滷」特別作爲一種烹調方法,「鹵」用作其他意義或化學元素。 滷汁 滷肉 鹵素
历 歷 曆 「日曆」作「曆」,與歷史有關用「歷」。 萬年曆 歷史
发 發 髮 與毛髮有關用「髮」,其餘意義爲「發」。 發財 發送 頭髮 令人髮指
只 只 隻 「隻」用作量詞,「只」爲副詞「僅」。 船隻 隻言片語 只有 僅只
台 臺 檯 颱 台 與「平地」有關用「臺」,與「櫃檯」有關用「檯」,與「颱風」有關用「颱」。「台」爲罕用字。 看臺 高臺 電視臺 寫字檯 颱風 兄台 天台山 五臺山 臺灣
后 後 后 與「帝王」、「帝王配偶」有關用「后」,與「時間先後」有關用「後」。 皇后 以後
坛 壇 罈 「罈」爲一種容器,其餘意義爲「壇」。 祭壇 論壇 罈子 酒罈
复 復 複 覆 表示重疊意義用「複」,表示往返意義用「復」,表示「翻倒」、「遮蓋」用「覆」。 複製 重複 反復 恢復 覆蓋 傾覆 翻雲覆雨 反覆無常
尽 盡 儘 「儘」用於「放開」、「最大限度」之意。其餘用「盡」。 儘管 儘量 極盡 自盡 盡頭
干 幹 乾 干 榦 「干」本意爲盾牌,意義與武器有關。「乾」意義爲「水分少」。「幹」意義爲「主幹」或爲動詞。「榦」特別用於「版榦」。 干戈 干涉 干擾 干預 乾燥 乾貨 骨幹 幹部 幹活 版榦
并 並 併 并 「併」特比用於「合併」之義,其餘一般作「並」。 並且 兼併 吞併 并州 兼容并包
当 當 噹 「噹」用於擬聲詞,其餘用「當」。 叮噹 噹啷 當然 當年 應當
志 志 誌 與記錄有關用「誌」,其餘用「志」。 志向 志氣 雜誌 日誌
汇 匯 彙 「彙」爲「相同種類聚集成的東西」,「匯」傾向於「水流匯合」一動作。 辭彙 彙編 彙報 匯合 匯款
系 系 係 繫 「係」強調「關係」,「系」爲一個整體,「繫」與連接有關。 系統 係數 干係 關係 聯繫 維繫 繫鞋帶
脏 髒 臟 「臟」讀音zang4意義爲「身體器官」「髒」讀音zang1意義爲「不乾淨」。 內臟 骯髒
荡 蕩 盪 與「洗滌」、「搖動」有掛用「盪」,其餘用「蕩」。 盪漾 盪滌 動盪 掃蕩 放蕩 蕩然無存 蕩氣迴腸
获 獲 穫 「獲」一般用於動詞,「穫」一般用於名詞。 不勞而獲 獲益 收穫
采 採 采 「採」用於動詞,其餘用「采」。 採集 博採眾長 丰采 神采奕奕
里 裏 里 「裏」與「外」相對,其餘用「里」。 里程 故里 裏外
钟 鍾 鐘 「鍾」意義爲聚集,「鐘」爲一種樂器。 鍾情 鍾愛 鐘鼓 掩耳盜鐘
饥 飢 饑 「飢」意義爲「吃不飽」,「饑」意義爲「穀物不熟」。 飢餓 饑荒 饑饉
丰 豐 丰 表示「美好的容貌的姿態」用「丰」,其餘一般爲「豐」。 丰采 丰姿 豐富 五穀豐登 張三丰
丑 醜 丑 「丑」用於十二地支和戲角色,「醜」爲「不美」。 小丑 丑角 辛丑條約 醜陋 醜惡
了 了 瞭 「了」意義爲「完畢」、「完全」。「瞭」讀作liao3時意義爲「明白」、「清楚」讀作liao4時意義爲「遠看」。 不了了之 了無牽掛 明瞭 瞭解 一目瞭然 瞭望
借 借 藉 「依賴、假借、草墊」之意用「藉」,其餘一般用「借」。(習慣用法區別) 慰藉 藉口 憑藉 借住 借題發揮 借刀殺人
克 克 剋 與「戰勝」、「約束」、「傷害」有關意義用「剋」,其餘用「克」。 克服 以柔克剛 千克 攻剋 剋扣 剋夫
准 準 准 「准」只用於「允許」意義,其餘用「準」。 准許 不准 準備 標準
刮 刮 颳 「吹襲」用「颳」,其餘用「刮」。 颳風 冰前颳雪 刮鬍子 刮痧 耳刮子
制 制 製 「製」只用於「製作」相關意義,其餘用「制」。 制度 控制 製作
吁 籲 吁 「呼喊﹑請求」用「籲」讀音yu4「歎氣」用「吁」讀音xu1。 長吁短歎 呼籲 籲請
吊 吊 弔 「弔」只用於「祭奠死者」相關意義,其餘用「吊」。 吊車 上吊 弔唁 弔喪
团 團 糰 與「食品」有關用「糰」,其餘用團。 飯糰 糯米糰 團體 社團
困 困 睏 「睏」特指「瞌睡」,其餘用「困」。 困擾 困局 貧困 睏意 睏倦
布 佈 布 「布」爲「紡織品」,其餘用「佈」。 棉布 發佈 佈置 擺佈 遍佈
御 御 禦 與「抵抗」有關用「禦」,其餘用「御」。 御馬 御用 防禦 抵禦
斗 鬭 斗 「斗」爲一種容積計量單位,「鬭」表示「鬭爭」之意。 五斗米 車載斗量 鬭爭 戰鬭
曲 曲 麯 「麯」與釀酒有關,其餘用「曲」。 樂曲 曲直 酒麯 大麯
松 鬆 松 「松」爲一種樹木名詞,「鬆」與「緊」相對、 松樹 雪松 輕鬆 肉鬆
淀 澱 淀 「淀」之意義爲「淺水」,其餘用「澱」。 澱粉 沉澱 海淀區 白洋淀
纤 纖 縴 表示「細小」用「纖」讀作xian1。表示拉船用「縴」讀作qian4。 纖維 光纖 縴夫
致 致 緻 與「細密」、「意趣」有關用「緻」,其餘用致。 導致 致敬 精緻 緻密 別緻 雅緻
蔑 蔑 衊 表示「血污」、「誹謗」用「衊」,其餘意義用「蔑」。 輕蔑 蔑視 誣衊
仇 仇 讎 與「校對」有關用「讎」,其餘用「仇」。 仇恨 報仇 讎校 仇讎
冬 冬 鼕 「鼕」爲鼓聲擬聲詞,其餘用「冬」。 隆冬 冬暖夏涼 鼕鼕
咸 咸 鹹 「鹹」意義與「淡」相對,其餘用「咸」。 老少咸宜 鹹淡
云 雲 云 「云」意義爲「說」,其餘用「雲」。 人云亦云 雲霧
仆 僕 仆 「仆」意義爲「跌倒」讀音pu1「僕」爲「供人使喚的人」讀音pu2。 前仆後繼 仆街 奴僕 公僕 風塵僕僕
舍 舍 捨 「捨」讀作she3用於「放棄」意義其餘用「舍」讀作she4古文亦同「捨」。 宿舍 村舍 退避三舍 捨弃 舍我其誰 不舍晝夜
签 籤 簽 「簽」用於動詞,表示「題字題名」,其餘用「籤」。 簽名 簽證 標籤 書籤 牙籤
折 折 摺 與「叠」有關用「摺」,與「斷」有關用「折」。 摺紙 摺扇 存摺 折斷 折腰 折服 打折 損兵折將
谷 谷 穀 表示「兩山之間」的地域用「谷」,表示農作物時用「穀」。 山谷 稻穀
几 幾 几 「几」只用作「茶几」。表示「幾乎」、「幾個」意義用「幾」。 茶几 幾乎 幾個
辟 闢 辟 「闢」用於「開墾」、「駁斥」意義。其餘用「辟」。 開闢 闢謠 另闢蹊徑 精闢 辟邪 鞭辟入裏
奸 奸 姦 「姦」只用於淫亂之意,其餘用「奸」。 漢奸 狼狽爲奸 強姦
游 遊 游 「游」與「水」有關,其餘用「遊」。 游泳 上游 遊戲 遊蕩
佣 傭 佣 「傭」爲「僕役」讀音yong1「佣」爲「中間人」讀音yong4。 傭人 雇傭 傭兵 佣金
苏 蘇 囌 甦 「甦」與「醒」、「恢復」有關,「囌」用於「嚕囌」(囉唆),其餘用「蘇」。 甦醒 甦生 復甦 嚕囌 蘇州 屠蘇 蘇俄
回 回 迴 與「旋轉」、「返迴」有關用「迴」,其餘用「回」。 迴合 迴光返照 迴旋 迴避 回答 回族 回絕
面 面 麪 「面」意義爲「臉」、「外表」,「麪」爲小麥磨成的粉。 臉面 麪條 麪粉
向 向 嚮 曏 「曏」表示「從前」,「嚮」表示「引導」、「傾向」,其餘用「向」。 曏者 嚮導 嚮往 嚮晦 方向 意向 向晚 向背 向來
伙 夥 伙 「伙」只用於「伙食」、「工具」相關意義,其餘用「夥」。 夥同 夥伴 小夥子 伙食 包伙 傢伙
郁 鬱 郁 與「文采豐盛」、「濃烈」有關意義用「郁」,其餘用「鬱」。 馥郁 郁郁乎文哉 鬱結 憂鬱 鬱金香 鬱悶 鬱郁
朴 樸 朴 表示「原本的」意義用「樸」,其他音義用「朴」。 樸素 純樸 質樸 朴刀 朴姓 朴硝
才 才 纔 表示「方」、「僅」用「纔」,其餘用「才」。 才俊 才幹 才能 纔能 剛纔 方纔
朱 朱 硃 「硃」用於與「硃砂」有關意義,其餘用「朱」。 硃砂 近朱者赤
别 別 彆 「彆」讀音bie4與「彆扭」有關其餘用「別」。 區別 彆扭
卷 捲 卷 「捲」表示彎曲讀音juan3其餘用「卷」讀音juan4。 席捲 捲土重來 花捲 試卷 卷帙 讀萬卷書
蒙 蒙 矇 濛 懞 表示「欺騙」、「猜測」、「盲」用「矇」,表示「細雨」用「濛」,表示「老實」用「懞」,其餘意義用「蒙」。 矇騙 矇蔽 矇混 濛濛細雨 涳濛 懞直 蒙受 蒙昧 啓蒙 蒙古
征 徵 征 與「召集」和「蹟象」有關用「徵」,與「遠征」、「討伐」有關用「征」。 征服 遠征 徵兵 徵收 徵兆 特徵 徵詢
症 症 癥 「癥」爲一種「腹中結硬塊的疾病」讀音zheng1。一般病症用「症」讀音zheng4。 絕症 癌症 對症下藥 癥結
恶 惡 噁 「噁心」用「噁」,其餘一般用「惡」。 善惡 噁心 二噁英
注 注 註 與「記錄」有關意義用「註」,其餘用「注」。 注意 注入 關注 註冊 註釋 命中註定
哄 哄 鬨 與「眾人喧鬧」有關用「鬨」讀音hong4其餘用「哄」。 哄騙 哄孩子 起鬨 一鬨而散
参 參 蔘 「蔘」表示一種植物,其餘用「參」。 參與 參數 內参 海参崴 人蔘 黃金蔘
腌 醃 腌 「腌」用於「腌臢」,表示一種食物加工方法用「醃」。 腌臢 醃漬 醃肉
彩 彩 綵 表示「五彩的絲織品」用「綵」,其餘用「彩」。 張燈結綵 綵頭 剪綵 彩票 五彩繽紛
占 佔 占 與巫術有關用「占」讀音zhan1其餘用「佔」讀音zhan4。 占卜 占星 佔領 佔據
欲 欲 慾 「慾」只用於「情慾」有關意義,其餘用「欲」。 獸慾 慾火 貪欲 暢所欲言 震耳欲聾
扎 扎 紮 表示「纏束」、「軍隊屯駐」用「紮」,其餘用「扎」。 駐紮 包紮 安營紮寨 扎針 扎花 掙扎
熏 熏 燻 「燻」特指一種烹飪方法,其餘用「熏」。 熏陶 利慾熏心 臭氣熏天 燻肉
赞 贊 讚 與「表揚」有關意義用「讚」,其餘用「贊」。 贊助 贊同 讚美
尝 嘗 嚐 與「喫」、「品嚐」有關意義用「嚐」,其餘用「嘗」。 嘗試 品嚐
吃 喫 吃 解作「食」時用「喫」,解作「言蹇難也」時用「吃」。 喫飯 喫水 口吃
烟 煙 菸 「煙」用於一般煙霧,與「菸草」有關時用「菸」。 煙霧 菸草 香菸
周 周 週 賙 與「週期」有關用「週」,濟助他人用「賙」,其餘意義爲「周」。 周朝 眾所周知 週歲 週而復始 賙濟
柜 櫃 柜 表示收藏東西的傢具時作「櫃」,表示一種落葉喬木用「柜」。 書櫃 柜柳
喂 餵 喂 表示「餵養」時用「餵」,「喂」僅用作語氣詞。 餵豬 喂!
幸 幸 倖 「倖」專指「意外地成功或避免」,其餘一般用「幸」。 倖免 倖存 僥倖 倖運 幸福 寵幸 慶幸
凶 兇 凶 與占卜吉凶有關用「凶」,與「殺害」有關用「兇」。 凶宅 吉凶 兇殺 兇器 行兇
杰 傑 杰 「杰」常用於人名,表示「出眾」用「傑」。 傑出 俊傑 傑作 李連杰 周杰倫 狄仁杰
针 針 鍼 「鍼」用於以砭石製成的針,其餘均作「針」。 針線 針鋒相對 鍼砭 鍼灸
戚 戚 慼 鏚 表示「憂愁」、「悲傷」用「慼」,「鏚」爲一種武器,其他意義用「戚」。 悲慼 慼慼 干鏚羽旄 戚繼光 親戚
托 托 託 與「捧呈」、「承受」有關用「托」,與「寄」、「委任」有關用「託」。 襯托 槍托 寄託 託付 推託
挨 挨 捱 表示「承受」、「拖延」、「抗拒」有關用「捱」讀爲ai2其餘用「挨」讀爲ai1。 挨家挨戶 捱打
挽 挽 輓 與「哀悼死者」有關用「輓」,其餘意義爲「挽」。 挽救 力挽狂瀾 輓聯 哀輓
栗 慄 栗 表示「因恐懼而發抖」用「慄」,其餘意義用「栗」。 板栗 火中取栗 戰慄 不寒而慄
炼 煉 鍊 專指「熔鍊金屬」時用「鍊」,一般意義用「煉」。 鍊鐵 淬鍊 煉乳 修煉
链 鏈 鍊 「鏈」用作一般的「金屬繩狀物」,「鍊」專指首飾。 鎖鏈 鏈接 項鍊 金手鍊
穗 穗 繐 「繐」用作「結紮成的裝飾物」,其餘用「穗」。 麥穗 帽繐
雕 彫 鵰 「鵰」爲一種猛禽,與「彫刻」有關時用「彫」。 一箭雙鵰 彫刻 彫蟲小技
梁 樑 梁 與「橋樑」、「棟樑」有關用「樑」,其餘意義爲「梁」。 樑上君子 鼻樑 大梁城 梁朝 梁山
升 升 昇 「昇」字帶有濃烈喜慶氣氛,其餘用「升」。 上升 一升水 旭日東昇 歌舞昇平
摆 擺 襬 表示「衣服下緣的部分」用「襬」,其餘用「擺」。 搖擺 擺放 裙襬 下襬
岩 巖 岩 「岩」只用於「岩石」相關意義,其餘用「巖」。 沉積岩 岩漿 巖壁 中空成巖
娘 娘 孃 「孃」意義爲「母親」,其餘用「娘」。 老孃 爹孃 孃家 姑娘 娘子 婆娘 舞娘
僵 僵 殭 「殭」意義爲「不腐朽的屍體」,其餘用「僵」。 殭屍 殭蠶 僵硬 僵局 李代桃僵 百足之蟲,死而不僵
药 藥 葯 「葯」特指「花的雄蕊中貯藏花粉的部份」,其餘用「藥」。 醫藥 良藥 芍藥 藥到病除 花葯
余 餘 余 「余」爲第一人稱代詞或地名。 剩餘 多餘 余吾鎮
蜡 蠟 蜡 「蜡」只用於「蜡月」。 蠟燭 蜂蠟 石蠟 蜡月
出 出 齣 「齣」只用於「一齣戲」。 出入 出道 一齣戲
卜 卜 蔔 「蔔」只用於「蘿蔔」。 占卜 卜辭 蘿蔔
同 同 衕 「衕」只用於「衚衕」。 大同 衚衕
板 板 闆 「闆」只用於「老闆」。 板塊 老闆
漓 漓 灕 「灕」只用於「灕江」。 大汗淋漓 淋漓盡致 灕江 灕水
术 術 朮 「朮」僅用於中藥名「白朮」相關。 法術 白朮 兀朮
仑 侖 崙 表示「崑崙」時用崙。 崑崙 加侖
秋 秋 鞦 「鞦」只用於「鞦韆」。 秋季 鞦韆
千 千 韆 「韆」只用於「鞦韆」。 千萬 鞦韆
帘 簾 帘 表示旗幟狀的標識用「帘」。 窗簾 珠簾 酒帘
庵 庵 菴 「菴」只用作「菴藹」讀作an4。 尼姑庵 菴藹
尸 屍 尸 「尸」表示「主持」、「佔用」。 屍體 尸位素餐
胡 胡 衚 鬍 「衚」只用於「衚衕」,「鬍」只用於「鬍鬚」。 胡人 胡亂 衚衕 鬍鬚
须 須 鬚 「鬚」只用於「鬍鬚」。 必須 鬍鬚
据 據 据 「据」只用於「拮据」。 數據 根據 拮据
筑 築 筑 「筑」爲古代一種樂器,其餘用「築」。 建築 築巢 擊筑
夸 誇 夸 「夸」見於古文和專有名詞。 誇大 誇獎 夸父 夸克
苹 蘋 苹 「苹」、「蘋」爲兩種不同的植物。 蘋果 白蘋 苹縈 食野之苹
袅 裊 嫋 與「嬌柔」、「婉轉」有關用「嫋」,其餘意義用「裊」。 嫋娜 餘音嫋嫋 裊繞
暗 暗 闇 與「愚昧」有關意義用「闇」,其餘用「暗」。 闇昧 愚闇 偏信則闇 棄暗投明 暗號 暗示 黑暗
冲 衝 沖 冲 與「撞擊」有關用「衝」,與「水流」有關用「沖」,「冲」見於古文。 要衝 衝突 俯衝 沖牛奶
表 表 錶 「錶」用作「鐘錶」,其餘用「表」。 表達 表示 代表 手錶
杆 杆 桿 表示細長的棍狀物「杆」讀音gan1傾向於較大的「桿」讀音gan3傾向於較小的。 球杆 旗杆 電線杆 筆桿 杠桿 大腸桿菌
鉴 鑒 鑑 用於「鏡子」、「圖章」意義時用「鑑」,其他引申意義均用「鑒」。 銅鑑 印鑑 借鑒 鑒定 明鑒 鑒賞 殷鑒不遠
搜 搜 蒐 「搜」意義爲「尋找」,與「聚集」和其他意義有關用「蒐」。 搜身 搜尋 蒐集 蒐羅 蒐購 春蒐
杯 杯 盃 「盃」特別用於「獎盃」 獎盃 冠軍盃 世界盃
铲 剷 鏟 「剷」用作動詞意義 剷除 鏟子
扣 扣 釦 「釦」表示衣服上的結 鈕釦
念 念 唸 與「讀」相近意義用「唸」 唸書 唸經 思念 繫念
杠 杠 槓 「杠」特別用於「牀杠」 牀杠
泛 泛 氾 表示「漂浮」「顯現」用「泛」,表示「大水」用「氾」 廣泛 泛舟 泛藍 氾濫
核 核 覈 與「校對」相關意義用「覈」 覈實 覈對 覈算 考覈
巨 巨 鉅 「鉅」與金屬有關,或用於固定名詞區別 艱鉅 鉅變 鉅鹿 鉅款 鉅貪 鉅富 鉅子
叹 嘆 歎 悲傷有關用「嘆」,其他用「歎」 哀嘆 感嘆 仰天長嘆 嘆息 嘆氣 吟歎 詠歎 歎賞 歎爲觀止 歎羨 讚歎
价 價 价 表示僕役用「价」 小价 貴价 盛价 價格
私 私 俬 室內使用的器具 傢俬
局 局 侷 表示「狹小」用「侷」 大局 侷促 侷限
拐 拐 柺 與「柺杖」有關用「柺」 柺杖 鐵柺李 拐彎
弦 弦 絃 「絃」專指樂器 管絃 琴絃 續絃 箭在弦上 弦月
哗 譁 嘩 擬聲詞用「嘩」 嘩啦 譁然 喧譁 譁眾取寵
凄 悽 淒 傾向於悲慘用「悽」,寒冷用「淒」 淒涼 悽慘 悽楚 悽惻
家 家 傢 「傢」爲「家」某些意義的分化字 傢俬、傢具、傢伙
席 席 蓆 「蓆」特指涼蓆 涼蓆 草蓆
酸 酸 痠 肢體疼痛用「痠」 痠痛 腰痠
噪 噪 譟 壯大聲勢用「譟」 鼓譟 譟詐 譟動 聒噪 噪音
咽 咽 嚥 「嚥」用於「吞嚥」之意 下嚥 嗚咽 咽喉
愈 愈 癒 「癒」表示恢復 癒合 治癒
凌 凌 淩 「淩」作姓氏 淩氏
毁 毀 譭 燬 與「燒」、「熔」有關用「燬」。「譭」表示「污衊」。 禁燬 燒燬 詆譭 譭譽參半 譭棄
苔 苔 薹 「苔」爲「附着在地面上的真菌藻類共生體」,「薹」爲「中央部分所長出來的莖」。 青苔 苔原 苔藓 蒜薹 蕓薹 菜薹
糊 糊 餬 「填飽肚子」用「餬」。 養家餬口
抵 抵 牴 「牴」本意爲「有角的獸類用角碰撞」,引申爲「衝突」。 牴觸 牴牾
恤 恤 卹 「卹」用作「撫慰」「賑濟」,「恤」用作「憂慮」「憐憫」。 體恤 憂國恤民 撫卹 卹金 振窮卹貧
荫 蔭 廕 表示「庇護」「父祖恩澤」用「廕」。 廕庇 封妻廕子
皂 皁 皂 「皂」專指肥皂。 香皂 皂莢樹 青紅皁白
芸 芸 蕓 「蕓」只用作「蕓薹」。 蕓薹 蕓香
背 背 揹 「揹」作動詞,表示「負荷」,讀陰平聲。 揹黑鍋 揹負
夫 夫 伕 「伕」指「出苦力的人」。 車伕 轎伕 腳伕
迹 蹟 跡 「蹟」特指「前人留下的事物」。 遺蹟 事蹟 奇蹟
涌 湧 涌 「湧」本作「涌」後分化。「湧」爲「水上溢」「涌」爲「小河」讀音chong1。 湧起 洶湧 浪湧 東涌
录 錄 彔 「彔」爲雕刻木材,見於古文。
极 極 极 「极」見於古文。
愿 願 愿 「愿」見於古文,意義爲「忠厚」﹑「謹慎」。
胜 勝 胜 「胜」爲「腥」之本字。
确 確 确 「确」見於古文。
叶 葉 叶 「叶」爲「協」古異體。
虫 蟲 虫 「虫」爲「虺」的古字。
厂 廠 厂 「厂」爲「庵」的古字。
修 修 脩 「脩」指「乾肉」或「酬金」,古通「修」。
价 價 价 「价」古義爲僕人。
合 合 閤 「閤」見於古文,意義爲「宮殿」、「邊門」。
适 適 适 「适」爲一古字,意義爲「迅速」。
弥 彌 瀰 「瀰」爲「水深滿的樣子」,只見於古文。
厘 釐 厘 「厘」見於古文。
涂 塗 涂 「涂」見於姓氏和古文。
个 個 箇 个 「箇」用於「箇中」地名「箇舊」,「个」見於古文。
于 於 于 「于」見於姓氏和古文。
党 黨 党 「党」只用於「党項族」或姓氏。
种 種 种 「种」爲姓氏,其餘用「種」。
万 萬 万 「万」只用於複姓「万俟」。
范 範 范 「范」只用於姓氏,其餘用「範」。
沈 瀋 沈 「瀋」意義爲「汁」亦是河流名「沈」作姓氏讀作shen3時
姜 姜 薑 「姜」爲姓氏,「薑」爲一種植物調味料。
闲 閒 閑 「閑」「閒」在一般意義上爲異體字,其他意義見於古文或通假。
证 證 証 証諫、士尉以証君
佑 佑 祐 福祉用「祐」。嘉祐 僧祐
谥 諡 謚 「諡」用於「諡號」,「謚」見於古文。
熏 熏 燻 「熏」可用於「煙燻」或「薰香」義。
旋 旋 鏇 「旋」用於「旋轉」等。「鏇」用於「旋轉削切」等。
沾 沾 霑 「雨水浸潤」、「受恩」等義用「霑」,「浸溼」等義通用,「接觸」「染上」「帶有」等義用「沾」。
跖 跖 蹠 「腳掌」等以「蹠」為正字。「跖」可用於人名,如「盜跖」。
玩 玩 翫 「鬆懈、輕忽」用「翫」,其餘「玩」「翫」通用。
璇 璇 璿 星名用「璇」。「天文儀」、「美玉」義可互通。二字皆有用於人名。 天璇
它 它 牠 對動物的第三人稱用「牠」。
蝎 蠍 蝎 「蝎」另兼正字義為「木中蠹蟲」。
唇 脣 唇 「嘴脣」以「脣」為正字。「唇」另義為「驚駭」讀作zhēn。

View File

@ -0,0 +1,12 @@
畫 画 划
覆 覆 复
藉 藉 借
乾 乾 干
瞭 瞭 了
鍊 炼 链
蘋 苹 蘋
於 于 於
鉅 巨 钜
衹 衹 只
著 着 著
沈 沈 沉

View File

@ -0,0 +1,147 @@
丟 丟 丢
並 並 竝
幷 并 幷
僞 偽 僞
兌 兌 兑
內 內 内
冊 冊 册
冢 冢 塚
剁 剁 刴
剋 剋 尅
劃 劃 𠟱 劐 𠜻
劍 劍 劎 劒 剣 剱 劔
匯 匯 滙
升 升 陞 阩 𧿘
只 只 𠮡 𠷓
呆 呆 獃
啓 啓 啟
回 回 囘 囬
囪 囪 囱
垛 垛 垜
埼 埼 碕 崎 隑
壩 垻 壩
壺 壷 壺
夠 够 夠
嫋 嫋 嬝
嬀 媯 嬀
嬤 嬤 嬷
崙 崙 崘
嶽 嶽 𡶓 𡶳 𡴳
廁 廁 厠
愨 愨 慤 𣪎
戶 戶 户 戸
挆 挆 挅
捂 捂 摀
擔 擔 担
擡 擡 抬
曬 曬 晒
朵 朵 朶
杴 杴 鍁 𣞘
查 査 查
棱 棱 稜
殼 㱿 殻 殼 㱿 𣪊
污 汙 污 汚
泄 泄 洩
涌 湧 涌
溯 溯 泝
潙 溈 潙
煙 煙 烟
爲 爲 為
牀 牀 床
牆 牆 墻
獎 獎 奬 𤟌 㢡
產 產 産
畫 畫 畵 𤱪 𨽶 𤲯
瘻 瘻 瘺
癡 癡 痴
衆 衆 眾
禿 禿 秃
秋 秋 龝 秌
秘 祕 秘
竈 竈 灶
累 累 纍
絕 絕 絶 𢇍 𠤉
絛 絛 縧
綠 綠 緑
綫 線 綫
繃 繃 綳
繡 繡 綉
繮 繮 韁
罈 罈 墰 罎 壜
罵 罵 駡
羣 羣 群
考 考 攷
脣 脣 唇
蓴 蓴 蒓
蘊 蘊 藴
裏 裏 裡
說 說 説
謠 謠 謡 䚻
譾 譾 謭
豎 豎 竪
豔 艷 豔 豓
贓 贓 贜
贗 贗 贋 偐
跺 跺 跥
踊 踴 踊
躲 躲 躱
逾 逾 踰
醞 醞 醖
醯 酰 醯
鉢 鉢 缽
鉤 鉤 鈎
銳 銳 鋭
錄 錄 録
錘 錘 鎚
鏽 鏥 銹 鏽
鐫 鐫 鎸 鋑 𥍯
钁 钁 鐝
閱 閱 閲
阪 坂 阪
僱 僱 雇
雕 雕 彫 琱
雞 雞 鷄 鶏
鞝 鞝 緔
頹 頹 頽
顏 顏 顔
館 館 舘
鬥 鬭 鬥 鬭 闘
鬨 鬨 閧
鯗 鯗 鮝
鱷 鱷 鰐 𧍞
鳧 鳧 鳬
鶿 鶿 鷀
鹼 鹼 礆 碱
麴 麯 麴
麪 麪 麵
麼 麽 麼
黴 黴 霉
齎 齎 賫
捻 捻 撚
柺 柺 枴
棲 棲 栖
臥 臥 卧
教 教 敎
勳 勳 勛
剿 剿 勦
甕 甕 瓮
餚 餚 肴
鼴 鼴 鼹
蔥 葱 蔥
搗 擣 搗
螂 蜋 螂
溼 濕 溼
羶 羶 羴
痺 痺 痹
蝨 虱 蝨
檐 檐 簷
暱 昵 暱
灩 灩 灎 灧
齧 嚙 齧
彝 彝 彞
檾 檾 苘 䔛
餈 餈 糍
拋 拋 抛
糉 糉 粽
峯 峰 峯
鵰 鵰 雕

View File

@ -0,0 +1,76 @@
# -*- coding: utf-8 -*-
import codecs
import sys
def sort_items(input_filename, output_filename):
input_file = codecs.open(input_filename, "r", encoding="utf-8")
dic = {}
for line in input_file:
if len(line) == 0 or line == '\n':
continue
try:
key, value = line.split("\t")
except ValueError:
print(line)
while value[-1] == "\n" or value[-1] == "\r":
value = value[:-1]
dic[key] = value
input_file.close()
output_file = open(output_filename, "wb")
for key in sorted(dic.keys()):
line = key + "\t" + dic[key] + "\n"
output_file.write(line.encode('utf-8'))
output_file.close()
def reverse_items(input_filename, output_filename):
input_file = codecs.open(input_filename, "r", encoding="utf-8")
dic = {}
for line in input_file:
if len(line) == 0:
continue
key, value = line.split("\t")
while value[-1] == "\n" or value[-1] == "\r":
value = value[:-1]
value_list = value.split(" ")
for value in value_list:
if value in dic:
dic[value].append(key)
else:
dic[value] = [key]
input_file.close()
output_file = open(output_filename, "wb")
for key in sorted(dic.keys()):
line = key + "\t" + " ".join(dic[key]) + "\n"
output_file.write(line.encode('utf-8'))
output_file.close()
def find_target_items(input_filename, keyword):
input_file = codecs.open(input_filename, "r", encoding="utf-8")
for line in input_file:
if len(line) == 0:
continue
key, value = line.split("\t")
while value[-1] == "\n" or value[-1] == "\r":
value = value[:-1]
value_list = value.split(" ")
for value in value_list:
if keyword in value:
sys.stdout.write(line)
input_file.close()

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from common import find_target_items
if len(sys.argv) != 3:
print("Find the value keyword in all pairs")
print(("Usage: ", sys.argv[0], "[input] [keyword]"))
exit(1)
find_target_items(sys.argv[1], sys.argv[2])

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import sys
from common import sort_items
if len(sys.argv) < 4:
print("Merge and sort all text dictionaries")
print(("Usage: ", sys.argv[0], "[input1] [input2] ... [inputN] [output]"))
exit(1)
all_lines = []
for i in range(1, len(sys.argv) - 1):
input_file = codecs.open(sys.argv[i], "r", encoding="utf-8")
for line in input_file:
all_lines += line
input_file.close()
all_lines += '\n'
output_filename = sys.argv[-1]
output_file = open(output_filename, "wb")
for line in all_lines:
output_file.write(line.encode('utf-8'))
output_file.close()
sort_items(output_filename, output_filename)

View File

@ -0,0 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from common import reverse_items
if len(sys.argv) != 3:
print("Reverse key and value of all pairs")
print(("Usage: ", sys.argv[0], "[input] [output]"))
exit(1)
reverse_items(sys.argv[1], sys.argv[2])

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from common import sort_items
if len(sys.argv) < 2:
print("Sort the dictionary")
print(("Usage: ", sys.argv[0], "[input] ([output])"))
exit(1)
input = sys.argv[1]
if len(sys.argv) < 3:
output = input
else:
output = sys.argv[2]
sort_items(input, output)

View File

@ -0,0 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import sys
from common import sort_items
if len(sys.argv) < 2:
print("Sort the dictionary")
print(("Usage: ", sys.argv[0], "[directory]"))
exit(1)
dirtectory = sys.argv[1]
files = glob.glob(dirtectory + "/*")
for filename in files:
print(filename)
sort_items(filename, filename)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
---
Language: Cpp
BasedOnStyle: Google
PointerAlignment: Left
...

View File

@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**System**
Which OS, compiler, and compiler version are you using:
- OS:
- Compiler and version:
**To reproduce**
Steps to reproduce the behavior:
1. sync to commit ...
2. cmake/bazel...
3. make ...
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR]"
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -0,0 +1,62 @@
*.a
*.so
*.so.?*
*.dll
*.exe
*.dylib
*.cmake
!/cmake/*.cmake
!/test/AssemblyTests.cmake
*~
*.swp
*.pyc
__pycache__
# lcov
*.lcov
/lcov
# cmake files.
/Testing
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
# makefiles.
Makefile
# in-source build.
bin/
lib/
/test/*_test
# exuberant ctags.
tags
# YouCompleteMe configuration.
.ycm_extra_conf.pyc
# ninja generated files.
.ninja_deps
.ninja_log
build.ninja
install_manifest.txt
rules.ninja
# bazel output symlinks.
bazel-*
# out-of-source build top-level folders.
build/
_build/
build*/
# in-source dependencies
/googletest/
# Visual Studio 2015/2017 cache/options directory
.vs/
CMakeSettings.json
# Visual Studio Code cache/options directory
.vscode/

View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Install a newer CMake version
curl -sSL https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.sh -o install-cmake.sh
chmod +x install-cmake.sh
sudo ./install-cmake.sh --prefix=/usr/local --skip-license
# Checkout LLVM sources
git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source
git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx
git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi
# Setup libc++ options
if [ -z "$BUILD_32_BITS" ]; then
export BUILD_32_BITS=OFF && echo disabling 32 bit build
fi
# Build and install libc++ (Use unstable ABI for better sanitizer coverage)
mkdir llvm-build && cd llvm-build
cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \
-DLIBCXX_ABI_UNSTABLE=ON \
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
../llvm-source
make cxx -j2
sudo make install-cxxabi install-cxx
cd ../

View File

@ -0,0 +1,231 @@
sudo: required
dist: trusty
language: cpp
matrix:
include:
- compiler: gcc
addons:
apt:
packages:
- lcov
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage
- compiler: gcc
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug
- compiler: gcc
env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release
- compiler: gcc
addons:
apt:
packages:
- g++-multilib
- libc6:i386
env:
- COMPILER=g++
- C_COMPILER=gcc
- BUILD_TYPE=Debug
- BUILD_32_BITS=ON
- EXTRA_FLAGS="-m32"
- compiler: gcc
addons:
apt:
packages:
- g++-multilib
- libc6:i386
env:
- COMPILER=g++
- C_COMPILER=gcc
- BUILD_TYPE=Release
- BUILD_32_BITS=ON
- EXTRA_FLAGS="-m32"
- compiler: gcc
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=g++-6 C_COMPILER=gcc-6 BUILD_TYPE=Debug
- ENABLE_SANITIZER=1
- EXTRA_FLAGS="-fno-omit-frame-pointer -g -O2 -fsanitize=undefined,address -fuse-ld=gold"
- compiler: clang
env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Debug
- compiler: clang
env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Release
# Clang w/ libc++
- compiler: clang
dist: xenial
addons:
apt:
packages:
clang-3.8
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1
- EXTRA_CXX_FLAGS="-stdlib=libc++"
- compiler: clang
dist: xenial
addons:
apt:
packages:
clang-3.8
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
- LIBCXX_BUILD=1
- EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ 32bit libc++
- compiler: clang
dist: xenial
addons:
apt:
packages:
- clang-3.8
- g++-multilib
- libc6:i386
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1
- BUILD_32_BITS=ON
- EXTRA_FLAGS="-m32"
- EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ 32bit libc++
- compiler: clang
dist: xenial
addons:
apt:
packages:
- clang-3.8
- g++-multilib
- libc6:i386
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
- LIBCXX_BUILD=1
- BUILD_32_BITS=ON
- EXTRA_FLAGS="-m32"
- EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ libc++, ASAN, UBSAN
- compiler: clang
dist: xenial
addons:
apt:
packages:
clang-3.8
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1 LIBCXX_SANITIZER="Undefined;Address"
- ENABLE_SANITIZER=1
- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all"
- EXTRA_CXX_FLAGS="-stdlib=libc++"
- UBSAN_OPTIONS=print_stacktrace=1
# Clang w/ libc++ and MSAN
- compiler: clang
dist: xenial
addons:
apt:
packages:
clang-3.8
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=MemoryWithOrigins
- ENABLE_SANITIZER=1
- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins"
- EXTRA_CXX_FLAGS="-stdlib=libc++"
# Clang w/ libc++ and MSAN
- compiler: clang
dist: xenial
addons:
apt:
packages:
clang-3.8
env:
- INSTALL_GCC6_FROM_PPA=1
- COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=RelWithDebInfo
- LIBCXX_BUILD=1 LIBCXX_SANITIZER=Thread
- ENABLE_SANITIZER=1
- EXTRA_FLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all"
- EXTRA_CXX_FLAGS="-stdlib=libc++"
- os: osx
osx_image: xcode8.3
compiler: clang
env:
- COMPILER=clang++ BUILD_TYPE=Debug
- os: osx
osx_image: xcode8.3
compiler: clang
env:
- COMPILER=clang++ BUILD_TYPE=Release
- os: osx
osx_image: xcode8.3
compiler: clang
env:
- COMPILER=clang++
- BUILD_TYPE=Release
- BUILD_32_BITS=ON
- EXTRA_FLAGS="-m32"
- os: osx
osx_image: xcode9.4
compiler: gcc
env:
- COMPILER=g++-7 C_COMPILER=gcc-7 BUILD_TYPE=Debug
before_script:
- if [ -n "${LIBCXX_BUILD}" ]; then
source .travis-libcxx-setup.sh;
fi
- if [ -n "${ENABLE_SANITIZER}" ]; then
export EXTRA_OPTIONS="-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF";
else
export EXTRA_OPTIONS="";
fi
- mkdir -p build && cd build
before_install:
- if [ -z "$BUILD_32_BITS" ]; then
export BUILD_32_BITS=OFF && echo disabling 32 bit build;
fi
- if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test";
sudo apt-get update --option Acquire::Retries=100 --option Acquire::http::Timeout="60";
fi
install:
- if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
travis_wait sudo -E apt-get -yq --no-install-suggests --no-install-recommends install g++-6;
fi
- if [ "${TRAVIS_OS_NAME}" == "linux" -a "${BUILD_32_BITS}" == "OFF" ]; then
travis_wait sudo -E apt-get -y --no-install-suggests --no-install-recommends install llvm-3.9-tools;
sudo cp /usr/lib/llvm-3.9/bin/FileCheck /usr/local/bin/;
fi
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
PATH=~/.local/bin:${PATH};
pip install --user --upgrade pip;
travis_wait pip install --user cpp-coveralls;
fi
- if [ "${C_COMPILER}" == "gcc-7" -a "${TRAVIS_OS_NAME}" == "osx" ]; then
rm -f /usr/local/include/c++;
brew update;
travis_wait brew install gcc@7;
fi
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo apt-get update -qq;
sudo apt-get install -qq unzip cmake3;
wget https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-linux-x86_64.sh --output-document bazel-installer.sh;
travis_wait sudo bash bazel-installer.sh;
fi
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-darwin-x86_64.sh;
travis_wait sudo bash bazel-installer.sh;
fi
script:
- cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_FLAGS="${EXTRA_FLAGS}" -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS} ${EXTRA_CXX_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ${EXTRA_OPTIONS} ..
- make
- ctest -C ${BUILD_TYPE} --output-on-failure
- bazel test -c dbg --define google_benchmark.have_regex=posix --announce_rc --verbose_failures --test_output=errors --keep_going //test/...
after_success:
- if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .;
fi

View File

@ -0,0 +1,115 @@
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Werror',
'-pedantic-errors',
'-std=c++0x',
'-fno-strict-aliasing',
'-O3',
'-DNDEBUG',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x', 'c++',
'-I', 'include',
'-isystem', '/usr/include',
'-isystem', '/usr/local/include',
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.cc' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}

View File

@ -0,0 +1,56 @@
# This is the official list of benchmark authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.
#
# Please keep the list sorted.
Albert Pretorius <pretoalb@gmail.com>
Alex Steele <steeleal123@gmail.com>
Andriy Berestovskyy <berestovskyy@gmail.com>
Arne Beer <arne@twobeer.de>
Carto
Christopher Seymour <chris.j.seymour@hotmail.com>
Colin Braley <braley.colin@gmail.com>
Daniel Harvey <danielharvey458@gmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Deniz Evrenci <denizevrenci@gmail.com>
Dirac Research
Dominik Czarnota <dominik.b.czarnota@gmail.com>
Eric Backus <eric_backus@alum.mit.edu>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
Federico Ficarelli <federico.ficarelli@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Gergő Szitár <szitar.gergo@gmail.com>
Google Inc.
International Business Machines Corporation
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Jern-Kuan Leong <jernkuan@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
Jordan Williams <jwillikers@protonmail.com>
Jussi Knuuttila <jussi.knuuttila@gmail.com>
Kaito Udagawa <umireon@gmail.com>
Kishan Kumar <kumar.kishan@outlook.com>
Lei Xu <eddyxu@gmail.com>
Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com>
MongoDB Inc.
Nick Hutchinson <nshutchinson@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Ori Livneh <ori.livneh@gmail.com>
Paul Redmond <paul.redmond@gmail.com>
Radoslav Yovchev <radoslav.tm@gmail.com>
Roman Lebedev <lebedev.ri@gmail.com>
Sayan Bhattacharjee <aero.sayan@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
Steinar H. Gunderson <sgunderson@bigfoot.com>
Stripe, Inc.
Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com>

View File

@ -0,0 +1,44 @@
licenses(["notice"])
config_setting(
name = "windows",
values = {
"cpu": "x64_windows",
},
visibility = [":__subpackages__"],
)
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "benchmark",
srcs = glob(
[
"src/*.cc",
"src/*.h",
],
exclude = ["src/benchmark_main.cc"],
),
hdrs = ["include/benchmark/benchmark.h"],
linkopts = select({
":windows": ["-DEFAULTLIB:shlwapi.lib"],
"//conditions:default": ["-pthread"],
}),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
cc_library(
name = "benchmark_main",
srcs = ["src/benchmark_main.cc"],
hdrs = ["include/benchmark/benchmark.h"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [":benchmark"],
)
cc_library(
name = "benchmark_internal_headers",
hdrs = glob(["src/*.h"]),
visibility = ["//test:__pkg__"],
)

View File

@ -0,0 +1,279 @@
cmake_minimum_required (VERSION 3.5.1)
foreach(p
CMP0048 # OK to clear PROJECT_VERSION on project()
CMP0054 # CMake 3.1
CMP0056 # export EXE_LINKER_FLAGS to try_run
CMP0057 # Support no if() IN_LIST operator
CMP0063 # Honor visibility properties for all targets
CMP0077 # Allow option() overrides in importing projects
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
endif()
endforeach()
project (benchmark CXX)
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." OFF)
option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF)
if(NOT MSVC)
option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library." OFF)
else()
set(BENCHMARK_BUILD_32_BITS OFF CACHE BOOL "Build a 32 bit version of the library - unsupported when using MSVC)" FORCE)
endif()
option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON)
# Allow unmet dependencies to be met using CMake's ExternalProject mechanics, which
# may require downloading the source code.
option(BENCHMARK_DOWNLOAD_DEPENDENCIES "Allow the downloading and in-tree building of unmet dependencies" OFF)
# This option can be used to disable building and running unit tests which depend on gtest
# in cases where it is not possible to build or find a valid version of gtest.
option(BENCHMARK_ENABLE_GTEST_TESTS "Enable building the unit tests which depend on gtest" ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(ENABLE_ASSEMBLY_TESTS_DEFAULT OFF)
function(should_enable_assembly_tests)
if(CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
if (${CMAKE_BUILD_TYPE_LOWER} MATCHES "coverage")
# FIXME: The --coverage flag needs to be removed when building assembly
# tests for this to work.
return()
endif()
endif()
if (MSVC)
return()
elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
return()
elseif(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
# FIXME: Make these work on 32 bit builds
return()
elseif(BENCHMARK_BUILD_32_BITS)
# FIXME: Make these work on 32 bit builds
return()
endif()
find_program(LLVM_FILECHECK_EXE FileCheck)
if (LLVM_FILECHECK_EXE)
set(LLVM_FILECHECK_EXE "${LLVM_FILECHECK_EXE}" CACHE PATH "llvm filecheck" FORCE)
message(STATUS "LLVM FileCheck Found: ${LLVM_FILECHECK_EXE}")
else()
message(STATUS "Failed to find LLVM FileCheck")
return()
endif()
set(ENABLE_ASSEMBLY_TESTS_DEFAULT ON PARENT_SCOPE)
endfunction()
should_enable_assembly_tests()
# This option disables the building and running of the assembly verification tests
option(BENCHMARK_ENABLE_ASSEMBLY_TESTS "Enable building and running the assembly tests"
${ENABLE_ASSEMBLY_TESTS_DEFAULT})
# Make sure we can import out CMake functions
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Read the git tags to determine the project version
include(GetGitVersion)
get_git_version(GIT_VERSION)
# Tell the user what versions we are using
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION ${GIT_VERSION})
message(STATUS "Version: ${VERSION}")
# The version of the libraries
set(GENERIC_LIB_VERSION ${VERSION})
string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION)
# Import our CMake modules
include(CheckCXXCompilerFlag)
include(AddCXXCompilerFlag)
include(CXXFeatureCheck)
if (BENCHMARK_BUILD_32_BITS)
add_required_cxx_compiler_flag(-m32)
endif()
if (MSVC)
# Turn compiler warnings up to 11
string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
add_cxx_compiler_flag(-EHs-)
add_cxx_compiler_flag(-EHa-)
add_definitions(-D_HAS_EXCEPTIONS=0)
endif()
# Link time optimisation
if (BENCHMARK_ENABLE_LTO)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO}")
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /GL")
set(CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL "${CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL} /LTCG")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG")
endif()
else()
# Try and enable C++11. Don't use C++14 because it doesn't work in some
# configurations.
add_cxx_compiler_flag(-std=c++11)
if (NOT HAVE_CXX_FLAG_STD_CXX11)
add_cxx_compiler_flag(-std=c++0x)
endif()
# Turn compiler warnings up to 11
add_cxx_compiler_flag(-Wall)
add_cxx_compiler_flag(-Wextra)
add_cxx_compiler_flag(-Wshadow)
add_cxx_compiler_flag(-Werror RELEASE)
add_cxx_compiler_flag(-Werror RELWITHDEBINFO)
add_cxx_compiler_flag(-Werror MINSIZEREL)
# Disabled until googletest (gmock) stops emitting variadic macro warnings
#add_cxx_compiler_flag(-pedantic)
#add_cxx_compiler_flag(-pedantic-errors)
add_cxx_compiler_flag(-Wshorten-64-to-32)
add_cxx_compiler_flag(-fstrict-aliasing)
# Disable warnings regarding deprecated parts of the library while building
# and testing those parts of the library.
add_cxx_compiler_flag(-Wno-deprecated-declarations)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# Intel silently ignores '-Wno-deprecated-declarations',
# warning no. 1786 must be explicitly disabled.
# See #631 for rationale.
add_cxx_compiler_flag(-wd1786)
endif()
# Disable deprecation warnings for release builds (when -Werror is enabled).
add_cxx_compiler_flag(-Wno-deprecated RELEASE)
add_cxx_compiler_flag(-Wno-deprecated RELWITHDEBINFO)
add_cxx_compiler_flag(-Wno-deprecated MINSIZEREL)
if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
add_cxx_compiler_flag(-fno-exceptions)
endif()
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing
add_cxx_compiler_flag(-Wstrict-aliasing)
endif()
endif()
# ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden
# (because of deprecated overload)
add_cxx_compiler_flag(-wd654)
add_cxx_compiler_flag(-Wthread-safety)
if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
endif()
# On most UNIX like platforms g++ and clang++ define _GNU_SOURCE as a
# predefined macro, which turns on all of the wonderful libc extensions.
# However g++ doesn't do this in Cygwin so we have to define it ourselfs
# since we depend on GNU/POSIX/BSD extensions.
if (CYGWIN)
add_definitions(-D_GNU_SOURCE=1)
endif()
if (QNXNTO)
add_definitions(-D_QNX_SOURCE)
endif()
# Link time optimisation
if (BENCHMARK_ENABLE_LTO)
add_cxx_compiler_flag(-flto)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
find_program(GCC_AR gcc-ar)
if (GCC_AR)
set(CMAKE_AR ${GCC_AR})
endif()
find_program(GCC_RANLIB gcc-ranlib)
if (GCC_RANLIB)
set(CMAKE_RANLIB ${GCC_RANLIB})
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
include(llvm-toolchain)
endif()
endif()
# Coverage build type
set(BENCHMARK_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}"
CACHE STRING "Flags used by the C++ compiler during coverage builds."
FORCE)
set(BENCHMARK_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used for linking binaries during coverage builds."
FORCE)
set(BENCHMARK_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
FORCE)
mark_as_advanced(
BENCHMARK_CXX_FLAGS_COVERAGE
BENCHMARK_EXE_LINKER_FLAGS_COVERAGE
BENCHMARK_SHARED_LINKER_FLAGS_COVERAGE)
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage.")
add_cxx_compiler_flag(--coverage COVERAGE)
endif()
if (BENCHMARK_USE_LIBCXX)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_cxx_compiler_flag(-stdlib=libc++)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
add_cxx_compiler_flag(-nostdinc++)
message(WARNING "libc++ header path must be manually specified using CMAKE_CXX_FLAGS")
# Adding -nodefaultlibs directly to CMAKE_<TYPE>_LINKER_FLAGS will break
# configuration checks such as 'find_package(Threads)'
list(APPEND BENCHMARK_CXX_LINKER_FLAGS -nodefaultlibs)
# -lc++ cannot be added directly to CMAKE_<TYPE>_LINKER_FLAGS because
# linker flags appear before all linker inputs and -lc++ must appear after.
list(APPEND BENCHMARK_CXX_LIBRARIES c++)
else()
message(FATAL_ERROR "-DBENCHMARK_USE_LIBCXX:BOOL=ON is not supported for compiler")
endif()
endif(BENCHMARK_USE_LIBCXX)
# C++ feature checks
# Determine the correct regular expression engine to use
cxx_feature_check(STD_REGEX)
cxx_feature_check(GNU_POSIX_REGEX)
cxx_feature_check(POSIX_REGEX)
if(NOT HAVE_STD_REGEX AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
endif()
if (NOT BENCHMARK_ENABLE_EXCEPTIONS AND HAVE_STD_REGEX
AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
message(WARNING "Using std::regex with exceptions disabled is not fully supported")
endif()
cxx_feature_check(STEADY_CLOCK)
# Ensure we have pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# Set up directories
include_directories(${PROJECT_SOURCE_DIR}/include)
# Build the targets
add_subdirectory(src)
if (BENCHMARK_ENABLE_TESTING)
enable_testing()
if (BENCHMARK_ENABLE_GTEST_TESTS AND
NOT (TARGET gtest AND TARGET gtest_main AND
TARGET gmock AND TARGET gmock_main))
include(GoogleTest)
endif()
add_subdirectory(test)
endif()

View File

@ -0,0 +1,58 @@
# How to contribute #
We'd love to accept your patches and contributions to this project. There are
a just a few small guidelines you need to follow.
## Contributor License Agreement ##
Contributions to any Google project must be accompanied by a Contributor
License Agreement. This is not a copyright **assignment**, it simply gives
Google permission to use and redistribute your contributions as part of the
project.
* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual
CLA][].
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA][].
You generally only need to submit a CLA once, so if you've already submitted
one (even if it was for a different project), you probably don't need to do it
again.
[individual CLA]: https://developers.google.com/open-source/cla/individual
[corporate CLA]: https://developers.google.com/open-source/cla/corporate
Once your CLA is submitted (or if you already submitted one for
another Google project), make a commit adding yourself to the
[AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part
of your first [pull request][].
[AUTHORS]: AUTHORS
[CONTRIBUTORS]: CONTRIBUTORS
## Submitting a patch ##
1. It's generally best to start by opening a new issue describing the bug or
feature you're intending to fix. Even if you think it's relatively minor,
it's helpful to know what people are working on. Mention in the initial
issue that you are planning to work on that bug or feature so that it can
be assigned to you.
1. Follow the normal process of [forking][] the project, and setup a new
branch to work in. It's important that each group of changes be done in
separate branches in order to ensure that a pull request only includes the
commits related to that bug or feature.
1. Do your best to have [well-formed commit messages][] for each change.
This provides consistency throughout the project, and ensures that commit
messages are able to be formatted properly by various git tools.
1. Finally, push the commits to your fork and submit a [pull request][].
[forking]: https://help.github.com/articles/fork-a-repo
[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pull request]: https://help.github.com/articles/creating-a-pull-request

View File

@ -0,0 +1,78 @@
# People who have agreed to one of the CLAs and can contribute patches.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# Names should be added to this file only after verifying that
# the individual or the individual's organization has agreed to
# the appropriate Contributor License Agreement, found here:
#
# https://developers.google.com/open-source/cla/individual
# https://developers.google.com/open-source/cla/corporate
#
# The agreement for individuals can be filled out on the web.
#
# When adding J Random Contributor's name to this file,
# either J's name or J's organization's name should be
# added to the AUTHORS file, depending on whether the
# individual or corporate CLA was used.
#
# Names should be added to this file as:
# Name <email address>
#
# Please keep the list sorted.
Albert Pretorius <pretoalb@gmail.com>
Alex Steele <steelal123@gmail.com>
Andriy Berestovskyy <berestovskyy@gmail.com>
Arne Beer <arne@twobeer.de>
Billy Robert O'Neal III <billy.oneal@gmail.com> <bion@microsoft.com>
Chris Kennelly <ckennelly@google.com> <ckennelly@ckennelly.com>
Christopher Seymour <chris.j.seymour@hotmail.com>
Colin Braley <braley.colin@gmail.com>
Cyrille Faucheux <cyrille.faucheux@gmail.com>
Daniel Harvey <danielharvey458@gmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Deniz Evrenci <denizevrenci@gmail.com>
Dominic Hamon <dma@stripysock.com> <dominic@google.com>
Dominik Czarnota <dominik.b.czarnota@gmail.com>
Eric Backus <eric_backus@alum.mit.edu>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
Federico Ficarelli <federico.ficarelli@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Geoffrey Martin-Noble <gcmn@google.com> <gmngeoffrey@gmail.com>
Gergő Szitár <szitar.gergo@gmail.com>
Hannes Hauswedell <h2@fsfe.org>
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Jern-Kuan Leong <jernkuan@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
John Millikin <jmillikin@stripe.com>
Jordan Williams <jwillikers@protonmail.com>
Jussi Knuuttila <jussi.knuuttila@gmail.com>
Kai Wolf <kai.wolf@gmail.com>
Kaito Udagawa <umireon@gmail.com>
Kishan Kumar <kumar.kishan@outlook.com>
Lei Xu <eddyxu@gmail.com>
Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com>
Nick Hutchinson <nshutchinson@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Ori Livneh <ori.livneh@gmail.com>
Pascal Leroy <phl@google.com>
Paul Redmond <paul.redmond@gmail.com>
Pierre Phaneuf <pphaneuf@google.com>
Radoslav Yovchev <radoslav.tm@gmail.com>
Raul Marin <rmrodriguez@cartodb.com>
Ray Glover <ray.glover@uk.ibm.com>
Robert Guo <robert.guo@mongodb.com>
Roman Lebedev <lebedev.ri@gmail.com>
Sayan Bhattacharjee <aero.sayan@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
Tobias Ulvgård <tobias.ulvgard@dirac.se>
Tom Madams <tom.ej.madams@gmail.com> <tmadams@google.com>
Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com>

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
workspace(name = "com_github_google_benchmark")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_cc",
strip_prefix = "rules_cc-a508235df92e71d537fcbae0c7c952ea6957a912",
urls = ["https://github.com/bazelbuild/rules_cc/archive/a508235df92e71d537fcbae0c7c952ea6957a912.zip"],
)
http_archive(
name = "com_google_googletest",
strip_prefix = "googletest-3f0cf6b62ad1eb50d8736538363d3580dd640c3e",
urls = ["https://github.com/google/googletest/archive/3f0cf6b62ad1eb50d8736538363d3580dd640c3e.zip"],
)
http_archive(
name = "pybind11",
build_file = "@//bindings/python:pybind11.BUILD",
sha256 = "1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d",
strip_prefix = "pybind11-2.4.3",
urls = ["https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz"],
)
new_local_repository(
name = "python_headers",
build_file = "@//bindings/python:python_headers.BUILD",
path = "/usr/include/python3.6", # May be overwritten by setup.py.
)

View File

@ -0,0 +1 @@
theme: jekyll-theme-midnight

View File

@ -0,0 +1,50 @@
version: '{build}'
image: Visual Studio 2017
configuration:
- Debug
- Release
environment:
matrix:
- compiler: msvc-15-seh
generator: "Visual Studio 15 2017"
- compiler: msvc-15-seh
generator: "Visual Studio 15 2017 Win64"
- compiler: msvc-14-seh
generator: "Visual Studio 14 2015"
- compiler: msvc-14-seh
generator: "Visual Studio 14 2015 Win64"
- compiler: gcc-5.3.0-posix
generator: "MinGW Makefiles"
cxx_path: 'C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
matrix:
fast_finish: true
install:
# git bash conflicts with MinGW makefiles
- if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%")
- if not "%cxx_path%"=="" (set "PATH=%PATH%;%cxx_path%")
build_script:
- md _build -Force
- cd _build
- echo %configuration%
- cmake -G "%generator%" "-DCMAKE_BUILD_TYPE=%configuration%" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON ..
- cmake --build . --config %configuration%
test_script:
- ctest --build-config %configuration% --timeout 300 --output-on-failure
artifacts:
- path: '_build/CMakeFiles/*.log'
name: logs
- path: '_build/Testing/**/*.xml'
name: test_results

View File

@ -0,0 +1,62 @@
# Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Python benchmarking utilities.
Example usage:
import benchmark
@benchmark.register
def my_benchmark(state):
... # Code executed outside `while` loop is not timed.
while state:
... # Code executed within `while` loop is timed.
if __name__ == '__main__':
benchmark.main()
"""
from absl import app
from benchmark import _benchmark
__all__ = [
"register",
"main",
]
__version__ = "0.1.0"
def register(f=None, *, name=None):
if f is None:
return lambda f: register(f, name=name)
if name is None:
name = f.__name__
_benchmark.RegisterBenchmark(name, f)
return f
def _flags_parser(argv):
argv = _benchmark.Initialize(argv)
return app.parse_flags_with_usage(argv)
def _run_benchmarks(argv):
if len(argv) > 1:
raise app.UsageError('Too many command-line arguments.')
return _benchmark.RunSpecifiedBenchmarks()
def main(argv=None):
return app.run(_run_benchmarks, argv=argv, flags_parser=_flags_parser)

View File

@ -0,0 +1,47 @@
// Benchmark for Python.
#include "benchmark/benchmark.h"
#include "pybind11/pybind11.h"
#include "pybind11/stl.h"
namespace {
namespace py = ::pybind11;
std::vector<std::string> Initialize(const std::vector<std::string>& argv) {
// The `argv` pointers here become invalid when this function returns, but
// benchmark holds the pointer to `argv[0]`. We create a static copy of it
// so it persists, and replace the pointer below.
static std::string executable_name(argv[0]);
std::vector<char*> ptrs;
ptrs.reserve(argv.size());
for (auto& arg : argv) {
ptrs.push_back(const_cast<char*>(arg.c_str()));
}
ptrs[0] = const_cast<char*>(executable_name.c_str());
int argc = static_cast<int>(argv.size());
benchmark::Initialize(&argc, ptrs.data());
std::vector<std::string> remaining_argv;
remaining_argv.reserve(argc);
for (int i = 0; i < argc; ++i) {
remaining_argv.emplace_back(ptrs[i]);
}
return remaining_argv;
}
void RegisterBenchmark(const char* name, py::function f) {
benchmark::RegisterBenchmark(name, [f](benchmark::State& state) {
f(&state);
});
}
PYBIND11_MODULE(_benchmark, m) {
m.def("Initialize", Initialize);
m.def("RegisterBenchmark", RegisterBenchmark);
m.def("RunSpecifiedBenchmarks",
[]() { benchmark::RunSpecifiedBenchmarks(); });
py::class_<benchmark::State>(m, "State")
.def("__bool__", &benchmark::State::KeepRunning)
.def_property_readonly("keep_running", &benchmark::State::KeepRunning);
};
} // namespace

View File

@ -0,0 +1,32 @@
# Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Example of Python using C++ benchmark framework."""
import benchmark
@benchmark.register
def empty(state):
while state:
pass
@benchmark.register
def sum_million(state):
while state:
sum(range(1_000_000))
if __name__ == '__main__':
benchmark.main()

View File

@ -0,0 +1,25 @@
_SHARED_LIB_SUFFIX = {
"//conditions:default": ".so",
"//:windows": ".dll",
}
def py_extension(name, srcs, hdrs = [], copts = [], features = [], deps = []):
for shared_lib_suffix in _SHARED_LIB_SUFFIX.values():
shared_lib_name = name + shared_lib_suffix
native.cc_binary(
name = shared_lib_name,
linkshared = 1,
linkstatic = 1,
srcs = srcs + hdrs,
copts = copts,
features = features,
deps = deps,
)
return native.py_library(
name = name,
data = select({
platform: [name + shared_lib_suffix]
for platform, shared_lib_suffix in _SHARED_LIB_SUFFIX.items()
}),
)

View File

@ -0,0 +1,20 @@
cc_library(
name = "pybind11",
hdrs = glob(
include = [
"include/pybind11/*.h",
"include/pybind11/detail/*.h",
],
exclude = [
"include/pybind11/common.h",
"include/pybind11/eigen.h",
],
),
copts = [
"-fexceptions",
"-Wno-undefined-inline",
"-Wno-pragma-once-outside-header",
],
includes = ["include"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,6 @@
cc_library(
name = "python_headers",
hdrs = glob(["**/*.h"]),
includes = ["."],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,2 @@
absl-py>=0.7.1

View File

@ -0,0 +1,74 @@
# - Adds a compiler flag if it is supported by the compiler
#
# This function checks that the supplied compiler flag is supported and then
# adds it to the corresponding compiler flags
#
# add_cxx_compiler_flag(<FLAG> [<VARIANT>])
#
# - Example
#
# include(AddCXXCompilerFlag)
# add_cxx_compiler_flag(-Wall)
# add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
# Requires CMake 2.6+
if(__add_cxx_compiler_flag)
return()
endif()
set(__add_cxx_compiler_flag INCLUDED)
include(CheckCXXCompilerFlag)
function(mangle_compiler_flag FLAG OUTPUT)
string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
set(${OUTPUT} "${SANITIZED_FLAG}" PARENT_SCOPE)
endfunction(mangle_compiler_flag)
function(add_cxx_compiler_flag FLAG)
mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
if(${MANGLED_FLAG})
set(VARIANT ${ARGV1})
if(ARGV1)
string(TOUPPER "_${VARIANT}" VARIANT)
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${BENCHMARK_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
endfunction()
function(add_required_cxx_compiler_flag FLAG)
mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
if(${MANGLED_FLAG})
set(VARIANT ${ARGV1})
if(ARGV1)
string(TOUPPER "_${VARIANT}" VARIANT)
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}" PARENT_SCOPE)
else()
message(FATAL_ERROR "Required flag '${FLAG}' is not supported by the compiler")
endif()
endfunction()
function(check_cxx_warning_flag FLAG)
mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
# Add -Werror to ensure the compiler generates an error if the warning flag
# doesn't exist.
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror ${FLAG}")
check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
endfunction()

View File

@ -0,0 +1,64 @@
# - Compile and run code to check for C++ features
#
# This functions compiles a source file under the `cmake` folder
# and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
# environment
#
# cxx_feature_check(<FLAG> [<VARIANT>])
#
# - Example
#
# include(CXXFeatureCheck)
# cxx_feature_check(STD_REGEX)
# Requires CMake 2.8.12+
if(__cxx_feature_check)
return()
endif()
set(__cxx_feature_check INCLUDED)
function(cxx_feature_check FILE)
string(TOLOWER ${FILE} FILE)
string(TOUPPER ${FILE} VAR)
string(TOUPPER "HAVE_${VAR}" FEATURE)
if (DEFINED HAVE_${VAR})
set(HAVE_${VAR} 1 PARENT_SCOPE)
add_definitions(-DHAVE_${VAR})
return()
endif()
if (NOT DEFINED COMPILE_${FEATURE})
message(STATUS "Performing Test ${FEATURE}")
if(CMAKE_CROSSCOMPILING)
try_compile(COMPILE_${FEATURE}
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}
LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES})
if(COMPILE_${FEATURE})
message(WARNING
"If you see build failures due to cross compilation, try setting HAVE_${VAR} to 0")
set(RUN_${FEATURE} 0 CACHE INTERNAL "")
else()
set(RUN_${FEATURE} 1 CACHE INTERNAL "")
endif()
else()
message(STATUS "Performing Test ${FEATURE}")
try_run(RUN_${FEATURE} COMPILE_${FEATURE}
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}
LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES})
endif()
endif()
if(RUN_${FEATURE} EQUAL 0)
message(STATUS "Performing Test ${FEATURE} -- success")
set(HAVE_${VAR} 1 PARENT_SCOPE)
add_definitions(-DHAVE_${VAR})
else()
if(NOT COMPILE_${FEATURE})
message(STATUS "Performing Test ${FEATURE} -- failed to compile")
else()
message(STATUS "Performing Test ${FEATURE} -- compiled but failed to run")
endif()
endif()
endfunction()

View File

@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")

View File

@ -0,0 +1,54 @@
# - Returns a version string from Git tags
#
# This function inspects the annotated git tags for the project and returns a string
# into a CMake variable
#
# get_git_version(<var>)
#
# - Example
#
# include(GetGitVersion)
# get_git_version(GIT_VERSION)
#
# Requires CMake 2.8.11+
find_package(Git)
if(__get_git_version)
return()
endif()
set(__get_git_version INCLUDED)
function(get_git_version var)
if(GIT_EXECUTABLE)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE status
OUTPUT_VARIABLE GIT_VERSION
ERROR_QUIET)
if(${status})
set(GIT_VERSION "v0.0.0")
else()
string(STRIP ${GIT_VERSION} GIT_VERSION)
string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION})
endif()
# Work out if the repository is dirty
execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_QUIET
ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DIFF_INDEX
ERROR_QUIET)
string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY)
if (${GIT_DIRTY})
set(GIT_VERSION "${GIT_VERSION}-dirty")
endif()
else()
set(GIT_VERSION "v0.0.0")
endif()
message(STATUS "git Version: ${GIT_VERSION}")
set(${var} ${GIT_VERSION} PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,41 @@
# Download and unpack googletest at configure time
set(GOOGLETEST_PREFIX "${benchmark_BINARY_DIR}/third_party/googletest")
configure_file(${benchmark_SOURCE_DIR}/cmake/GoogleTest.cmake.in ${GOOGLETEST_PREFIX}/CMakeLists.txt @ONLY)
set(GOOGLETEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/googletest" CACHE PATH "") # Mind the quotes
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-DALLOW_DOWNLOADING_GOOGLETEST=${BENCHMARK_DOWNLOAD_DEPENDENCIES} -DGOOGLETEST_PATH:PATH=${GOOGLETEST_PATH} .
RESULT_VARIABLE result
WORKING_DIRECTORY ${GOOGLETEST_PREFIX}
)
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${GOOGLETEST_PREFIX}
)
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)
# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${GOOGLETEST_SOURCE_DIR}
${GOOGLETEST_BINARY_DIR}
EXCLUDE_FROM_ALL)
set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest,INTERFACE_INCLUDE_DIRECTORIES>)
set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest_main,INTERFACE_INCLUDE_DIRECTORIES>)
set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock,INTERFACE_INCLUDE_DIRECTORIES>)
set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock_main,INTERFACE_INCLUDE_DIRECTORIES>)

View File

@ -0,0 +1,58 @@
cmake_minimum_required(VERSION 2.8.12)
project(googletest-download NONE)
# Enable ExternalProject CMake module
include(ExternalProject)
option(ALLOW_DOWNLOADING_GOOGLETEST "If googletest src tree is not found in location specified by GOOGLETEST_PATH, do fetch the archive from internet" OFF)
set(GOOGLETEST_PATH "/usr/src/googletest" CACHE PATH
"Path to the googletest root tree. Should contain googletest and googlemock subdirs. And CMakeLists.txt in root, and in both of these subdirs")
# Download and install GoogleTest
message(STATUS "Looking for Google Test sources")
message(STATUS "Looking for Google Test sources in ${GOOGLETEST_PATH}")
if(EXISTS "${GOOGLETEST_PATH}" AND IS_DIRECTORY "${GOOGLETEST_PATH}" AND EXISTS "${GOOGLETEST_PATH}/CMakeLists.txt" AND
EXISTS "${GOOGLETEST_PATH}/googletest" AND IS_DIRECTORY "${GOOGLETEST_PATH}/googletest" AND EXISTS "${GOOGLETEST_PATH}/googletest/CMakeLists.txt" AND
EXISTS "${GOOGLETEST_PATH}/googlemock" AND IS_DIRECTORY "${GOOGLETEST_PATH}/googlemock" AND EXISTS "${GOOGLETEST_PATH}/googlemock/CMakeLists.txt")
message(STATUS "Found Google Test in ${GOOGLETEST_PATH}")
ExternalProject_Add(
googletest
PREFIX "${CMAKE_BINARY_DIR}"
DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/download"
SOURCE_DIR "${GOOGLETEST_PATH}" # use existing src dir.
BINARY_DIR "${CMAKE_BINARY_DIR}/build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
else()
if(NOT ALLOW_DOWNLOADING_GOOGLETEST)
message(SEND_ERROR "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.")
else()
message(WARNING "Did not find Google Test sources! Fetching from web...")
ExternalProject_Add(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
PREFIX "${CMAKE_BINARY_DIR}"
STAMP_DIR "${CMAKE_BINARY_DIR}/stamp"
DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/download"
SOURCE_DIR "${CMAKE_BINARY_DIR}/src"
BINARY_DIR "${CMAKE_BINARY_DIR}/build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
endif()
endif()
ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR)
file(WRITE googletest-paths.cmake
"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\")
set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\")
")

View File

@ -0,0 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: @PROJECT_NAME@
Description: Google microbenchmark framework
Version: @VERSION@
Libs: -L${libdir} -lbenchmark
Libs.private: -lpthread
Cflags: -I${includedir}

View File

@ -0,0 +1,12 @@
#include <gnuregex.h>
#include <string>
int main() {
std::string str = "test0159";
regex_t re;
int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
if (ec != 0) {
return ec;
}
return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
}

View File

@ -0,0 +1,8 @@
find_package(LLVMAr REQUIRED)
set(CMAKE_AR "${LLVMAR_EXECUTABLE}" CACHE FILEPATH "" FORCE)
find_package(LLVMNm REQUIRED)
set(CMAKE_NM "${LLVMNM_EXECUTABLE}" CACHE FILEPATH "" FORCE)
find_package(LLVMRanLib REQUIRED)
set(CMAKE_RANLIB "${LLVMRANLIB_EXECUTABLE}" CACHE FILEPATH "" FORCE)

View File

@ -0,0 +1,14 @@
#include <regex.h>
#include <string>
int main() {
std::string str = "test0159";
regex_t re;
int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
if (ec != 0) {
return ec;
}
int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
regfree(&re);
return ret;
}

View File

@ -0,0 +1,3 @@
macro(split_list listname)
string(REPLACE ";" " " ${listname} "${${listname}}")
endmacro()

View File

@ -0,0 +1,10 @@
#include <regex>
#include <string>
int main() {
const std::string str = "test0159";
std::regex re;
re = std::regex("^[a-z]+[0-9]+$",
std::regex_constants::extended | std::regex_constants::nosubs);
return std::regex_search(str, re) ? 0 : -1;
}

View File

@ -0,0 +1,7 @@
#include <chrono>
int main() {
typedef std::chrono::steady_clock Clock;
Clock::time_point tp = Clock::now();
((void)tp);
}

View File

@ -0,0 +1,4 @@
#define HAVE_THREAD_SAFETY_ATTRIBUTES
#include "../src/mutex.h"
int main() {}

View File

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.11)
project(cmake_wrapper)
include(conanbuildinfo.cmake)
conan_basic_setup()
include(${CMAKE_SOURCE_DIR}/CMakeListsOriginal.txt)

Some files were not shown because too many files have changed in this diff Show More