-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(data): Refactor wordSearch
and other methods for clarity and maintainability
#1436
Open
tora-pan
wants to merge
30
commits into
melink14:main
Choose a base branch
from
tora-pan:refactor(data)_refactor-word-search
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7c94ddc
refactor(data): Refactor wordSearch to use lookup
tora-pan 2ea4ed6
refactor(data): Remove missed console.logs
tora-pan e509cd3
refactor(data): Cherry pick test from other branch to follow contrib …
tora-pan 5b7d512
refactor(data): Remove commented out code
tora-pan b0770b5
Revert "refactor(data): Cherry pick test from other branch to follow …
tora-pan 1e093f1
Revert "refactor(data): Remove commented out code"
tora-pan fcea7eb
refactor(data): Remove accidently added file
tora-pan 968c518
test(visual): Update baselines with new screenshots
github-actions[bot] ddb8635
Merge branch 'main' into refactor(data)_refactor-word-search
melink14 ba9349a
refactor(data): Fix regression bug and clean up test styling
tora-pan 8415bfa
refactor(data): Fix logic causing regression and test styling
tora-pan 912fd4a
refactor(data): Replace null type to wordSearch
tora-pan 2f5637b
test(visual): Update baselines with new screenshots
github-actions[bot] 35a9eb6
refactor(data): Comment out exec path for web-test-runner
tora-pan 8b5a4ce
refactor(data): Fix logic causing regressions
tora-pan bea4823
Merge branch 'main' into refactor(data)_refactor-word-search
tora-pan 5a7a430
style: Fix lint/formatting errors
github-actions[bot] 5994c34
refactor(data): Fix merge conflicts from different stashes
tora-pan 4cf1bee
refactor(data): Fix stashing mess
tora-pan f9c922c
test(visual): Update baselines with new screenshots
github-actions[bot] a457d52
refactor(data): Move normalizationMap to own file
tora-pan 912fc7a
style: Fix lint/formatting errors
github-actions[bot] a9815b7
refactor(data): Revert deinflect method and types
tora-pan 5e6f6d2
refactor(data): Add non kana break to hiragana conversion
tora-pan 9e9af02
refactor(data): Fix selection regression bug, remove console log
tora-pan 4b4ca61
test(visual): Update baselines with new screenshots
github-actions[bot] 61878fe
refactor(data): Revert execPath for web-test-runner-config
tora-pan ccc8bcd
test(visual): Update baselines with new screenshots
github-actions[bot] 92431c4
refactor(data): Add explicit check for halfWidthKatakana to converToH…
tora-pan 448994a
Merge remote-tracking branch 'upstream/main' into refactor(data)_refa…
tora-pan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,186 @@ | ||
export const kanaToHiraganaNormalizationMap: Record<string, string> = { | ||
ァ: 'ぁ', | ||
ア: 'あ', | ||
ィ: 'ぃ', | ||
イ: 'い', | ||
ゥ: 'ぅ', | ||
ウ: 'う', | ||
ェ: 'ぇ', | ||
エ: 'え', | ||
ォ: 'ぉ', | ||
オ: 'お', | ||
カ: 'か', | ||
ガ: 'が', | ||
キ: 'き', | ||
ギ: 'ぎ', | ||
ク: 'く', | ||
グ: 'ぐ', | ||
ケ: 'け', | ||
ゲ: 'げ', | ||
コ: 'こ', | ||
ゴ: 'ご', | ||
サ: 'さ', | ||
ザ: 'ざ', | ||
シ: 'し', | ||
ジ: 'じ', | ||
ス: 'す', | ||
ズ: 'ず', | ||
セ: 'せ', | ||
ゼ: 'ぜ', | ||
ソ: 'そ', | ||
ゾ: 'ぞ', | ||
タ: 'た', | ||
ダ: 'だ', | ||
チ: 'ち', | ||
ヂ: 'ぢ', | ||
ッ: 'っ', | ||
ツ: 'つ', | ||
ヅ: 'づ', | ||
テ: 'て', | ||
デ: 'で', | ||
ト: 'と', | ||
ド: 'ど', | ||
ナ: 'な', | ||
ニ: 'に', | ||
ヌ: 'ぬ', | ||
ネ: 'ね', | ||
ノ: 'の', | ||
ハ: 'は', | ||
バ: 'ば', | ||
パ: 'ぱ', | ||
ヒ: 'ひ', | ||
ビ: 'び', | ||
ピ: 'ぴ', | ||
フ: 'ふ', | ||
ブ: 'ぶ', | ||
プ: 'ぷ', | ||
ヘ: 'へ', | ||
ベ: 'べ', | ||
ペ: 'ぺ', | ||
ホ: 'ほ', | ||
ボ: 'ぼ', | ||
ポ: 'ぽ', | ||
マ: 'ま', | ||
ミ: 'み', | ||
ム: 'む', | ||
メ: 'め', | ||
モ: 'も', | ||
ャ: 'ゃ', | ||
ヤ: 'や', | ||
ュ: 'ゅ', | ||
ユ: 'ゆ', | ||
ョ: 'ょ', | ||
ヨ: 'よ', | ||
ラ: 'ら', | ||
リ: 'り', | ||
ル: 'る', | ||
レ: 'れ', | ||
ロ: 'ろ', | ||
ヮ: 'ゎ', | ||
ワ: 'わ', | ||
ヲ: 'を', | ||
ン: 'ん', | ||
ヴ: 'ゔ', | ||
ァ: 'ぁ', | ||
ア: 'あ', | ||
ィ: 'ぃ', | ||
イ: 'い', | ||
ゥ: 'ぅ', | ||
ウ: 'う', | ||
ェ: 'ぇ', | ||
エ: 'え', | ||
ォ: 'ぉ', | ||
オ: 'お', | ||
カ: 'か', | ||
ガ: 'が', | ||
キ: 'き', | ||
ギ: 'ぎ', | ||
ク: 'く', | ||
グ: 'ぐ', | ||
ケ: 'け', | ||
ゲ: 'げ', | ||
コ: 'こ', | ||
ゴ: 'ご', | ||
サ: 'さ', | ||
ザ: 'ざ', | ||
シ: 'し', | ||
ジ: 'じ', | ||
ス: 'す', | ||
ズ: 'ず', | ||
セ: 'せ', | ||
ゼ: 'ぜ', | ||
ソ: 'そ', | ||
ゾ: 'ぞ', | ||
タ: 'た', | ||
ダ: 'だ', | ||
チ: 'ち', | ||
ヂ: 'ぢ', | ||
ッ: 'っ', | ||
ツ: 'つ', | ||
ヅ: 'づ', | ||
テ: 'て', | ||
デ: 'で', | ||
ト: 'と', | ||
ド: 'ど', | ||
ナ: 'な', | ||
ニ: 'に', | ||
ヌ: 'ぬ', | ||
ネ: 'ね', | ||
ノ: 'の', | ||
ハ: 'は', | ||
バ: 'ば', | ||
パ: 'ぱ', | ||
ヒ: 'ひ', | ||
ビ: 'び', | ||
ピ: 'ぴ', | ||
フ: 'ふ', | ||
ブ: 'ぶ', | ||
プ: 'ぷ', | ||
ヘ: 'へ', | ||
ベ: 'べ', | ||
ペ: 'ぺ', | ||
ホ: 'ほ', | ||
ボ: 'ぼ', | ||
ポ: 'ぽ', | ||
マ: 'ま', | ||
ミ: 'み', | ||
ム: 'む', | ||
メ: 'め', | ||
モ: 'も', | ||
ャ: 'ゃ', | ||
ヤ: 'や', | ||
ュ: 'ゅ', | ||
ユ: 'ゆ', | ||
ョ: 'ょ', | ||
ヨ: 'よ', | ||
ラ: 'ら', | ||
リ: 'り', | ||
ル: 'る', | ||
レ: 'れ', | ||
ロ: 'ろ', | ||
ワ: 'わ', | ||
ヲ: 'を', | ||
ン: 'ん', | ||
// ヴ: 'ゔ', | ||
}; | ||
|
||
export enum KANA { | ||
HIRAGANA_START = 0x3041, | ||
HIRAGANA_END = 0x309f, | ||
KATAKANA_START = 0x30a0, | ||
KATAKANA_END = 0x30ff, | ||
HW_KATAKANA_START = 0xff66, | ||
HW_KATAKANA_END = 0xff9d, | ||
} | ||
|
||
export enum PUNCTUATION { | ||
//characters below are in order for easy copy | ||
//Note:3rd character is invisible but copyable | ||
//Note:4th and 5th look the same but are actually different. | ||
// ゙, ゚, , ~, 〜 | ||
VOICED_MARK = 0xff9e, | ||
SEMI_VOICED_MARK = 0xff9f, | ||
ZERO_WIDTH_JOINER = 0x200c, | ||
J_TILDE = 0xff5e, | ||
HW_J_TILDE = 0x301c, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be constant case? (and readonly I guess)