Skip to content

Commit

Permalink
ignore pronunciations after first comma.
Browse files Browse the repository at this point in the history
  • Loading branch information
proxpero committed Mar 11, 2020
1 parent 1d3b304 commit bd268f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Sources/Word/Phoneme+Ahd.swift
Expand Up @@ -85,7 +85,8 @@ public extension String {
while !substring.isEmpty {
for (key, value) in values {
if substring.hasPrefix(",") {
throw Error.init(text: self)
substring = ""
// throw Error.init(text: self)
}
if substring.hasPrefix(key) {
if let char = key.first, isBreak(char: char) {
Expand Down
16 changes: 7 additions & 9 deletions Tests/WordTests/WordTests.swift
Expand Up @@ -17,13 +17,13 @@ final class WordTests: XCTestCase {
XCTAssertEqual(test.1, try test.0.convertAhd())
}

let errors = [
"sər,-sār"
]

for test in errors {
XCTAssertThrowsError(try test.convertAhd())
}
// let errors = [
// "sər,-sār"
// ]
//
// for test in errors {
// XCTAssertThrowsError(try test.convertAhd())
// }
}

func testSyllabize() {
Expand All @@ -36,8 +36,6 @@ final class WordTests: XCTestCase {
XCTAssertEqual(expectation, input.syllabize())
}



static var allTests = [
("testAhdConversion", testAhdConversion),
]
Expand Down

0 comments on commit bd268f7

Please sign in to comment.