Skip to content
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

add similar hiragana characters #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/components/ChooseCharacters/ChooseCharacters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ class ChooseCharacters extends Component {
const thisKana = kanaDictionary[whichKana];
let rows = [];
Object.keys(thisKana).forEach((groupName, idx) => {
if(groupName == "h_group11_a" || groupName == "k_group13_a")
if(groupName === "h_group11_a" || groupName === "k_group13_a")
rows.push(this.alternativeToggleRow(whichKana, "_a", showAlternatives));
if(groupName == "k_group11_s")
if(groupName === "k_group11_s" || groupName === 'h_group27_s')
rows.push(this.alternativeToggleRow(whichKana, "_s", showSimilars));

if((!groupName.endsWith("a") || showAlternatives) &&
Expand Down Expand Up @@ -219,7 +219,11 @@ class ChooseCharacters extends Component {
<div className="panel panel-default">
<div className="panel-heading">Hiragana · ひらがな</div>
<div className="panel-body selection-areas">
{this.showGroupRows('hiragana', this.state.showAlternatives.indexOf('hiragana') >= 0)}
{this.showGroupRows(
'hiragana',
this.state.showAlternatives.indexOf('hiragana') >= 0,
this.state.showSimilars.indexOf('hiragana') >= 0
)}
</div>
<div className="panel-footer text-center">
<a href="javascript:;" onClick={()=>this.selectAll('hiragana')}>All</a> &nbsp;&middot;&nbsp; <a href="javascript:;"
Expand All @@ -233,7 +237,11 @@ class ChooseCharacters extends Component {
<div className="panel panel-default">
<div className="panel-heading">Katakana · カタカナ</div>
<div className="panel-body selection-areas">
{this.showGroupRows('katakana', this.state.showAlternatives.indexOf('katakana') >= 0, this.state.showSimilars.indexOf('katakana') >= 0)}
{this.showGroupRows(
'katakana',
this.state.showAlternatives.indexOf('katakana') >= 0,
this.state.showSimilars.indexOf('katakana') >= 0
)}
</div>
<div className="panel-footer text-center">
<a href="javascript:;" onClick={()=>this.selectAll('katakana')}>All</a> &nbsp;&middot;&nbsp; <a href="javascript:;"
Expand Down
8 changes: 7 additions & 1 deletion src/data/kanaDictionary.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

export const kanaDictionary = {
'hiragana': {
'h_group1': { characters: { 'あ': ['a'], 'い': ['i'], 'う': ['u'], 'え': ['e'], 'お': ['o'] } },
Expand Down Expand Up @@ -25,7 +26,12 @@ export const kanaDictionary = {
'h_group23_a': { characters: { 'ぎゃ': ['gya'], 'ぎゅ': ['gyu'], 'ぎょ': ['gyo'] } },
'h_group24_a': { characters: { 'じゃ': ['ja','jya'], 'じゅ': ['ju','jyu'], 'じょ': ['jo','jyo'] } },
'h_group25_a': { characters: { 'びゃ': ['bya'], 'びゅ': ['byu'], 'びょ': ['byo'] } },
'h_group26_a': { characters: { 'ぴゃ': ['pya'], 'ぴゅ': ['pyu'], 'ぴょ': ['pyo'] } }
'h_group26_a': { characters: { 'ぴゃ': ['pya'], 'ぴゅ': ['pyu'], 'ぴょ': ['pyo'] } },
h_group27_s: { characters: { 'さ': ['sa'], 'ら': ['ra'], 'き': ['ki'], 'ち': ['chi','ti'] } },
h_group28_s: { characters: { 'な': ['na'], 'は': ['ha'], } },
h_group29_s: { characters: { 'わ': ['wa'], 'れ': ['re'], 'ね': ['ne'], } },
h_group30_s: { characters: { 'め': ['me'], 'の': ['no'], 'ぬ': ['nu'], } },
h_group31_s: { characters: { 'る': ['ru'], 'ろ': ['ro'] } },
},
'katakana': {
'k_group1': { characters: { 'ア': ['a'], 'イ': ['i'], 'ウ': ['u'], 'エ': ['e'], 'オ': ['o'] } },
Expand Down