kana_convert 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +45 -7
- data/README.md +2 -39
- data/app/assets/javascripts/kana_convert.js +17 -0
- data/app/assets/javascripts/wanakana.min.js +1 -0
- data/kana_convert.gemspec +3 -3
- data/lib/kana_convert/engine.rb +4 -0
- data/lib/kana_convert/version.rb +1 -1
- metadata +9 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0d6a6fe9c1f95269e2175c3b9287011e14b0125
|
|
4
|
+
data.tar.gz: 7b54e526383dee4e9f1ac49c058b3a66b4f7d79a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbff934d3a113f1f901626eb5b07ee9f7e20c1343ffd107b7c03ede1202242dc467eda68f511279b465d725aa782614f7690499d1d844559c8ce6960fc8dc4cc
|
|
7
|
+
data.tar.gz: c2cd934f099bf40ed8c0690ad13e68f93d380674caf5c1c0dfbd8dc2000a7e1f5e17e9ff83a983d82bdc3cb1ded6327b176b6a3052891ef9b7ef2b5122e9b8df
|
data/.gitignore
CHANGED
|
@@ -1,12 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/_yardoc/
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
/.config
|
|
5
4
|
/coverage/
|
|
6
|
-
/
|
|
5
|
+
/InstalledFiles
|
|
7
6
|
/pkg/
|
|
8
7
|
/spec/reports/
|
|
8
|
+
/spec/examples.txt
|
|
9
|
+
/test/tmp/
|
|
10
|
+
/test/version_tmp/
|
|
9
11
|
/tmp/
|
|
10
12
|
|
|
11
|
-
#
|
|
12
|
-
.
|
|
13
|
+
# Used by dotenv library to load environment variables.
|
|
14
|
+
# .env
|
|
15
|
+
|
|
16
|
+
## Specific to RubyMotion:
|
|
17
|
+
.dat*
|
|
18
|
+
.repl_history
|
|
19
|
+
build/
|
|
20
|
+
*.bridgesupport
|
|
21
|
+
build-iPhoneOS/
|
|
22
|
+
build-iPhoneSimulator/
|
|
23
|
+
|
|
24
|
+
## Specific to RubyMotion (use of CocoaPods):
|
|
25
|
+
#
|
|
26
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
|
27
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
|
28
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
29
|
+
#
|
|
30
|
+
# vendor/Pods/
|
|
31
|
+
|
|
32
|
+
## Documentation cache and generated files:
|
|
33
|
+
/.yardoc/
|
|
34
|
+
/_yardoc/
|
|
35
|
+
/doc/
|
|
36
|
+
/rdoc/
|
|
37
|
+
|
|
38
|
+
## Environment normalization:
|
|
39
|
+
/.bundle/
|
|
40
|
+
/vendor/bundle
|
|
41
|
+
/lib/bundler/man/
|
|
42
|
+
|
|
43
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
44
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
45
|
+
# Gemfile.lock
|
|
46
|
+
# .ruby-version
|
|
47
|
+
# .ruby-gemset
|
|
48
|
+
|
|
49
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
50
|
+
.rvmrc
|
data/README.md
CHANGED
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kana_convert`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Add this line to your application's Gemfile:
|
|
10
|
-
|
|
11
|
-
```ruby
|
|
12
|
-
gem 'kana_convert'
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
And then execute:
|
|
16
|
-
|
|
17
|
-
$ bundle
|
|
18
|
-
|
|
19
|
-
Or install it yourself as:
|
|
20
|
-
|
|
21
|
-
$ gem install kana_convert
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
TODO: Write usage instructions here
|
|
26
|
-
|
|
27
|
-
## Development
|
|
28
|
-
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
|
-
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
|
-
|
|
33
|
-
## Contributing
|
|
34
|
-
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/kana_convert.
|
|
36
|
-
|
|
37
|
-
## License
|
|
38
|
-
|
|
39
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
1
|
+
# kana_convert
|
|
2
|
+
Ruby gem implements wanakana.js to convert input to Japanese kana
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//= require_tree .
|
|
2
|
+
|
|
3
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
4
|
+
var els = document.getElementsByClassName("to_katakana");
|
|
5
|
+
|
|
6
|
+
[].forEach.call(els, function(el) {
|
|
7
|
+
console.log(el);
|
|
8
|
+
wanakana.bind(el, { IMEMode: 'toKatakana' });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
els = document.getElementsByClassName("to_hiragana");
|
|
12
|
+
|
|
13
|
+
[].forEach.call(els, function(el) {
|
|
14
|
+
console.log(el);
|
|
15
|
+
wanakana.bind(el, { IMEMode: 'toHiragana' });
|
|
16
|
+
});
|
|
17
|
+
}, false);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.wanakana=e.wanakana||{})}(this,function(e){"use strict";function n(e){return"string"!=typeof e||!e.length}function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1],a=arguments[2];if(n(e))return!1;var r=e.charCodeAt(0);return r>=t&&a>=r}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[].concat(Ce(e)).map(function(e,n){var a=e.charCodeAt(0),r=t(e,ye,he),o=t(e,se,ve);return r?String.fromCharCode(a-ye+ie):o?String.fromCharCode(a-se+ue):e}).join("")}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void 0===arguments[1]||arguments[1];if(n(e))return!1;var a=t?/[bcdfghjklmnpqrstvwxyz]/:/[bcdfghjklmnpqrstvwxz]/;return-1!==e.toLowerCase().charAt(0).search(a)}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&t(e,ue,ce)}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.min(e,n)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments[2];return e.slice(n,t)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void 0===arguments[1]||arguments[1];if(n(e))return!1;var a=t?/[aeiouy]/:/[aeiou]/;return-1!==e.toLowerCase().charAt(0).search(a)}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&e.charCodeAt(0)===me}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&e.charCodeAt(0)===ke}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&(!!y(e)||t(e,le,de))}function v(){var e=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("").forEach(function(n){if(y(n)||h(n))e.push(n);else if(s(n)){var t=n.charCodeAt(0)+(fe-le),a=String.fromCharCode(t);e.push(a)}else e.push(n)}),e.join("")}function l(){return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",fe,ge)}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&(s(e)||l(e))}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(Ce(e)).every(d)}function g(){return w(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).map(function(e){return e[2]}).join("")}function w(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=Object.assign({},B,n),y=[],h=0,s=e.length,l=3,d="",g="";s>h;){var w=null;for(l=i(3,s-h);l>0;){if(d=u(e,h,h+l),g=d.toLowerCase(),je.includes(g)&&s-h>=4)g=(d=u(e,h,h+(l+=1))).toLowerCase();else{if("n"===g.charAt(0)){if(2===l){if(!a.IMEMode&&" "===g.charAt(1)){w="ん ";break}if(a.IMEMode&&"n'"===g){w="ん";break}}r(g.charAt(1),!1)&&c(g.charAt(2))&&(g=(d=u(e,h,h+(l=1))).toLowerCase())}"n"!==g.charAt(0)&&r(g.charAt(0))&&d.charAt(0)===d.charAt(1)&&(l=1,t(d.charAt(0),ue,ce)?(g="ッ",d="ッ"):(g="っ",d="っ"))}if(null!=(w=Ae[g]))break;l-=4===l?2:1}null==w&&(w=d),a.useObsoleteKana&&("wi"===g&&(w="ゐ"),"we"===g&&(w="ゑ")),a.IMEMode&&"n"===g.charAt(0)&&("y"===e.charAt(h+1).toLowerCase()&&!1===c(e.charAt(h+2))||h===s-1||f(e.charAt(h+1)))&&(w=d.charAt(0)),o(d.charAt(0))&&(w=v(w));var p=h+(l||1);y.push([h,p,w]),h=p}return y}function p(e){var n=k(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});if(e instanceof Element&&ze.includes(e.nodeName)){var t=Le();e.setAttribute("data-wanakana-id",t),e.autocapitalize="none",e.addEventListener("compositionupdate",b),e.addEventListener("input",n),Ee=j(n,t)}else console.warn("Input provided to Wanakana bind() was not a valid input field.")}function m(e){var n=A(e);null!=n?(e.removeAttribute("data-wanakana-id"),e.removeEventListener("compositionupdate",b),e.removeEventListener("input",n.handler),Ee=x(n)):console.warn("Input called with Wanakana unbind() had no listener registered.")}function k(e){var n=Object.assign({},B,e);return function(e){var t=e.target;if(Ke)Ke=!1;else{var r=a(t.value),o=w(q(r,n.IMEMode),Object.assign({},n,{IMEMode:!0})),i=o.map(function(e){return e[2]}).join("");if(r!==i){var u=t.selectionEnd;if(t.value=i,null!=t.setSelectionRange&&"number"==typeof t.selectionStart){if(0===u)t.setSelectionRange(0,0);else{t.setSelectionRange(t.value.length,t.value.length);for(var c=0,y=0;o.length>y;y+=1){var h=o[y],s=h[1];if(c+=h[2].length,s>=u){t.setSelectionRange(c,c);break}}}return}if(null!=t.createTextRange){t.focus();var v=t.createTextRange();v.collapse(!1),v.select()}}}}}function b(e){var n=e.data||e.detail&&e.detail.data,t=n&&n.slice(-2)||"",o="n"===t[0],i=a(t).split("").every(r);Ke=!o&&i}function j(e,n){return Ee.concat({id:n,handler:e})}function A(e){return e&&Ee.find(function(n){return n.id===e.getAttribute("data-wanakana-id")})}function x(e){var n=e.id;return Ee.filter(function(e){return e.id!==n})}function q(e,n){switch(!0){case"toHiragana"===n:return e.toLowerCase();case"toKatakana"===n:return e.toUpperCase();default:return e}}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&re.some(function(n){var a=qe(n,2);return t(e,a[0],a[1])})}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(Ce(e)).every(C)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return ae.some(function(n){var a=qe(n,2);return t(e,a[0],a[1])})}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(Ce(e)).every(E)}function K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(Ce(e)).every(s)}function L(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(Ce(e)).every(l)}function R(){return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",we,pe)}function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(Ce(e)).every(R)}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{passKanji:!0},t=[].concat(Ce(e)),a=!1;return n.passKanji||(a=t.some(O)),(t.some(K)||t.some(L))&&t.some(z)&&!a}function I(){for(var e=[],n="",t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(""),a=0;t.length>a;a+=1){var r=t[a],o=[h(r),y(r)],i=o[0],u=o[1];if(i||u&&1>a)e.push(r);else if(n&&u&&a>0){var c=xe[n].slice(-1);e.push(be[c])}else if(!u&&l(r)){var s=r.charCodeAt(0)+(le-fe),v=String.fromCharCode(s);e.push(v),n=v}else e.push(r),n=""}return e.join("")}function T(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Object.assign({},B,n),a=e.length,r=[],o=0,c=2,y="",h="",s=void 0;a>o;){c=i(2,a-o);for(var v=!1;c>0;){if(y=u(e,o,o+c),L(y)&&(v=t.upcaseKatakana,y=I(y)),"っ"===y.charAt(0)&&1===c&&a-1>o){s=!0,h="";break}if(null!=(h=xe[y])&&s&&(h=h.charAt(0).concat(h),s=!1),null!=h)break;c-=1}null==h&&(h=y),v&&(h=h.toUpperCase()),r.push(h),o+=c||1}return r.join("")}function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return g(e.toLowerCase(),n)}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Object.assign({},B,n);return t.passRomaji?I(e):z(e)?H(e,t):S(e,{passKanji:!0})?H(I(e),t):I(e)}function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=Object.assign({},B,n);return v(t.passRomaji?e:z(e)||S(e)?H(e,t):e)}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&oe.some(function(n){var a=qe(n,2);return t(e,a[0],a[1])})}function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&ne.some(function(n){var a=qe(n,2);return t(e,a[0],a[1])})}function _(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!n(e)&&(N(e)||W(e))}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{all:!1};if(n(e)||!M(e)||f(e))return e;var a=[].concat(Ce(e));if(t.all)return a.filter(function(e){return!d(e)}).join("");for(var r=a.reverse(),o=0,i=r.length;i>o;o+=1){var u=r[o];if(!_(u)){if(O(u))break;r[o]=""}}return r.reverse().join("")}function J(e){switch(!0){case W(e):return"japanesePunctuation";case R(e):return"kanji";case s(e):return"hiragana";case l(e):return"katakana";default:return"romaji"}}function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(n(e))return[""];var t=[].concat(Ce(e)),a=t.shift(),r=J(a);return t.reduce(function(e,n){var t=J(n)===r;if(r=J(n),t){var a=e.pop();return e.concat(a.concat(n))}return e.concat(n)},[a])}var B={useObsoleteKana:!1,passRomaji:!1,upcaseKatakana:!1,IMEMode:!1},F=[65296,65305],G=[65377,65381],Q=[19968,40959],V=[13312,19903],Y=[48,57],Z=[0,127],$=[[256,257],[274,275],[298,299],[332,333],[362,363]],ee=[[8216,8217],[8220,8221]],ne=[[12288,12351],G,[12539,12540],[65281,65295],[65306,65311],[65339,65343],[65371,65376],[65504,65518]],te=[[12352,12447],[12448,12543],G,[65382,65439]],ae=[].concat(te,ne,[Y,F,Q,V]),re=[Z].concat($,ee),oe=[[33,47],[58,63],[91,96],[123,126]].concat(ee),ie=97,ue=65,ce=90,ye=65345,he=65370,se=65313,ve=65338,le=12353,de=12438,fe=12449,ge=12540,we=19968,pe=40879,me=12540,ke=12539,be={a:"あ",i:"い",u:"う",e:"え",o:"う"},je=["lts","chy","shy"],Ae={".":"。",",":"、",":":":","/":"・","!":"!","?":"?","~":"〜","-":"ー","‘":"「","’":"」","“":"『","”":"』","[":"[","]":"]","(":"(",")":")","{":"{","}":"}",a:"あ",i:"い",u:"う",e:"え",o:"お",yi:"い",wu:"う",whu:"う",xa:"ぁ",xi:"ぃ",xu:"ぅ",xe:"ぇ",xo:"ぉ",xyi:"ぃ",xye:"ぇ",ye:"いぇ",wha:"うぁ",whi:"うぃ",whe:"うぇ",who:"うぉ",wi:"うぃ",we:"うぇ",va:"ゔぁ",vi:"ゔぃ",vu:"ゔ",ve:"ゔぇ",vo:"ゔぉ",vya:"ゔゃ",vyi:"ゔぃ",vyu:"ゔゅ",vye:"ゔぇ",vyo:"ゔょ",ka:"か",ki:"き",ku:"く",ke:"け",ko:"こ",lka:"ヵ",lke:"ヶ",xka:"ヵ",xke:"ヶ",kya:"きゃ",kyi:"きぃ",kyu:"きゅ",kye:"きぇ",kyo:"きょ",ca:"か",ci:"き",cu:"く",ce:"け",co:"こ",lca:"ヵ",lce:"ヶ",xca:"ヵ",xce:"ヶ",qya:"くゃ",qyu:"くゅ",qyo:"くょ",qwa:"くぁ",qwi:"くぃ",qwu:"くぅ",qwe:"くぇ",qwo:"くぉ",qa:"くぁ",qi:"くぃ",qe:"くぇ",qo:"くぉ",kwa:"くぁ",qyi:"くぃ",qye:"くぇ",ga:"が",gi:"ぎ",gu:"ぐ",ge:"げ",go:"ご",gya:"ぎゃ",gyi:"ぎぃ",gyu:"ぎゅ",gye:"ぎぇ",gyo:"ぎょ",gwa:"ぐぁ",gwi:"ぐぃ",gwu:"ぐぅ",gwe:"ぐぇ",gwo:"ぐぉ",sa:"さ",si:"し",shi:"し",su:"す",se:"せ",so:"そ",za:"ざ",zi:"じ",zu:"ず",ze:"ぜ",zo:"ぞ",ji:"じ",sya:"しゃ",syi:"しぃ",syu:"しゅ",sye:"しぇ",syo:"しょ",sha:"しゃ",shu:"しゅ",she:"しぇ",sho:"しょ",shya:"しゃ",shyu:"しゅ",shye:"しぇ",shyo:"しょ",swa:"すぁ",swi:"すぃ",swu:"すぅ",swe:"すぇ",swo:"すぉ",zya:"じゃ",zyi:"じぃ",zyu:"じゅ",zye:"じぇ",zyo:"じょ",ja:"じゃ",ju:"じゅ",je:"じぇ",jo:"じょ",jya:"じゃ",jyi:"じぃ",jyu:"じゅ",jye:"じぇ",jyo:"じょ",ta:"た",ti:"ち",tu:"つ",te:"て",to:"と",chi:"ち",tsu:"つ",ltu:"っ",xtu:"っ",tya:"ちゃ",tyi:"ちぃ",tyu:"ちゅ",tye:"ちぇ",tyo:"ちょ",cha:"ちゃ",chu:"ちゅ",che:"ちぇ",cho:"ちょ",cya:"ちゃ",cyi:"ちぃ",cyu:"ちゅ",cye:"ちぇ",cyo:"ちょ",chya:"ちゃ",chyu:"ちゅ",chye:"ちぇ",chyo:"ちょ",tsa:"つぁ",tsi:"つぃ",tse:"つぇ",tso:"つぉ",tha:"てゃ",thi:"てぃ",thu:"てゅ",the:"てぇ",tho:"てょ",twa:"とぁ",twi:"とぃ",twu:"とぅ",twe:"とぇ",two:"とぉ",da:"だ",di:"ぢ",du:"づ",de:"で",do:"ど",dya:"ぢゃ",dyi:"ぢぃ",dyu:"ぢゅ",dye:"ぢぇ",dyo:"ぢょ",dha:"でゃ",dhi:"でぃ",dhu:"でゅ",dhe:"でぇ",dho:"でょ",dwa:"どぁ",dwi:"どぃ",dwu:"どぅ",dwe:"どぇ",dwo:"どぉ",na:"な",ni:"に",nu:"ぬ",ne:"ね",no:"の",nya:"にゃ",nyi:"にぃ",nyu:"にゅ",nye:"にぇ",nyo:"にょ",ha:"は",hi:"ひ",hu:"ふ",he:"へ",ho:"ほ",fu:"ふ",hya:"ひゃ",hyi:"ひぃ",hyu:"ひゅ",hye:"ひぇ",hyo:"ひょ",fya:"ふゃ",fyu:"ふゅ",fyo:"ふょ",fwa:"ふぁ",fwi:"ふぃ",fwu:"ふぅ",fwe:"ふぇ",fwo:"ふぉ",fa:"ふぁ",fi:"ふぃ",fe:"ふぇ",fo:"ふぉ",fyi:"ふぃ",fye:"ふぇ",ba:"ば",bi:"び",bu:"ぶ",be:"べ",bo:"ぼ",bya:"びゃ",byi:"びぃ",byu:"びゅ",bye:"びぇ",byo:"びょ",pa:"ぱ",pi:"ぴ",pu:"ぷ",pe:"ぺ",po:"ぽ",pya:"ぴゃ",pyi:"ぴぃ",pyu:"ぴゅ",pye:"ぴぇ",pyo:"ぴょ",ma:"ま",mi:"み",mu:"む",me:"め",mo:"も",mya:"みゃ",myi:"みぃ",myu:"みゅ",mye:"みぇ",myo:"みょ",ya:"や",yu:"ゆ",yo:"よ",xya:"ゃ",xyu:"ゅ",xyo:"ょ",ra:"ら",ri:"り",ru:"る",re:"れ",ro:"ろ",rya:"りゃ",ryi:"りぃ",ryu:"りゅ",rye:"りぇ",ryo:"りょ",la:"ら",li:"り",lu:"る",le:"れ",lo:"ろ",lya:"りゃ",lyi:"りぃ",lyu:"りゅ",lye:"りぇ",lyo:"りょ",wa:"わ",wo:"を",lwe:"ゎ",xwa:"ゎ",n:"ん",nn:"ん","n'":"ん","n ":"ん",xn:"ん",ltsu:"っ"},xe={" ":" ","!":"!","?":"?","。":".",":":":","・":"/","、":",","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}","あ":"a","い":"i","う":"u","え":"e","お":"o","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo","か":"ka","き":"ki","きゃ":"kya","きぃ":"kyi","きゅ":"kyu","く":"ku","け":"ke","こ":"ko","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ぎゃ":"gya","ぎぃ":"gyi","ぎゅ":"gyu","ぎぇ":"gye","ぎょ":"gyo","さ":"sa","す":"su","せ":"se","そ":"so","ざ":"za","ず":"zu","ぜ":"ze","ぞ":"zo","し":"shi","しゃ":"sha","しゅ":"shu","しょ":"sho","じ":"ji","じゃ":"ja","じゅ":"ju","じょ":"jo","た":"ta","ち":"chi","ちゃ":"cha","ちゅ":"chu","ちょ":"cho","つ":"tsu","て":"te","と":"to","だ":"da","ぢ":"di","づ":"du","で":"de","ど":"do","な":"na","に":"ni","にゃ":"nya","にゅ":"nyu","にょ":"nyo","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ひゃ":"hya","ひゅ":"hyu","ひょ":"hyo","ふぁ":"fa","ふぃ":"fi","ふぇ":"fe","ふぉ":"fo","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","びゃ":"bya","びゅ":"byu","びょ":"byo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ぴゃ":"pya","ぴゅ":"pyu","ぴょ":"pyo","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","みゃ":"mya","みゅ":"myu","みょ":"myo","や":"ya","ゆ":"yu","よ":"yo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","りゃ":"rya","りゅ":"ryu","りょ":"ryo","わ":"wa","を":"wo","ん":"n","ゐ":"wi","ゑ":"we","きぇ":"kye","きょ":"kyo","じぃ":"jyi","じぇ":"jye","ちぃ":"cyi","ちぇ":"che","ひぃ":"hyi","ひぇ":"hye","びぃ":"byi","びぇ":"bye","ぴぃ":"pyi","ぴぇ":"pye","みぇ":"mye","みぃ":"myi","りぃ":"ryi","りぇ":"rye","にぃ":"nyi","にぇ":"nye","しぃ":"syi","しぇ":"she","いぇ":"ye","うぁ":"wha","うぉ":"who","うぃ":"wi","うぇ":"we","ゔゃ":"vya","ゔゅ":"vyu","ゔょ":"vyo","すぁ":"swa","すぃ":"swi","すぅ":"swu","すぇ":"swe","すぉ":"swo","くゃ":"qya","くゅ":"qyu","くょ":"qyo","くぁ":"qwa","くぃ":"qwi","くぅ":"qwu","くぇ":"qwe","くぉ":"qwo","ぐぁ":"gwa","ぐぃ":"gwi","ぐぅ":"gwu","ぐぇ":"gwe","ぐぉ":"gwo","つぁ":"tsa","つぃ":"tsi","つぇ":"tse","つぉ":"tso","てゃ":"tha","てぃ":"thi","てゅ":"thu","てぇ":"the","てょ":"tho","とぁ":"twa","とぃ":"twi","とぅ":"twu","とぇ":"twe","とぉ":"two","ぢゃ":"dya","ぢぃ":"dyi","ぢゅ":"dyu","ぢぇ":"dye","ぢょ":"dyo","でゃ":"dha","でぃ":"dhi","でゅ":"dhu","でぇ":"dhe","でょ":"dho","どぁ":"dwa","どぃ":"dwi","どぅ":"dwu","どぇ":"dwe","どぉ":"dwo","ふぅ":"fwu","ふゃ":"fya","ふゅ":"fyu","ふょ":"fyo","ぁ":"a","ぃ":"i","ぇ":"e","ぅ":"u","ぉ":"o","ゃ":"ya","ゅ":"yu","ょ":"yo","っ":"","ゕ":"ka","ゖ":"ka","ゎ":"wa","んあ":"n'a","んい":"n'i","んう":"n'u","んえ":"n'e","んお":"n'o","んや":"n'ya","んゆ":"n'yu","んよ":"n'yo"},qe=function(){function e(e,n){var t=[],a=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(a=(i=u.next()).done)&&(t.push(i.value),!n||t.length!==n);a=!0);}catch(e){r=!0,o=e}finally{try{!a&&u.return&&u.return()}finally{if(r)throw o}}return t}return function(n,t){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return e(n,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Ce=function(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);e.length>n;n++)t[n]=e[n];return t}return Array.from(e)},ze=["TEXTAREA","INPUT"],Ee=[],Me=0,Ke=!1,Le=function(){return Me+=1,""+Date.now()+Me};e.bind=p,e.unbind=m,e.isRomaji=z,e.isJapanese=M,e.isKana=f,e.isHiragana=K,e.isKatakana=L,e.isMixed=S,e.isKanji=O,e.toRomaji=T,e.toKana=g,e.toHiragana=P,e.toKatakana=U,e.stripOkurigana=D,e.tokenize=X,Object.defineProperty(e,"__esModule",{value:!0})});
|
data/kana_convert.gemspec
CHANGED
|
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Nhat Anh"]
|
|
10
10
|
spec.email = ["nhatanh.pham@pixta.co.jp"]
|
|
11
11
|
|
|
12
|
-
spec.summary = %q{Convert hiragana
|
|
13
|
-
spec.description = %q{
|
|
14
|
-
spec.homepage = "https://
|
|
12
|
+
spec.summary = %q{Convert hiragana and katakana}
|
|
13
|
+
spec.description = %q{Implement Wanakana JS library. Auto convert input to hiragana and katakana by adding "to_hiragana" or "to_katakana" to input element.}
|
|
14
|
+
spec.homepage = "https://github.com/NhatAnh/kana_convert"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
data/lib/kana_convert/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kana_convert
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nhat Anh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -52,7 +52,8 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.0'
|
|
55
|
-
description:
|
|
55
|
+
description: Implement Wanakana JS library. Auto convert input to hiragana and katakana
|
|
56
|
+
by adding "to_hiragana" or "to_katakana" to input element.
|
|
56
57
|
email:
|
|
57
58
|
- nhatanh.pham@pixta.co.jp
|
|
58
59
|
executables: []
|
|
@@ -66,12 +67,15 @@ files:
|
|
|
66
67
|
- LICENSE.txt
|
|
67
68
|
- README.md
|
|
68
69
|
- Rakefile
|
|
70
|
+
- app/assets/javascripts/kana_convert.js
|
|
71
|
+
- app/assets/javascripts/wanakana.min.js
|
|
69
72
|
- bin/console
|
|
70
73
|
- bin/setup
|
|
71
74
|
- kana_convert.gemspec
|
|
72
75
|
- lib/kana_convert.rb
|
|
76
|
+
- lib/kana_convert/engine.rb
|
|
73
77
|
- lib/kana_convert/version.rb
|
|
74
|
-
homepage: https://
|
|
78
|
+
homepage: https://github.com/NhatAnh/kana_convert
|
|
75
79
|
licenses:
|
|
76
80
|
- MIT
|
|
77
81
|
metadata: {}
|
|
@@ -94,6 +98,6 @@ rubyforge_project:
|
|
|
94
98
|
rubygems_version: 2.5.2
|
|
95
99
|
signing_key:
|
|
96
100
|
specification_version: 4
|
|
97
|
-
summary: Convert hiragana
|
|
101
|
+
summary: Convert hiragana and katakana
|
|
98
102
|
test_files: []
|
|
99
103
|
has_rdoc:
|