credit-card-sms-parser 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/credit-card-sms-parser.gemspec +1 -1
- data/lib/credit_card_sms_parser.rb +23 -22
- 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: 60bd0eebf64cda854c582b0f660cfe171f67c4ab
|
4
|
+
data.tar.gz: 9015d4d3912ff88d77b840ad6bd5e773a22eae0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e82bf0c07d589244a5880fc0d72954eced2a811265324b8a1a80ed56660c554a46beb7c102c63c64249c32f058a8dc201f9483176b8aa3fba099d09b0998321
|
7
|
+
data.tar.gz: 986d0e8a0fc77d022473436bfa5cfc57d058fea1032a7dcabdc9a48bf64ab581dcb74296c8b3dac6704b2c05ab270d2b536c2b68c10a082cbedb516a79e2db6f
|
data/README.md
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.
|
7
|
+
spec.version = '0.3.0'
|
8
8
|
spec.authors = %w(Hanson Benjamin)
|
9
9
|
spec.email = %w(jehokim@live.com)
|
10
10
|
if spec.respond_to?(:metadata)
|
@@ -12,32 +12,33 @@ class String
|
|
12
12
|
end
|
13
13
|
|
14
14
|
class KoreanCreditCardLexer < RLTK::Lexer
|
15
|
-
rule(/\[Web발신\]/) { |t| [:
|
16
|
-
rule(/\(Web발신\)/) { |t| [:
|
17
|
-
rule(/체크카드출금/) { |t| [:
|
18
|
-
rule(/[\p{Hangul}\*]{2,4}님/) { |t| [:
|
19
|
-
rule(/누적[\s:\-]?[\d,\-]+원/) { |t| [:
|
20
|
-
rule(/누적-[\d,\-]+원/) { |t| [:
|
21
|
-
rule(/[\d,\-]+원/) { |t| [:
|
22
|
-
rule(/\(주\)\p{Hangul}+/) {|t| [:
|
23
|
-
rule(/\p{Hangul}+\([\d\*]{4}\)/) {|t| [:
|
24
|
-
rule(/\S+은행/) {|t| [:
|
25
|
-
rule(
|
26
|
-
rule(/\
|
27
|
-
rule(/\d\d
|
28
|
-
rule(
|
29
|
-
rule(
|
30
|
-
rule(
|
15
|
+
rule(/\[Web발신\]/) { |t| [:header, t]}
|
16
|
+
rule(/\(Web발신\)/) { |t| [:header, t]}
|
17
|
+
rule(/체크카드출금/) { |t| [:header, t]}
|
18
|
+
rule(/[\p{Hangul}\*]{2,4}님/) { |t| [:user_name, t]}
|
19
|
+
rule(/누적[\s:\-]?[\d,\-]+원/) { |t| [:money_total, t.to_num] }
|
20
|
+
rule(/누적-[\d,\-]+원/) { |t| [:money_total, t.to_num] }
|
21
|
+
rule(/[\d,\-]+원/) { |t| [:money, t.to_num] }
|
22
|
+
rule(/\(주\)\p{Hangul}+/) {|t| [:shop, t[3..-1]]}
|
23
|
+
rule(/\p{Hangul}+\([\d\*]{4}\)/) {|t| [:card, t]}
|
24
|
+
rule(/\S+은행/) {|t| [:bank, t]}
|
25
|
+
rule(/KEB하나/) {|t| [:bank, t]}
|
26
|
+
rule(/\S+카드/) {|t| [:card, t]}
|
27
|
+
rule(/\d\d\/\d\d/) {|t| [:date, t]}
|
28
|
+
rule(/\d\d:\d\d/) {|t| [:time, t]}
|
29
|
+
rule(/일시불/) { :type }
|
30
|
+
rule(/^잔액$/) { :type }
|
31
|
+
rule(/주식회사\p{Hangul}+/) {|t| [:shop_name, t[4..-1]]}
|
31
32
|
rule(/^\p{Hangul}+( +\p{Hangul}+)*?$/) { |t|
|
32
33
|
t.chomp!(' 사용')
|
33
34
|
t.chomp!(' 일시불')
|
34
|
-
[:
|
35
|
+
[:shop_name, t.strip]
|
35
36
|
}
|
36
|
-
rule(/[A-Za-z\p{Hangul}]+/) {|t| [:
|
37
|
-
rule(
|
38
|
-
rule(/[\p{
|
39
|
-
rule(/[\d\*]+/) { :
|
40
|
-
rule(/\s/) {|t| [:
|
37
|
+
rule(/[A-Za-z\p{Hangul}]+/) {|t| [:shop_name, t.strip]}
|
38
|
+
rule(/[\p{L}]+/) {|t| [:word, t]}
|
39
|
+
rule(/[\p{P}]+/) {|t| [:punctuation, t]}
|
40
|
+
rule(/[\d\*]+/) { :number }
|
41
|
+
rule(/\s/) {|t| [:space, t]}
|
41
42
|
end
|
42
43
|
|
43
44
|
module CreditCardSmsParser
|