Skip to content
This repository was archived by the owner on May 3, 2018. It is now read-only.

Commit 6ba18df

Browse files
committed
feat(punctuation): add extra Japanese punctuation conversion
converts more Latin punctuation to Japanese equivalents, adds curly single/double quotes to english punctuation checks/conversions
1 parent 38596d1 commit 6ba18df

26 files changed

+309
-214
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<img src="https://img.shields.io/npm/v/kanawana.svg" alt="devDependency Status" />
55
</a>
66
<!-- Build Status -->
7-
<a href="https://travis-ci.org/KaniWani/KanaWana">
7+
<a href="https://travis-ci.org/Kaniwani/KanaWana">
88
<img src="https://img.shields.io/travis/Kaniwani/KanaWana.svg" alt="Build Status" />
99
</a>
1010
<!-- Test Coverage -->
@@ -86,14 +86,16 @@ kw.isMixed('お腹A')
8686
kw.isRomaji('Tōkyō and Ōsaka') // allows basic Hepburn romanisation
8787
// => true
8888

89-
/* toKana notes:
89+
/* kana conversion notes:
9090
* Lowercase -> Hiragana, uppercase -> Katakana.
91-
* Non-romaji and _some_ punctuation is passed through: 12345 @#$%
92-
* However, .,-~[]{}()!?/ will become 。、ー〜「」{}()!?・
91+
* Non-romaji and _English_ punctuation is passed through: 123 @#$%
92+
* Japanese equivalent punctuation is converted:
93+
* !?.:/,~-‘’“”[](){}
94+
* !?。:・、〜ー「」『』[](){}
9395
*/
9496
kw.toKana('ONAJI buttsuuji')
9597
// => 'オナジ ぶっつうじ'
96-
kw.toKana('座禅[zazen]スタイル')
98+
kw.toKana('座禅zazenスタイル')
9799
// => '座禅「ざぜん」スタイル'
98100
kw.toKana('batsuge-mu')
99101
// => 'ばつげーむ'

docs/global.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ <h4 class="name" id="toKana"><span class="type-signature"></span>toKana<span cla
19311931

19321932
<dt class="tag-source">Source:</dt>
19331933
<dd class="tag-source"><ul class="dummy"><li>
1934-
<a href="toKana.js.html">toKana.js</a>, <a href="toKana.js.html#line54">line 54</a>
1934+
<a href="toKana.js.html">toKana.js</a>, <a href="toKana.js.html#line56">line 56</a>
19351935
</li></ul></dd>
19361936

19371937

@@ -1984,16 +1984,16 @@ <h4 class="name" id="toKana"><span class="type-signature"></span>toKana<span cla
19841984

19851985
<h5>Example</h5>
19861986

1987-
<pre class="prettyprint"><code>toKana('onaji BUTTSUUJI'))
1987+
<pre class="prettyprint"><code>toKana('onaji BUTTSUUJI')
19881988
// => 'おなじ ブッツウジ'
1989-
toKana('ONAJI buttsuuji'))
1989+
toKana('ONAJI buttsuuji')
19901990
// => 'オナジ ぶっつうじ'
1991-
toKana('座禅[zazen]スタイル'))
1991+
toKana('座禅zazenスタイル')
19921992
// => '座禅「ざぜん」スタイル'
1993-
toKana('batsuge-mu'))
1993+
toKana('batsuge-mu')
19941994
// => 'ばつげーむ'
1995-
toKana('.,[]{}()!?/')) // Punctuation conversion
1996-
// => '。、「」{}()!?・'
1995+
toKana('!?.:/,~-‘’“”[](){}') // Punctuation conversion
1996+
// => '!?。:・、〜ー「」『』[](){}'
19971997
toKana('we', { useObsoleteKana: true })
19981998
// => 'ゑ'</code></pre>
19991999

@@ -2774,7 +2774,7 @@ <h4 class="name" id="DefaultOptions">DefaultOptions</h4>
27742774

27752775
<dt class="tag-source">Source:</dt>
27762776
<dd class="tag-source"><ul class="dummy"><li>
2777-
<a href="toKana.js.html">toKana.js</a>, <a href="toKana.js.html#line18">line 18</a>
2777+
<a href="toKana.js.html">toKana.js</a>, <a href="toKana.js.html#line20">line 20</a>
27782778
</li></ul></dd>
27792779

27802780

@@ -3039,7 +3039,7 @@ <h5>Examples</h5>
30393039
<br class="clear">
30403040

30413041
<footer>
3042-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
3042+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
30433043
</footer>
30443044

30453045
<script>prettyPrint();</script>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
5555
<br class="clear">
5656

5757
<footer>
58-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
58+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
5959
</footer>
6060

6161
<script>prettyPrint();</script>

docs/isHiragana.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1 class="page-title">isHiragana.js</h1>
7070
<br class="clear">
7171

7272
<footer>
73-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
73+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7474
</footer>
7575

7676
<script>prettyPrint();</script>

docs/isJapanese.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1 class="page-title">isJapanese.js</h1>
7777
<br class="clear">
7878

7979
<footer>
80-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
80+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
8181
</footer>
8282

8383
<script>prettyPrint();</script>

docs/isKana.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h1 class="page-title">isKana.js</h1>
7474
<br class="clear">
7575

7676
<footer>
77-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
77+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7878
</footer>
7979

8080
<script>prettyPrint();</script>

docs/isKanji.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h1 class="page-title">isKanji.js</h1>
7474
<br class="clear">
7575

7676
<footer>
77-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
77+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7878
</footer>
7979

8080
<script>prettyPrint();</script>

docs/isKatakana.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h1 class="page-title">isKatakana.js</h1>
7272
<br class="clear">
7373

7474
<footer>
75-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7676
</footer>
7777

7878
<script>prettyPrint();</script>

docs/isMixed.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ <h1 class="page-title">isMixed.js</h1>
8181
<br class="clear">
8282

8383
<footer>
84-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
84+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
8585
</footer>
8686

8787
<script>prettyPrint();</script>

docs/isRomaji.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h1 class="page-title">isRomaji.js</h1>
7474
<br class="clear">
7575

7676
<footer>
77-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Apr 09 2017 21:10:18 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
77+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 10 2017 12:56:10 GMT+0100 (WEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7878
</footer>
7979

8080
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)