-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
7 changed files
with
157 additions
and
56 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
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,30 @@ | ||
// | ||
// KanaColumns.swift | ||
// | ||
// | ||
// Created by Mac Van Anh on 8/31/20. | ||
// Copyright © 2020 Mac Van Anh. All rights reserved. | ||
// | ||
|
||
|
||
import Foundation | ||
|
||
public struct KanaColumns { | ||
|
||
public enum Keys: Int { | ||
case a = 0, ka, ga, sa , za , ta , da, na, ha, ba, pa, ma, ya, ra, wa, n, kya, gya, ja, sha, cha, nya, hya, bya, pya, mya, rya | ||
} | ||
|
||
public static var seion: [KanaColumns.Keys] { | ||
return [.a, .ka, .sa, .ta, .na, .ha, .ma, .ya, .ra, .wa, .n] | ||
} | ||
|
||
public static var dakuon: [KanaColumns.Keys] { | ||
return [.ga, .za, .da, .ba, .pa] | ||
} | ||
|
||
public static var yoon: [KanaColumns.Keys] { | ||
return [.kya, .gya, .ja, .sha, .cha, .nya, .hya, .bya, .pya, .mya, .rya] | ||
} | ||
|
||
} |
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,31 @@ | ||
// | ||
// KanaColumnsTestCase.swift | ||
// | ||
// | ||
// Created by Mac Van Anh on 9/3/20. | ||
// | ||
|
||
import XCTest | ||
@testable import Kana | ||
|
||
final class KanaColumnsTestCase: XCTestCase { | ||
func test_seionColumns() { | ||
let seionColumns = [0, 1, 3, 5, 7, 8, 11, 12, 13, 14, 15] | ||
|
||
XCTAssertEqual(seionColumns, KanaColumns.seion.map { $0.rawValue }) | ||
} | ||
|
||
func test_dakuonColumns() { | ||
let dakuonColumns = [2, 4, 6, 9, 10] | ||
|
||
XCTAssertEqual(dakuonColumns, KanaColumns.dakuon.map { $0.rawValue }) | ||
|
||
} | ||
|
||
func test_yoonColumns() { | ||
let yoonColumns = [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26] | ||
|
||
XCTAssertEqual(yoonColumns, KanaColumns.yoon.map { $0.rawValue }) | ||
|
||
} | ||
} |
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