Skip to content

Commit

Permalink
Change structures for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke Hirao committed Mar 4, 2019
1 parent 99a079a commit aa9ace6
Show file tree
Hide file tree
Showing 316 changed files with 5,170 additions and 2,796 deletions.
29 changes: 29 additions & 0 deletions bin/jaco-cli.js
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();
}
6 changes: 3 additions & 3 deletions src/jaco-cli.ts → bin/jaco-cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as commander from 'commander';
import * as fs from 'fs';

import toHiragana from './fn/toHiragana';
import toKatakana from './fn/toKatakana';
import toHiragana from '../fn/toHiragana';
import toKatakana from '../fn/toKatakana';

const VERSION = '2.0.0';
const VERSION = require('../package.json').version;

function extruct(path: string): string {
let str: string = path;
Expand Down
File renamed without changes.
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.
7 changes: 7 additions & 0 deletions const/ALPHA_CHARS.js
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.
7 changes: 7 additions & 0 deletions const/DIGIT_CHARS.js
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.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]
*
*/
export declare const FULLWIDTH_ALPHANUMERIC_CHARS_WITH_SIGN = "!-⦅";
export declare const FULLWIDTH_ALPHANUMERIC_CHARS_WITH_SIGN = "\uFF01-\uFF5F";
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';
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";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]
*
*/
export declare const FULLWIDTH_ALPHA_CHARS = "A-Za-z";
export var FULLWIDTH_ALPHA_CHARS = '\uFF21-\uFF3A\uFF41-\uFF5A';
File renamed without changes.
7 changes: 7 additions & 0 deletions const/FULLWIDTH_DIGIT_CHARS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* 全角数字
*
* [0123456789]
*
*/
export declare const FULLWIDTH_DIGIT_CHARS = "\uFF10-\uFF19";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [0123456789]
*
*/
export declare const FULLWIDTH_DIGIT_CHARS = "0-9";
export var FULLWIDTH_DIGIT_CHARS = '\uFF10-\uFF19';
File renamed without changes.
7 changes: 7 additions & 0 deletions const/FULLWIDTH_SIGN_CHARS.d.ts
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";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]
*
*/
export declare const FULLWIDTH_SIGN_CHARS = "!-/:-@[-`{-~";
export var FULLWIDTH_SIGN_CHARS = '\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF5E';
File renamed without changes.
7 changes: 7 additions & 0 deletions const/HIRAGANA_CHARS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ひらがな
*
* [ぁ-ゖゝ-ゟ]
*
*/
export declare const HIRAGANA_CHARS = "\u3041-\u3096\u309D-\u309F";
9 changes: 9 additions & 0 deletions const/HIRAGANA_CHARS.js
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.
7 changes: 7 additions & 0 deletions const/HIRAGANA_CHARS_IGNORE_ITERATION_MARKS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ひらがな(繰り返し記号・合字なし)
*
* [ぁ-ゖ]
*
*/
export declare const HIRAGANA_CHARS_IGNORE_ITERATION_MARKS = "\u3041-\u3096";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [ぁ-ゖ]
*
*/
export declare const HIRAGANA_CHARS_IGNORE_ITERATION_MARKS = "ぁ-ゖ";
export var HIRAGANA_CHARS_IGNORE_ITERATION_MARKS = '\u3041-\u3096';
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
* @deprecated
*
*/
export declare const JAPANESE_SIGN_CHARS = " -〶・~";
export declare const JAPANESE_SIGN_CHARS = "\u3000-\u3036\u30FB\uFF5E";
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* 日本語で使用される記号
*
Expand All @@ -12,4 +9,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
* @deprecated
*
*/
exports.JAPANESE_SIGN_CHARS = "\u3000-\u3036\u30FB\uFF5E";
export var JAPANESE_SIGN_CHARS = '\u3000-\u3036\u30FB\uFF5E';
File renamed without changes.
7 changes: 7 additions & 0 deletions const/KANA_COMMON_CAHRS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* 濁点/半濁点(結合文字含む)・長音符
*
* [゛゜ー]
*
*/
export declare const KANA_COMMON_CAHRS = "\u3099-\u309C\u30FC";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [゛゜ー]
*
*/
export declare const KANA_COMMON_CAHRS = "゙-゜ー";
export var KANA_COMMON_CAHRS = '\u3099-\u309C\u30FC';
File renamed without changes.
7 changes: 7 additions & 0 deletions const/KATAKANA_CHARS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* カタカナ
*
* [ァ-ヺヽ-ヿ]
*
*/
export declare const KATAKANA_CHARS = "\u30A1-\u30FA\u30FD\u30FF";
9 changes: 9 additions & 0 deletions const/KATAKANA_CHARS.js
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.
7 changes: 7 additions & 0 deletions const/KATAKANA_CHARS_IGNORE_ITERATION_MARKS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* カタカナ(繰り返し記号・合字なし)
*
* [ァ-ヺ]
*
*/
export declare const KATAKANA_CHARS_IGNORE_ITERATION_MARKS = "\u30A1-\u30FA";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* [ァ-ヺ]
*
*/
export declare const KATAKANA_CHARS_IGNORE_ITERATION_MARKS = "ァ-ヺ";
export var KATAKANA_CHARS_IGNORE_ITERATION_MARKS = '\u30A1-\u30FA';
10 changes: 10 additions & 0 deletions const/NARROW_JAPANESE_SIGN_CHARS.d.ts
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";
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @deprecated
*
*/
export declare const NARROW_JAPANESE_SIGN_CHARS = "。-・";
export var NARROW_JAPANESE_SIGN_CHARS = '\uFF61-\uFF65';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
* @deprecated
*
*/
export declare const NARROW_KATAKANA_CHARS = "ヲ-゚";
export declare const NARROW_KATAKANA_CHARS = "\uFF66-\uFF9F";
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* 半角カタカナ
*
Expand All @@ -13,4 +10,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
* @deprecated
*
*/
exports.NARROW_KATAKANA_CHARS = "\uFF66-\uFF9F";
export var NARROW_KATAKANA_CHARS = '\uFF66-\uFF9F';
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions const/SIGN_CHARS.js
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.
Loading

0 comments on commit aa9ace6

Please sign in to comment.