Skip to content

Commit

Permalink
v1.200 修改累積問題
Browse files Browse the repository at this point in the history
  • Loading branch information
ButTaiwan committed Jun 3, 2021
1 parent 782cdc8 commit 3f91841
Show file tree
Hide file tree
Showing 68 changed files with 18,798 additions and 112 deletions.
4 changes: 2 additions & 2 deletions f_bpmfgen.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ime/BpmfZihiKaiStd-Regular.ttf
Binary file not shown.
File renamed without changes.
12 changes: 6 additions & 6 deletions ime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

本詞庫目前原則上收錄《國語一字多音審訂表(初稿)》的讀音。

## 字典
## 查字典

在按下 「開始」 後的編輯模式中,點選右下角 「字典」 可開啟 《國語字典簡編本》 輔助查詢字義及標準讀音
請用滑鼠點擊或圈選任意字詞,字典工具會即時顯示查詢結果。
在按下 「開始」 後的編輯模式中,點選右下角 「字典」 可開啟 《國語字典簡編本》 輔助查詢字義與教育部標準讀音
請用滑鼠點擊或選取任意字詞,字典工具會即時顯示查詢結果。

## 協作邀請 (詞庫)

Expand Down Expand Up @@ -63,14 +63,14 @@ poyin_db.txt 收錄了所有 phonetic/phonic_table_Z.txt 裡所有多音字的

例如目前版本對於「一」、「不」等變音字也只能靠詞庫窮舉,或許可以讀入完整讀音檔案,從下一個字的聲調去判斷等等。

另外,本注音字型規格其實還有提供U+E01E0異體,可顯示為不帶注音符號(只有國字部分)。不過此輸入工具目前也未支援選擇這個模式
另外,本注音字型規格其實還有提供U+E01E0異體,可顯示為不帶注音符號(只有國字部分)。不過此輸入工具目前尚未支援選擇這個模式

## 協作邀請 (字典)

本工具字典檔資料來自於教育部國語辭典公眾授權網 《<a href="https://language.moe.gov.tw/001/Upload/Files/site_content/M0001/respub/dict_concised_download.html">國語辭典簡編本</a>》,採用 CC BY-ND 3.0 授權。

字典工具來自開源的字典架構 <a href="https://github.com/jeffreyxuan/ToneOZDic">ToneOZ 澳聲通字典</a> ,採用 MIT 授權。 此字典工具支援使用者自行製作字典檔,請參考 <a href="https://github.com/jeffreyxuan/ToneOZDic/blob/main/README.md">ToneOZ Dictionary 字典檔生成器使用說明</a>

字典工具來自開源的字典架構 <a href="https://github.com/jeffreyxuan/ToneOZDic">ToneOZ 澳聲通字典</a>,採用 MIT 授權。
此字典工具支援使用者自行製作字典檔,請參考 <a href="https://github.com/jeffreyxuan/ToneOZDic/blob/main/README.md">ToneOZ Dictionary 字典檔生成器使用說明</a>。


歡迎 Pull Request,或自行 fork 新專案。
8 changes: 7 additions & 1 deletion ime/ime.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ var curr = -1;
var vsbase = 0xe01e0;
window.textinfo = {};

String.prototype.unicharAt = function (i) {
if (this.charAt(i).match(/[\ud800-\udb7f]/)) return this.substr(i, 2);
return this.charAt(i);
};

function chr(uni) {
if (String.fromCodePoint) return String.fromCodePoint(uni); // ES6
if (uni <= 0xffff) return String.fromCharCode(uni);
Expand Down Expand Up @@ -111,7 +116,8 @@ function setEditorText(t) {

// [\ud800-\udfff] means surrogate pairs of UTF-16
// Here I wrote /(.|\n)/g because MS Edge doesn't support /(.)/s.
text = t.replace(/(.|\n)/g, "\x01$1").replace(/\x01([\ud800-\udfff])/g, "$1").split(/\x01/);
//text = t.replace(/(.|\n)/g, "\x01$1").replace(/\x01([\ud800-\udfff])/g, "$1").split(/\x01/);
text = t.replace(/(.|\n)/g, "\x01$1").replace(/\x01([\udb40\udc00-\udfff])/g, "$1").split(/\x01/);
textinfo = {};

var editor = $('#editor');
Expand Down
40 changes: 38 additions & 2 deletions ime/poyin_db.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,11 +1365,12 @@ var data = {
"s": 4
},
"參": {
"s": 3,
"s": 4,
"v": [
"*觀/*考/*加",
"*商/人*",
"*差"
"*差",
""
]
},
"叅": {
Expand Down Expand Up @@ -4686,6 +4687,13 @@ var data = {
"杬": {
"s": 2
},
"杷": {
"s": 2,
"v": [
"",
"枇*"
]
},
"杺": {
"s": 2
},
Expand Down Expand Up @@ -6456,6 +6464,13 @@ var data = {
"瘥": {
"s": 2
},
"瘩": {
"s": 2,
"v": [
"",
"疙*"
]
},
"瘶": {
"s": 2
},
Expand Down Expand Up @@ -8034,6 +8049,13 @@ var data = {
"萁": {
"s": 2
},
"萄": {
"s": 2,
"v": [
"",
"葡*"
]
},
"萆": {
"s": 2
},
Expand Down Expand Up @@ -8398,6 +8420,13 @@ var data = {
"蚆": {
"s": 2
},
"蚋": {
"s": 2,
"v": [
"",
"加*"
]
},
"蚔": {
"s": 2
},
Expand Down Expand Up @@ -9542,6 +9571,13 @@ var data = {
"遡": {
"s": 2
},
"遢": {
"s": 2,
"v": [
"",
"邋*"
]
},
"適": {
"s": 2,
"v": [
Expand Down
11 changes: 11 additions & 0 deletions ime/poyin_db.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
[參] ㄘㄢ *觀/*考/*加
[參] ㄕㄣ *商/人*
[參] ㄘㄣ *差
[參] ㄙㄢ
[叔] ㄕㄨˊ
[叔] ˙ㄕㄨ 叔*
[句] ㄐㄩˋ *子/*型/造*/問*
Expand Down Expand Up @@ -654,6 +655,8 @@
[朵] ˙ㄉㄨㄛ 耳*
[杓] ㄕㄠˊ
[杓] ㄅㄧㄠ 斗*
[杷] ㄆㄚˊ
[杷] ˙ㄆㄚ 枇*
[枓] ㄉㄡˇ
[枓] ㄓㄨˇ
[枕] ㄓㄣˇ
Expand Down Expand Up @@ -865,6 +868,8 @@
[畬] ㄩˊ 菑*
[當] ㄉㄤ *年/*然/*心/*時/*代/*作/*選/*權/*機
[當] ㄉㄤˋ *鋪/勾*/適*/穩*/*舖/妥*/洽*/典*/被*/死*/不*
[瘩] ㄉㄚˊ
[瘩] ˙ㄉㄚ 疙*
[癟] ㄅㄧㄝˇ 乾*
[癟] ㄅㄧㄝ *三
[百] ㄅㄞˇ
Expand Down Expand Up @@ -1038,6 +1043,8 @@
[華] ㄏㄨㄚˋ *山
[菲] ㄈㄟ 芳*/**/*律賓
[菲] ㄈㄟˇ *薄/*食
[萄] ㄊㄠˊ
[萄] ˙ㄊㄠ 葡*
[落] ㄌㄨㄛˋ *下/*地/降*
[落] ㄌㄚˋ *了/*在/*掉/*四
[落] ㄌㄠˋ *枕/蓮花*
Expand Down Expand Up @@ -5012,6 +5019,8 @@
[蚄] ㄅㄤˋ
[蚆] ㄆㄚ
[蚆] ㄅㄚ
[蚋] ㄖㄨㄟˋ
[蚋] ㄌㄚˋ 加*
[蚔] ㄔˊ
[蚔] ㄑㄧˊ
[蚙] ㄑㄧㄢˊ
Expand Down Expand Up @@ -5587,6 +5596,8 @@
[遟] ㄓˋ
[遡] ㄙㄨㄛˋ
[遡] ㄙㄨˋ
[遢] ㄊㄚˋ
[遢] ˙ㄊㄚ 邋*
[遫] ㄙㄨˋ
[遫] ㄔˋ
[遻] ㄨˋ
Expand Down
20 changes: 4 additions & 16 deletions ime/tzdic/tzdic.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,10 @@
<meta charset="utf-8">
<title>ToneOZ 澳聲通字典</title>
<style>
body{
color:#fff;
background-image: linear-gradient(45deg, rgba(16, 16, 16, 0.7) 0%, rgba(0,0,0,0.9) 40%,rgba(16,16,16,0.7) 100%);
}
.diccard{
padding: 5px 0 5px 0;
border-bottom:2px solid #fff;
}
.dicq{
font-size:2em;
}
.dicz{
font-size:1.5em;
background-color:#ddd;
color:#000;
}
body{ color:#fff; background-image: linear-gradient(45deg, rgba(16, 16, 16, 0.7) 0%, rgba(0,0,0,0.9) 40%,rgba(16,16,16,0.7) 100%); }
.diccard { padding: 5px 0 5px 0; border-bottom:2px solid #fff; }
.dicq { font-size: 2em; }
.dicz { font-size: 1.5em; background-color:#ddd; color:#000; padding: 0 5px }
</style>
<script src="tzlib/jquery.min.js"></script>
<script src="tzlib/tzdicentry.js" charset="utf-8"></script>
Expand Down
45 changes: 23 additions & 22 deletions ime/zhdicui.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ const cssUI =
+ ".dicWinTitle {padding:5px;display:inline-block;width:100%;cursor: pointer;user-select: none;} "
+ ".dicWinDesc {position: absolute;width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;} "
;
const pathCssDic = "../zihaidic";
const pathJsIVSLookup = "../zhuivsdic";
const pathCssDic = '../zihaidic';
const pathJsIVSLookup = '../zhuivsdic';
const strVer="";
const intMaxPhrase = 16;
// End CONFIG======

String.prototype.unicharAt = function (i) {
if (this.charAt(i).match(/[\ud800-\udb7f]/)) return this.substr(i, 2);
return this.charAt(i);
};

$(document).ready(function () {
// ZiHaiDicUI init
let zhDic = new ZiHaiDicUI();
Expand Down Expand Up @@ -64,11 +69,11 @@ function ZiHaiDicUI(){
if(srcObj && !selectedString){
let currDataI = srcObj.attr("data-i");
if(currDataI !== undefined){
currDataI = parseInt(currDataI);
currDataI = currDataI*1;
phrases = [];
let content = srcObj.text();
let ivsinfo = textinfo[currDataI];
if(ivsinfo){
if (ivsinfo) {
let phrasearr = ivsinfo.phrasearr;
for(let ip in phrasearr){
let phrase = phrasearr[ip].phrase;
Expand All @@ -79,13 +84,13 @@ function ZiHaiDicUI(){
}
}
}
if(content && phrases.length < intMaxPhrase){
phrases.push(content.charAt(0));
if (content && phrases.length < intMaxPhrase){
phrases.push(content.unicharAt(0));
}
}
} else if(selectedString){
selectedString = selectedString.substr(0,intMaxPhrase-1);
let selectedArr = selectedString.split("");
selectedString = selectedString.substr(0, intMaxPhrase-1);
let selectedArr = selectedString.replace(/(.|\n)/g, "\x01$1").replace(/\x01([\udb40\udc00-\udfff])/g, "$1").split(/\x01/);
if(selectedArr.length > 1){
selectedArr.unshift(selectedString);
}
Expand All @@ -95,9 +100,7 @@ function ZiHaiDicUI(){
isIframeReady = false;
}

return {
phrases:phrases
};
return {phrases: phrases};
}

function getIVSPhrase(param){
Expand Down Expand Up @@ -196,16 +199,15 @@ function ZiHaiDicUI(){
let isIFrameVisiable = false;
let mainDomWidth = "";

if(!dicMinimized){
dicWinHeight = bodyHeight - info1Height - parseInt(domDic["main"].css("margin-bottom")) - dicWinPadding*2;
dicWinWidth = bodyWidth/2;

if (!dicMinimized){
dicWinHeight = bodyHeight - info1Height - parseInt(domDic["main"].css("margin-bottom"));
dicWinWidth = bodyWidth * 0.3;
}

domDic["dicWin"].css({
height: dicWinHeight
, width : dicWinWidth
, top:mainTop-bodyMarginTop + bodyHeight - dicWinHeight - dicWinPadding*2 - info1Height
, left: bodyWidth - dicWinWidth - bodyPaddingLeft
width : dicWinWidth, height: dicWinHeight,
top:mainTop-bodyMarginTop + bodyHeight - dicWinHeight - dicWinPadding - info1Height,
left: bodyWidth - dicWinWidth - bodyPaddingLeft
});

iframeWidth = domDic["dicWin"].width()- dicWinPadding*2;
Expand All @@ -217,8 +219,7 @@ function ZiHaiDicUI(){
} else {
isIFrameVisiable = true;
domDic["dicResult"].show().css({
height: dicWinHeight-dicWinMinHeight
, width : iframeWidth
width : iframeWidth, height: dicWinHeight-dicWinMinHeight
});
}
} else {
Expand All @@ -230,7 +231,7 @@ function ZiHaiDicUI(){
}

if(!dicMinimized){
mainDomWidth = dicWinWidth - dicWinPadding*5;
mainDomWidth = bodyWidth - dicWinWidth - dicWinPadding*5;
}
domDic["main"].css({
width:mainDomWidth
Expand Down
3 changes: 2 additions & 1 deletion ime/zihaidic.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@font-face { font-family: ZY; src: url('BpmfZihiKaiStd-Regular.ttf'); }
.dicq {font-family: ZY; }
.dicq {font-family: ZY; }
.dicz {font-family: 標楷體, 'DFKai-SB', 'BiauKaiTi'; }
Loading

0 comments on commit 3f91841

Please sign in to comment.