Skip to content

Commit

Permalink
chore: Add skip words for image processing
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlab committed Nov 16, 2020
1 parent 6a589eb commit e57da07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ final class ImageAnalyzer {
let creditCardNumber: Regex = #"(?:\d[ -]*?){13,16}"#
let month: Regex = #"(\d{2})\/\d{2}"#
let year: Regex = #"\d{2}\/(\d{2})"#
let wordsToSkip = ["mastercard", "jcb", "visa", "express", "bank", "card", "platinum", "reward", "check", "credit", "american", "express"]
let wordsToSkip = ["mastercard", "jcb", "visa", "express", "bank", "card", "platinum", "reward", "check", "credit", "american", "express", "cashbag", "keb", "nhcard", "global", "hyundai", "zero", "kakaobank", "thru", "authorized", "signature", "authorized signature", "hyundai card", "nonghyup", "payon", "money"]
// These may be contained in the date strings, so ignore them only for names
let invalidNames = ["expiration", "valid", "since", "from", "until", "month", "year", "member", "since"]
let invalidNames = ["expiration", "valid", "since", "from", "until", "month", "year", "member"]
let name: Regex = #"([A-z]{2,}\h([A-z.]+\h)?[A-z]{2,})"#

guard let results = request.results as? [VNRecognizedTextObservation] else { return }
Expand Down
2 changes: 1 addition & 1 deletion Tests/SweetCardScannerTests/SweetCardScannerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ final class SweetCardScannerTests: XCTestCase {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(SweetCardScanner().text, "Hello, World!")
// XCTAssertEqual(SweetCardScanner().text, "Hello, World!")
}

static var allTests = [
Expand Down

0 comments on commit e57da07

Please sign in to comment.