credit-card-sms-parser 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/credit-card-sms-parser.gemspec +1 -1
- data/lib/credit_card_sms_parser.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3196611e75e2e2b3d5bda3b2c012c33ab35a636e
|
4
|
+
data.tar.gz: 5971b88f3afc9fc7623b7ef692a1adda67464014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcfd6e73ce04b62abbe86bf4ced64a015293bb6c40552312f93cf9d56e0fe0382fc3f8f670912433b37bbde2f671364a5a7ffff3df4efc84c586ba43c7715d4e
|
7
|
+
data.tar.gz: 6a98aab4864122da12e64e1819ed45314eca693dac1b22065282d5c6ff1bda3cfd8af25e387dcc66bf4e59cbc293b89f22c090dbb490631fde86367be7675436
|
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'credit-card-sms-parser'
|
7
|
-
spec.version = '0.3.
|
7
|
+
spec.version = '0.3.4'
|
8
8
|
spec.authors = %w(Hanson Benjamin)
|
9
9
|
spec.email = %w(jehokim@live.com)
|
10
10
|
if spec.respond_to?(:metadata)
|
@@ -18,6 +18,7 @@ class KoreanCreditCardLexer < RLTK::Lexer
|
|
18
18
|
rule(/[\p{Hangul}\*]{2,4}님/) { |t| [:user_name, t]}
|
19
19
|
rule(/누적[\s:\-]?[\d,\-]+원/) { |t| [:money_total, t.to_num] }
|
20
20
|
rule(/누적-[\d,\-]+원/) { |t| [:money_total, t.to_num] }
|
21
|
+
rule(/잔액[\d,\-]+원?/) { |t| [:remain_total, t.to_num] }
|
21
22
|
rule(/[\d,\-]+원?/) { |t| [:money, t.to_num] }
|
22
23
|
rule(/\(주\)\p{Hangul}+/) {|t| [:shop_name, t[3..-1]]}
|
23
24
|
rule(/\p{Hangul}+\([\d\*]{4}\)/) {|t| [:card, t]}
|
@@ -41,6 +42,7 @@ class KoreanCreditCardLexer < RLTK::Lexer
|
|
41
42
|
rule(/\s/) {|t| [:space, t]}
|
42
43
|
end
|
43
44
|
|
45
|
+
require 'awesome_print'
|
44
46
|
module CreditCardSmsParser
|
45
47
|
CARD_MAP = {
|
46
48
|
'15776200' => '현대카드',
|
@@ -63,7 +65,7 @@ module CreditCardSmsParser
|
|
63
65
|
end
|
64
66
|
|
65
67
|
h.reject {|key, _|
|
66
|
-
key == :header || key == :type || key == :punctuation || key == :space
|
68
|
+
key == :header || key == :type || key == :punctuation || key == :space || key == :EOS
|
67
69
|
}
|
68
70
|
end
|
69
71
|
end
|