-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 폴더 구조 플랫화 * 폴더 경로 수정 * constant 파일 분리 * vitest absoulte path
- Loading branch information
Showing
57 changed files
with
547 additions
and
562 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,136 @@ | ||
export const _JASO_HANGUL_NFD = [...'각힣'.normalize('NFD')].map(char => char.charCodeAt(0)); // NFC 에 정의되지 않은 문자는 포함하지 않음 | ||
|
||
export const COMPLETE_HANGUL_START_CHARCODE = '가'.charCodeAt(0); | ||
export const COMPLETE_HANGUL_END_CHARCODE = '힣'.charCodeAt(0); | ||
|
||
export const NUMBER_OF_JONGSEONG = 28; | ||
export const NUMBER_OF_JUNGSEONG = 21; | ||
|
||
/** | ||
* ㄱ -> 'ㄱ' | ||
* ㄳ -> 'ㄱㅅ' 으로 나눈다. | ||
*/ | ||
export const DISASSEMBLED_CONSONANTS_BY_CONSONANT = { | ||
// 종성이 없는 경우 '빈' 초성으로 관리하는 것이 편리하여, 빈 문자열도 포함한다. | ||
'': '', | ||
ㄱ: 'ㄱ', | ||
ㄲ: 'ㄲ', | ||
ㄳ: 'ㄱㅅ', | ||
ㄴ: 'ㄴ', | ||
ㄵ: 'ㄴㅈ', | ||
ㄶ: 'ㄴㅎ', | ||
ㄷ: 'ㄷ', | ||
ㄸ: 'ㄸ', | ||
ㄹ: 'ㄹ', | ||
ㄺ: 'ㄹㄱ', | ||
ㄻ: 'ㄹㅁ', | ||
ㄼ: 'ㄹㅂ', | ||
ㄽ: 'ㄹㅅ', | ||
ㄾ: 'ㄹㅌ', | ||
ㄿ: 'ㄹㅍ', | ||
ㅀ: 'ㄹㅎ', | ||
ㅁ: 'ㅁ', | ||
ㅂ: 'ㅂ', | ||
ㅃ: 'ㅃ', | ||
ㅄ: 'ㅂㅅ', | ||
ㅅ: 'ㅅ', | ||
ㅆ: 'ㅆ', | ||
ㅇ: 'ㅇ', | ||
ㅈ: 'ㅈ', | ||
ㅉ: 'ㅉ', | ||
ㅊ: 'ㅊ', | ||
ㅋ: 'ㅋ', | ||
ㅌ: 'ㅌ', | ||
ㅍ: 'ㅍ', | ||
ㅎ: 'ㅎ', | ||
} as const; | ||
|
||
export const DISASSEMBLED_VOWELS_BY_VOWEL = { | ||
ㅏ: 'ㅏ', | ||
ㅐ: 'ㅐ', | ||
ㅑ: 'ㅑ', | ||
ㅒ: 'ㅒ', | ||
ㅓ: 'ㅓ', | ||
ㅔ: 'ㅔ', | ||
ㅕ: 'ㅕ', | ||
ㅖ: 'ㅖ', | ||
ㅗ: 'ㅗ', | ||
ㅘ: 'ㅗㅏ', | ||
ㅙ: 'ㅗㅐ', | ||
ㅚ: 'ㅗㅣ', | ||
ㅛ: 'ㅛ', | ||
ㅜ: 'ㅜ', | ||
ㅝ: 'ㅜㅓ', | ||
ㅞ: 'ㅜㅔ', | ||
ㅟ: 'ㅜㅣ', | ||
ㅠ: 'ㅠ', | ||
ㅡ: 'ㅡ', | ||
ㅢ: 'ㅡㅣ', | ||
ㅣ: 'ㅣ', | ||
} as const; | ||
|
||
/** | ||
* 초성으로 올 수 있는 한글 글자 | ||
*/ | ||
export const CHOSEONGS = [ | ||
'ㄱ', | ||
'ㄲ', | ||
'ㄴ', | ||
'ㄷ', | ||
'ㄸ', | ||
'ㄹ', | ||
'ㅁ', | ||
'ㅂ', | ||
'ㅃ', | ||
'ㅅ', | ||
'ㅆ', | ||
'ㅇ', | ||
'ㅈ', | ||
'ㅉ', | ||
'ㅊ', | ||
'ㅋ', | ||
'ㅌ', | ||
'ㅍ', | ||
'ㅎ', | ||
] as const; | ||
|
||
/** | ||
* 중성으로 올 수 있는 한글 글자 | ||
*/ | ||
export const JUNSEONGS = Object.values(DISASSEMBLED_VOWELS_BY_VOWEL); | ||
|
||
/** | ||
* 종성으로 올 수 있는 한글 글자 | ||
*/ | ||
export const JONGSEONGS = ( | ||
[ | ||
'', | ||
'ㄱ', | ||
'ㄲ', | ||
'ㄳ', | ||
'ㄴ', | ||
'ㄵ', | ||
'ㄶ', | ||
'ㄷ', | ||
'ㄹ', | ||
'ㄺ', | ||
'ㄻ', | ||
'ㄼ', | ||
'ㄽ', | ||
'ㄾ', | ||
'ㄿ', | ||
'ㅀ', | ||
'ㅁ', | ||
'ㅂ', | ||
'ㅄ', | ||
'ㅅ', | ||
'ㅆ', | ||
'ㅇ', | ||
'ㅈ', | ||
'ㅊ', | ||
'ㅋ', | ||
'ㅌ', | ||
'ㅍ', | ||
'ㅎ', | ||
] as const | ||
).map(consonant => DISASSEMBLED_CONSONANTS_BY_CONSONANT[consonant]); |
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 @@ | ||
export * from './amountToHangul'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './assemble'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './canBe'; |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
src/combineCharacter.ts → src/combineCharacter/combineCharacter.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
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 @@ | ||
export * from './combineCharacter'; |
Oops, something went wrong.