-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yusuke Hirao
committed
Mar 4, 2019
1 parent
99a079a
commit aa9ace6
Showing
316 changed files
with
5,170 additions
and
2,796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
var commander = require("commander"); | ||
var fs = require("fs"); | ||
var toHiragana_1 = require("../fn/toHiragana"); | ||
var toKatakana_1 = require("../fn/toKatakana"); | ||
var VERSION = require('../package.json').version; | ||
function extruct(path) { | ||
var str = path; | ||
if (fs.existsSync(path)) { | ||
str = fs.readFileSync(path, 'utf-8'); | ||
} | ||
return str; | ||
} | ||
commander | ||
.version(VERSION) | ||
.usage('[options] <path or string>') | ||
.option('-K, --katakanize <path or string>', 'convert to Katakana', function (path) { | ||
return console.log(toKatakana_1["default"](extruct(path))); | ||
}) | ||
.option('-H, --hiraganize <path or string>', 'convert to Hiragana', function (path) { | ||
return console.log(toHiragana_1["default"](extruct(path))); | ||
}) | ||
.parse(process.argv); | ||
if (process.argv.length <= 2) { | ||
// No arg | ||
console.log(commander.help()); | ||
process.exit(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
5 changes: 1 addition & 4 deletions
5
lib/const/ALPHANUMERIC_CHARS_WITH_SIGN.js → const/ALPHANUMERIC_CHARS_WITH_SIGN.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* 半角英数記号 | ||
* | ||
* [!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~] | ||
* | ||
*/ | ||
exports.ALPHANUMERIC_CHARS_WITH_SIGN = " -~"; | ||
export var ALPHANUMERIC_CHARS_WITH_SIGN = '\u0020-\u007E'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* 半角英字 | ||
* | ||
* [A-Za-z] | ||
* | ||
*/ | ||
export var ALPHA_CHARS = 'A-Za-z'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* 半角数字 | ||
* | ||
* [0-9] | ||
* | ||
*/ | ||
export var DIGIT_CHARS = '0-9'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
...FULLWIDTH_ALPHANUMERIC_CHARS_WITH_SIGN.js → ...FULLWIDTH_ALPHANUMERIC_CHARS_WITH_SIGN.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* 全角英数記号 | ||
* | ||
* [!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~] | ||
* | ||
*/ | ||
exports.FULLWIDTH_ALPHANUMERIC_CHARS_WITH_SIGN = "\uFF01-\uFF5F"; | ||
export var FULLWIDTH_ALPHANUMERIC_CHARS_WITH_SIGN = '\uFF01-\uFF5F'; |
File renamed without changes.
5 changes: 1 addition & 4 deletions
5
lib/const/FULLWIDTH_ALPHA_CHARS.js → const/FULLWIDTH_ALPHA_CHARS.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* 全角英字 | ||
* | ||
* [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz] | ||
* | ||
*/ | ||
exports.FULLWIDTH_ALPHA_CHARS = "\uFF21-\uFF3A\uFF41-\uFF5A"; | ||
export declare const FULLWIDTH_ALPHA_CHARS = "\uFF21-\uFF3A\uFF41-\uFF5A"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* 全角数字 | ||
* | ||
* [0123456789] | ||
* | ||
*/ | ||
export declare const FULLWIDTH_DIGIT_CHARS = "\uFF10-\uFF19"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* 全角記号 | ||
* | ||
* [!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~] | ||
* | ||
*/ | ||
export declare const FULLWIDTH_SIGN_CHARS = "\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF5E"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* ひらがな | ||
* | ||
* [ぁ-ゖゝ-ゟ] | ||
* | ||
*/ | ||
export declare const HIRAGANA_CHARS = "\u3041-\u3096\u309D-\u309F"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
/** | ||
* ひらがな | ||
* | ||
* [ぁ-ゖゝ-ゟ] | ||
* | ||
*/ | ||
exports.HIRAGANA_CHARS = '\u3041-\u3096\u309D-\u309F'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* ひらがな(繰り返し記号・合字なし) | ||
* | ||
* [ぁ-ゖ] | ||
* | ||
*/ | ||
export declare const HIRAGANA_CHARS_IGNORE_ITERATION_MARKS = "\u3041-\u3096"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* 濁点/半濁点(結合文字含む)・長音符 | ||
* | ||
* [゛゜ー] | ||
* | ||
*/ | ||
export declare const KANA_COMMON_CAHRS = "\u3099-\u309C\u30FC"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* カタカナ | ||
* | ||
* [ァ-ヺヽ-ヿ] | ||
* | ||
*/ | ||
export declare const KATAKANA_CHARS = "\u30A1-\u30FA\u30FD\u30FF"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
/** | ||
* カタカナ | ||
* | ||
* [ァ-ヺヽ-ヿ] | ||
* | ||
*/ | ||
exports.KATAKANA_CHARS = '\u30A1-\u30FA\u30FD\u30FF'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* カタカナ(繰り返し記号・合字なし) | ||
* | ||
* [ァ-ヺ] | ||
* | ||
*/ | ||
export declare const KATAKANA_CHARS_IGNORE_ITERATION_MARKS = "\u30A1-\u30FA"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* 半角の日本語で使用される記号 | ||
* | ||
* [。「」、・] | ||
* | ||
* @unused | ||
* @deprecated | ||
* | ||
*/ | ||
export declare const NARROW_JAPANESE_SIGN_CHARS = "\uFF61-\uFF65"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* 記号 | ||
* | ||
* [!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~] | ||
* | ||
*/ | ||
export var SIGN_CHARS = '\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E'; |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.