credit-card-sms-parser 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +5 -0
- data/LICENSE +27 -0
- data/README.md +2 -0
- data/credit-card-sms-parser.gemspec +1 -1
- data/lib/credit_card_sms_parser.rb +6 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f69894c240f9b44eeec232bbd138dc33bceaf45
|
4
|
+
data.tar.gz: 9969ed698d9b47095c1a6c91b7b156bf77531e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfdb9df82c000e4737cef345c433a4488e1c7080df6de060b53b6ae41a5b2250d5fc39b7dc59165f3f9984d0f8ee243d3467378ceae68831ecb2a0ada4675cde
|
7
|
+
data.tar.gz: 588bc42731ce1b78539bdb143edc5bddcb35e2f5962fb3563dc1273935a92430f9caac53f8d9d7631a849a2f7098375714dd924492911b8acd463c2f1a630200
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
|
2
|
+
## Submitting Pull Requests
|
3
|
+
|
4
|
+
Before changes can be accepted a Contributor Licensing Agreement for [Individual](https://docs.google.com/forms/d/1d2R9aVafHTasTYirq-qZx_lx20Obss0ufUS-OtLpu20/viewform) | [Company](https://docs.google.com/forms/d/1hj5s1bkbmO1OP-UKnSNS6dsDkL1jFDL2XZ5d4IIFdb4/viewform) must be completed. You will be prompted to accept the CLA when you submit your first pull request. If you are Korean, send e-mail to <oss@daumkakao.com> for agree to the privacy. Then we will send you a CLA copy.
|
5
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
Copyright (c) 2015, Daum Kakao Corp.
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
8
|
+
list of conditions and the following disclaimer.
|
9
|
+
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
12
|
+
and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
* Neither the name Facebook nor the names of its contributors may be used to
|
15
|
+
endorse or promote products derived from this software without specific
|
16
|
+
prior written permission.
|
17
|
+
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
22
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
25
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
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.3.
|
7
|
+
spec.version = '0.3.2'
|
8
8
|
spec.authors = %w(Hanson Benjamin)
|
9
9
|
spec.email = %w(jehokim@live.com)
|
10
10
|
if spec.respond_to?(:metadata)
|
@@ -18,7 +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,\-]
|
21
|
+
rule(/[\d,\-]+원?/) { |t| [:money, t.to_num] }
|
22
22
|
rule(/\(주\)\p{Hangul}+/) {|t| [:shop_name, t[3..-1]]}
|
23
23
|
rule(/\p{Hangul}+\([\d\*]{4}\)/) {|t| [:card, t]}
|
24
24
|
rule(/\S+은행/) {|t| [:bank, t]}
|
@@ -34,7 +34,7 @@ class KoreanCreditCardLexer < RLTK::Lexer
|
|
34
34
|
t.chomp!(' 일시불')
|
35
35
|
[:shop_name, t.strip]
|
36
36
|
}
|
37
|
-
rule(/[
|
37
|
+
rule(/[0-9A-Za-z\p{Hangul}]+/) {|t| [:shop_name, t.strip]}
|
38
38
|
rule(/[\p{L}]+/) {|t| [:word, t]}
|
39
39
|
rule(/[\p{P}]+/) {|t| [:punctuation, t]}
|
40
40
|
rule(/[\d\*]+/) { :number }
|
@@ -48,6 +48,7 @@ module CreditCardSmsParser
|
|
48
48
|
'16449999' => '국민카드',
|
49
49
|
'15881788' => '국민체크카드',
|
50
50
|
'15884000' => '농협BC카드',
|
51
|
+
'15661000' => '씨티카드',
|
51
52
|
}
|
52
53
|
|
53
54
|
def parse_sms(sms_message, phone_number = nil)
|
@@ -61,6 +62,8 @@ module CreditCardSmsParser
|
|
61
62
|
h.merge(card_company_name: CARD_MAP[phone_number])
|
62
63
|
end
|
63
64
|
|
64
|
-
h
|
65
|
+
h.reject {|key, _|
|
66
|
+
key == :header || key == :type || key == :punctuation || key == :space
|
67
|
+
}
|
65
68
|
end
|
66
69
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credit-card-sms-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hanson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rltk
|
@@ -64,8 +64,10 @@ extensions: []
|
|
64
64
|
extra_rdoc_files: []
|
65
65
|
files:
|
66
66
|
- ".gitignore"
|
67
|
+
- CONTRIBUTING.md
|
67
68
|
- Gemfile
|
68
69
|
- Gemfile.lock
|
70
|
+
- LICENSE
|
69
71
|
- README.md
|
70
72
|
- Rakefile
|
71
73
|
- bin/console
|