-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
764 lines (643 loc) · 23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Join libchewing Development</title>
<meta name="description" content="">
<meta name="author" content="ChangZhuo Chen (https://github.com/czchen)">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Joining libchewing Development</h1>
<p>ChangZhuo Chen (<a href="mailto:czchen@gmail.com">czchen@gmail.com</a>)</p>
<p><a href="http://coscup.org/2013/zh-tw/">COSCUP 2013</a></p>
</section>
<section>
<h1>LICENSE</h1>
<p><a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA 3.0</a></p>
</section>
<section>
<h2>先廣告一下</h2>
<ul>
<li>有新的 release <a href="http://chewing.im/post-2013-07-28_libchewing-0_3_5.html">0.3.5</a></li>
<li>有新的 domain (<a href="http://chewing.im/">http://chewing.im/</a>)</li>
<li>有新的 <a href="https://github.com/chewing/libchewing/issues">bugs</a></li>
<li>需要新的 contributors</li>
</ul>
<aside class="notes">
<ul>
<li>7/28 0.3.5 release</li>
<li>8/2 first bug after release</li>
<li>8/3 new doamin online</li>
<li>8/4 need new contributor</li>
</ul>
</aside>
</section>
<section>
<p>One day in <a href="http://www.hackingthursday.org/">Hacking Thursday</a></p>
<ul>
<li>czchen: 新酷音這部份的 code 是作啥用的阿</li>
<li>kanru: 現在有個 feature ...</li>
<li>czchen: ...</li>
</ul>
</section>
<section>
<p>coding → building → testing → coding → ...</p>
</section>
<section>
<p>Send pull request</p>
<img src="images/pull_14.png" alt="pull request 14">
</section>
<section>
<p>感覺 Unit Test 有點少,會不會改出問題阿?</p>
<img src="images/old_test.png">
</section>
<section>
<a href="https://github.com/chewing/libchewing/issues/26">https://github.com/chewing/libchewing/issues/26</a>
<img src="images/issue_26.png">
</section>
<section>
<p>coding → building → testing → coding → ...</p>
</section>
<section>
<p>Fixed</p>
<img src="images/issue_26_fix.png">
</section>
<section>
<p>為了避免再次發生問題,來研究一下 Unit Test 吧</p>
</section>
<section>
<p>先加個 coverage report</p>
<p><a href="http://qualityhour.wordpress.com/2012/01/29/test-coverage-tutorial-for-cc-autotools-projects/">Test Coverage Tutorial for C/C++ Autotools Projects</a>
<pre><code data-trim contenteditable>
dnl Enable gcov for coverage test
AC_ARG_ENABLE(
[gcov],
AS_HELP_STRING(
[--enable-gcov],
[Turn on gcov support @<:@default=no@:>@]),
AS_CASE(
[${enableval}],
[yes], [ENABLE_GCOV="true"],
[ENABLE_GCOV="false"]),
[ENABLE_GCOV="false"])
AS_IF([test x$ENABLE_GCOV = x"true"],
[AM_CFLAGS="$AM_CFLAGS --coverage"])
</code></pre>
</section>
<section>
<p><a href="http://kanru.info/chewing/lcov-check/">http://kanru.info/chewing/lcov-check/</a></p>
<img src="images/initial_coverage.png">
</section>
<section>
<p>看起來有點弱阿,應該要強化一下</p>
<p>那就先寫一些 Unit Test 順便熟悉一下 libchewing 的 API 吧</p>
</section>
<section>
<p>先隨邊抓幾個 API 來看看</p>
<pre><code data-trim contenteditable>
CHEWING_API void chewing_set_candPerPage(ChewingContext *ctx, int n)
{
ctx->data->config.candPerPage = n;
}
CHEWING_API int chewing_get_candPerPage(ChewingContext *ctx)
{
return ctx->data->config.candPerPage;
}
</code></pre>
</section>
<section>
<p>candidate per page 沒有參數檢查?這樣會出事吧</p>
</section>
<section>
<p>查了一下 code,預設 candidate per page 是 0</p>
<p>divide by zero by default</p>
</section>
<section>
<p>修改預設值通常會造成一些問題,要小心修改,不過 ...</p>
<p></p>
<ul>
<li>candidate per page (0 → 10)</li>
<li>preedit buffer (0 → 39)</li>
<li>default select key (\0 * 10 → 1234567890)</li>
</ul>
</section>
<section>
<p>加上 unit test helper</p>
<pre><code data-trim contenteditable>
commit e0546eb4a9fd53dc6c407446f42fc7f792e74e20
Author: ChangZhuo Chen <czchen@gmail.com>
Date: Fri Oct 26 18:42:18 2012 +0800
Add libtest for unit test
</code></pre>
</section>
<section>
<p>順便把改過的 API 都加上 unit test</p>
<pre><code data-trim contenteditable>
for (i = 0; i < ARRAY_SIZE(VALUE); ++i) {
chewing_set_candPerPage(ctx, VALUE[i]);
ok(chewing_get_candPerPage(ctx) == VALUE[i],
"candPerPage shall be `%d'", VALUE[i]);
// mode shall not change when set mode has invalid value.
for (j = 0; j < ARRAY_SIZE(INVALID_VALUE); ++j) {
chewing_set_candPerPage(ctx, INVALID_VALUE[j]);
ok(chewing_get_candPerPage(ctx) == VALUE[i],
"candPerPage shall be `%d'", VALUE[i]);
}
}
</code></pre>
</section>
<section>
<p>看起來好多了</p>
<p><a href="https://drone.io/github.com/chewing/libchewing/files">https://drone.io/github.com/chewing/libchewing/files</a></p>
<img src="images/coverage.png">
</section>
<section>
<p>接下來修一下 Windows build</p>
</section>
<section>
<p><a href="http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/">MinGW - Minimalist GNU for Windows</a></p>
<p>用起來很簡單,只要 s/apt/mingw/</p>
<pre><code data-trim contenteditable>
mingw-get install automake
mingw-get install autoconf
mingw-get install libtool
./autogen.sh
./configure
make
</code></pre>
</section>
<section>
<p>有些小問題需要注意一下</p>
<p>CR/LF → LF</p>
<pre><code data-trim contenteditable>
git config core.autocrlf input
rm -rf *
git reset --hard
</code></pre>
<p>Windows 顯示亂碼</p>
<pre><code data-trim contenteditable>
chcp 65001
</code></pre>
</section>
<section>
<p>在 Windows 上,應該要試試看 Visual Studio,不過又不想把 Visual Studio 的 project files 放到 git 上</p>
</section>
<section>
<p>那試試看用 CMake 好了</p>
</section>
<section>
<p>不過我不會 CMake,先抓個 <a href="http://www.cmake.org/cmake/help/cmake_tutorial.html">tutorial</a> 來看看吧</p>
<p><img src="images/cmake_tutorial.png"></p>
</section>
<section>
<p>看起來只要把 build process 依照 CMake 的方式寫出來就好</p>
</section>
<section>
<p>libchewing build process</p>
<img src="images/build.png">
</section>
<section>
<p>依照 <a href="http://www.cmake.org/cmake/help/documentation.html">CMake manual</a> 上的說明把對應的 command 找出來</p>
<img src="images/build_cmake.png">
</section>
<section>
<p>會遇到一些問題,不過大致上是可以 build 的</p>
<p><a href="https://github.com/chewing/libchewing/issues/40">[Issue 40] cmake cannot build gen_keystroke</a></p>
<p></p>
</section>
<section>
<p>那試試看在 Windows 上用 Visual Studio Express 2012</p>
</section>
<section>
<p>當然,不能 build</p>
<p>要把 source 中 Visual Studio 不 support 的部份改掉</p>
</section>
<section>
<p>修改 tools 的 output directory</p>
<pre><code data-trim contenteditable>
add_executable(sort ${TOOLS_SRC_DIR}/sort.c $<TARGET_OBJECTS:common>)
add_executable(maketree ${TOOLS_SRC_DIR}/maketree.c)
set_target_properties(${ALL_TOOLS} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${TOOLS_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${TOOLS_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${TOOLS_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${TOOLS_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${TOOLS_BIN_DIR}
)
</code></pre>
</section>
<section>
<p>把 UTF-8 string 改成 \xAA 的形式</p>
<p><a href="http://www.nubaria.com/en/blog/?p=289">Using UTF-8 as the internal representation for strings in C and C++ with Visual Studio</a></p>
<pre><code data-trim contenteditable>
"好萊塢" → "\xE5\xA5\xBD\xE8\x90\x8A\xE5\xA1\xA2" /* 好萊塢 */
</code></pre>
</section>
<section>
<p>拿掉 designated initializer</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/363d81f6-2308-492d-b530-2614b333e9e0/#aeece11a-ce75-434a-b140-cb54356d904e">C99 Designated Initializers support</a></p>
<img src="images/visual_studio_designated_initializer.png">
<pre><code data-trim contenteditable>
static const ChewingConfigData DEFAULT_CONFIG = {
.candPerPage = MAX_SELKEY,
.selKey = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' },
};
</code></pre>
</section>
<section>
<p>然後就可以用了</p>
<pre><code data-trim contenteditable>
cmake PATH -G "Visual Studio 11 Win64"
</code></pre>
<img src="images/Visual_Studio_Solution.png">
</section>
<section>
<p>unit test 也可以用</p>
<img src="images/Visual_Studio_Testing.png">
</section>
<section>
<p>跑 kcwu 提供的 stress test script 找出問題</p>
<pre><code data-trim contenteditable>
commit 496cd753b7e6ce1e5c21fa574ce3e8d9cc07ed58
Author: Kuang-che Wu <kcwu@csie.org>
Date: Fri Jan 18 17:23:33 2013 +0800
Add script to run stress test
test/stresstest.py
</code></pre>
</section>
<section>
<p>用 <a href="http://valgrind.org/">valgrind</a> 跑所有的 test cases</p>
<pre><code data-trim contenteditable>
if(USE_VALGRIND)
find_program(VALGRIND valgrind)
if(VALGRIND)
foreach(target ${ALL_TESTCASES})
...
</code></pre>
</section>
<section>
<p>用 <a href="https://code.google.com/p/address-sanitizer/">address sanitizer</a> 跑所有的 test cases</p>
<pre><code data-trim contenteditable>
CC=clang CFLAGS+=-fsanitize=address
</code></pre>
</section>
<section>
<p>用 <a href="https://code.google.com/p/include-what-you-use/">include-what-you-use</a> 清 include</p>
<p><img src="images/include-what-you-use.png"></p>
</section>
<section>
<p>新增 API</p>
<pre><code data-trim contenteditable>
CHEWING_API void chewing_set_logger( ChewingContext *ctx,
void (*logger)( void *data, int level, const char *fmt, ... ),
void *data )
</code></pre>
</section>
<section>
<p>新增 API 要修改 library version</p>
<p>可是 autotools 和 CMake 是用不同的 format</p>
</section>
<section>
<p>autotools 的 -version-info 是用 current / revision / age</p>
</section>
<section>
<p>CMake 用 major / minor / revision</p>
<pre><code data-trim contenteditable>
set_target_properties(${LIBS} PROPERTIES
OUTPUT_NAME chewing
SOVERSION 3
VERSION 3.1.0
)
</code></pre>
</section>
<section>
<p>在 Linux 上,libchewing 的檔案名稱是 libchewing.so.major.minor.revision</p>
<pre><code data-trim contenteditable>
major = current - age
minor = age
revision = revision
</code></pre>
</section>
<section>
<p>不過在 BSD 上,公式不太一樣</p>
<p><a href="https://lists.gnu.org/archive/html/bug-libtool/2011-05/msg00007.html">bug#8765: Incorrect library versioning on *BSDs</a></p>
<pre><code data-trim contenteditable>
major = current
</code></pre>
</section>
<section>
<p>所以 ...</p>
<pre><code data-trim contenteditable>
commit 3b1805c27bbf408f29e46abc8e111993ce512b53
Author: ChangZhuo Chen <czchen@gmail.com>
Date: Sat Jun 22 20:34:35 2013 +0800
Use -version-number in libtool
</code></pre>
</section>
<section>
<p>也有遇到 cross platform issue</p>
<p>是 Sparc 上 alignment 的問題</p>
<p><a href="https://github.com/chewing/libchewing/issues/53">libchewing: FTBFS on sparc</a>
</section>
<section>
<p>修好後順便送了 patch 到 debian</p>
<p><a href="http://bugs.debian.org/709934">debian #709934</a></p>
<p><img src="images/debian_709934.png"></p>
</section>
<section>
<p>不過只 patch 到 Makefile.am,Makefile 本身忘了 patch</p>
<p><a href="http://bugs.debian.org/712883">debian #712883</a></p>
<p><img src="images/debian_712883.png"></p>
</section>
<section>
<p>不是有 -no-undefined 嗎?</p>
</section>
<section>
<p><a href="http://lists.gnu.org/archive/html/libtool/2009-03/msg00026.html">-no-undefined support for GNU/Linux</a><p>
<p><img src="images/no_undefined.png"></p>
</section>
<section>
<h2>CI Services</h2>
</section>
<section>
<ul>
<li>懶得自己跑 Unit Test</li>
<li>懶得自己跑 Coverage Report</li>
<li>懶得包 debian package</li>
</ul>
</section>
<section>
<h3>Travis CI</h3>
<p>Powered by kanru</p>
<p><a href="https://travis-ci.org/chewing/libchewing">https://travis-ci.org/chewing/libchewing</a></p>
<img src="images/travis-ci.png">
</section>
<section>
<p>只要把 <a href="https://github.com/chewing/libchewing/blob/master/.travis.yml">.travis.yml</a> 加到 project 內就可以用了</p>
</section>
<section>
<p>build matrix</p>
<pre><code data-trim contenteditable>
language: c
compiler: gcc
env: BUILD=autotools
matrix:
include:
- compiler: clang
env: BUILD=autotools CONFIGURE_OPTION=--disable-binary-data
- compiler: gcc
env: BUILD=cmake
- compiler: clang
env: BUILD=cmake CMAKE_OPTION="-DUSE_VALGRIND=no -DNO_UNDEFINED=no" CFLAGS=-fsanitize=address
- compiler: gcc
env: BUILD=cmake CMAKE_OPTION="-DENABLE_GCOV=yes -DUSE_VALGRIND=no" COVERALLS=yes
</code></pre>
</section>
<section>
<p>有下列幾種組合</p>
<ul>
<li>gcc + autotools</li>
<li>clang + autotools + disable-binary-data</li>
<li>gcc + cmake + valgrind</li>
<li>clang + cmake + address sanitizer</li>
<li>gcc + cmake + coverage report</li>
</ul>
</section>
<section>
<h3>COVERALLS</h3>
<a href="https://coveralls.io/r/chewing/libchewing">https://coveralls.io/r/chewing/libchewing</a>
<img src="images/coveralls.io.png">
</section>
<section>
<p>在 Travis CI 跑完後跑一下 coveralls 就好了</p>
<a href="https://coveralls.io/docs/cpp">https://coveralls.io/docs/cpp</a>
<pre><code data-trim contenteditable>
after_success:
- if [ x$COVERALLS == xyes ]; then coveralls ; fi
</code></pre>
</section>
<section>
<h3>drone.io</h3>
<a href="https://drone.io/github.com/chewing/libchewing">https://drone.io/github.com/chewing/libchewing</a>
<img src="images/drone.io.png">
</section>
<section>
<p>設定 Commands</p>
<pre><code data-trim contenteditable>
sudo apt-get install -qq lcov texinfo
./autogen.sh
./configure --enable-gcov
make dist
make check
scripts/lcov.sh
tar czf coveragereport.tar.gz coveragereport
</code></pre>
<p>設定 Artifacts</p>
<pre><code data-trim contenteditable>
coveragereport.tar.gz
libchewing-*.tar.gz
</code></pre>
</section>
<section>
<p>就可以產生 package 和 coverage report</p>
<a href="https://drone.io/github.com/chewing/libchewing/files">https://drone.io/github.com/chewing/libchewing/files</a>
<img src="images/drone.io.download.png">
</section>
<section>
<h3>Launchpad daily-build PPA</h3>
<p>Powered by Shawn</p>
<p><a href="https://launchpad.net/~chewing/+archive/chewing">https://launchpad.net/~chewing/+archive/chewing</a></p>
<img src="images/launchpad.net.png">
</section>
<section>
<p>只要以下步驟就可以作 Launchpad daily-build PPA</p>
<ul>
<li>Import github project to launchpad (with git protocol)</li>
<li>在 launchpad 上開一個 debianize repository</li>
<li>寫 recipe</li>
</ul>
</section>
<section>
<p>recipe</p>
<pre><code data-trim contenteditable>
# bzr-builder format 0.3 deb-version {debupstream}-chewing~{revno}
lp:libchewing
nest-part packaging lp:~chewing/libchewing/debianize debian debian
</code></pre>
</section>
<section>
<p>ubuntu 可以把 PPA 接到 <a href="https://wiki.ubuntu.com/Apport">Apport</a> 上</p>
<p><a href="http://jderose.blogspot.tw/2012/09/how-to-use-apport-in-your-daily-ppa.html">How to use Apport in your daily PPA builds</a></p>
</section>
<section>
<p>基本上把下面的 code 放到 /usr/share/apport/package-hooks/<package-name>.py 就好了</p>
<pre><code data-trim contenteditable>
def add_info(report):
report['CrashDB'] = '{"impl": "launchpad", "project": "libchewing"}'
</code></pre>
<aside class="notes">
<p>不過 ubuntu 會用執行檔來找有問題的 package</p>
<p>所以 package-name 要設成 ibus-chewing ... 等,而不是 libchewing</p>
</aside>
</section>
<section>
<p>這樣就可以直接產生 bug report 到 Launchpad 上</p>
<p><a href="https://bugs.launchpad.net/libchewing/+bug/1197795">bug report example </a></p>
<p><img src="images/launchpad.net_bug_report.png"></p>
</section>
<section>
<h2>字詞庫整理</h2>
</section>
<section>
<p>ㄍㄢˇ ㄗㄡˇ → 趕人</p>
<p><a href="https://groups.google.com/forum/#!topic/chewing-devel/tzNOjgYyzdQ">Google Group Chewing IM Development</a></p>
<p><img src="images/data_problem.png"></p>
</section>
<section>
<p>raw data 不乾淨?看來要清一下</p>
</section>
<section>
<p>raw data</p>
<ul>
<li>phone.cin + sort_word → 字庫</li>
<li>tsi.src + sort_dic → 詞庫</li>
</ul>
</section>
<section>
<p>改 sort_word 和 sort_dic 來檢查字詞庫的正確性</p>
</section>
<section>
<p>要檢查的部份如下</p>
<ul>
<li>字/詞 重複</li>
<li>同音詞有相同的 frequency</li>
<li>format 錯誤</li>
<li>注音符號錯誤</li>
<li>詞庫長度錯誤</li>
<li>詞庫發音錯誤</li>
</ul>
</section>
<section>
<p>用 sort 取代 sort_word 和 sort_dic</p>
<pre><code data-trim contenteditable>
commit 704c1eb48706abd8c458149fabb46924c5e309fc
Author: ChangZhuo Chen <czchen@gmail.com>
Date: Sun Dec 30 03:10:12 2012 +0800
Add sort to replace sort_word and sort_dic
</code></pre>
</section>
<section>
<p>接下來開始清 raw data</p>
<ul>
<li>中文發音特例</li>
<li>同音詞有相同的 frequency</li>
</ul>
</section>
<section>
<p>中文發音特例</p>
<ul>
<li><a href="https://www.moedict.tw/#好萊塢">好萊塢</a> vs <a href="https://www.moedict.tw/#塢">塢</a></li>
<li>疊字第二字轉輕聲</li>
</ul>
</section>
<section>
<p>同音詞有相同的 frequency ...</p>
</section>
<section>
<p>就 ... 裝作沒看見</p>
<pre><code data-trim contenteditable>
if (a->freq == b->freq) {
/* FIXME: shall exit(-1) when tsi.src is fixed */
//fprintf(stderr, "Phrase `%s' and `%s' have the same phone and frequency (%d).\n", a->phrase, b->phrase, a->freq);
//exit(-1);
}
</code></pre>
</section>
<section>
<h2>Windows</h2>
</section>
<section>
<p>接下來試試看 windows-chewing</p>
</section>
<section>
<p>不會 build</p>
<p>所以 ... pull request welcome</p>
</section>
<section>
<p>不過 Windows 還是要試試看</p>
<p>所以先用 <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms629032(v=vs.85).aspx">Text Services Framework</a> 寫個 POC 出來</p>
</section>
<section>
<p>有 sample code,應該改一下就可以用了</p>
<p><img src="images/TSF-sample.png"></p>
</section>
<section>
<p>第二個 sample 就看不懂了</p>
</section>
<section>
<p>強者我同事曾說 "MSDN 最重要的是其他人的註解"</p>
</section>
<section>
<p>好像哪裡怪怪的</p>
<p><img src="images/TSF-sample-comment.png"></p>
</section>
<section>
<p>連連看時間</p>
<p><img src="images/TSF-sample-comparison.png"></p>
</section>
<section>
<p>POC 在 <a href="https://github.com/czchen/TSF-chewing">https://github.com/czchen/TSF-chewing</a></p>
<p><img src="images/TSF-chewing.png"></p>
</section>
<section>
<h1>We are hiring</h1>
<p>Send a pull request to <a href="https://github.com/chewing/libchewing](https://github.com/chewing/libchewing">https://github.com/chewing/libchewing</a>
<p><img src="images/we_are_hiring.png"></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>