ofac 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +24 -49
- data/lib/ofac/version.rb +1 -0
- data/test/test_helper.rb +5 -1
- metadata +118 -94
- data/.document +0 -5
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/History.txt +0 -134
- data/PostInstall.txt +0 -11
- data/VERSION.yml +0 -5
- data/generators/ofac_migration/.DS_Store +0 -0
- data/generators/ofac_migration/ofac_migration_generator.rb +0 -12
- data/generators/ofac_migration/templates/.DS_Store +0 -0
- data/generators/ofac_migration/templates/migration.rb +0 -31
- data/nbproject/project.properties +0 -7
- data/nbproject/project.xml +0 -15
- data/ofac.gemspec +0 -129
- data/rdoc/CreateOfacSdns.html +0 -249
- data/rdoc/Ofac.html +0 -434
- data/rdoc/OfacMatch.html +0 -299
- data/rdoc/OfacMigration.html +0 -138
- data/rdoc/OfacMigration/Generators.html +0 -138
- data/rdoc/OfacMigration/Generators/BuildGenerator.html +0 -251
- data/rdoc/OfacSdn.html +0 -209
- data/rdoc/OfacSdnLoader.html +0 -238
- data/rdoc/README_rdoc.html +0 -323
- data/rdoc/String.html +0 -262
- data/rdoc/classes/Ofac.html +0 -411
- data/rdoc/classes/OfacMatch.html +0 -239
- data/rdoc/classes/OfacSdn.html +0 -111
- data/rdoc/classes/OfacSdnLoader.html +0 -190
- data/rdoc/classes/String.html +0 -207
- data/rdoc/created.rid +0 -10
- data/rdoc/files/README_rdoc.html +0 -317
- data/rdoc/files/lib/ofac/models/ofac_rb.html +0 -101
- data/rdoc/files/lib/ofac/models/ofac_sdn_loader_rb.html +0 -110
- data/rdoc/files/lib/ofac/models/ofac_sdn_rb.html +0 -108
- data/rdoc/files/lib/ofac/ofac_match_rb.html +0 -101
- data/rdoc/files/lib/ofac/ruby_string_extensions_rb.html +0 -101
- data/rdoc/files/lib/ofac_rb.html +0 -113
- data/rdoc/fr_class_index.html +0 -31
- data/rdoc/fr_file_index.html +0 -33
- data/rdoc/fr_method_index.html +0 -35
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +0 -96
- data/rdoc/js/darkfish.js +0 -155
- data/rdoc/js/jquery.js +0 -18
- data/rdoc/js/navigation.js +0 -142
- data/rdoc/js/search.js +0 -94
- data/rdoc/js/search_index.js +0 -1
- data/rdoc/js/searcher.js +0 -228
- data/rdoc/lib/generators/ofac_migration/build/build_generator_rb.html +0 -97
- data/rdoc/lib/generators/ofac_migration/build/templates/create_ofac_sdns_rb.html +0 -97
- data/rdoc/lib/ofac/models/ofac_rb.html +0 -97
- data/rdoc/lib/ofac/models/ofac_sdn_loader_rb.html +0 -97
- data/rdoc/lib/ofac/models/ofac_sdn_rb.html +0 -97
- data/rdoc/lib/ofac/ofac_match_rb.html +0 -97
- data/rdoc/lib/ofac/ruby_string_extensions_rb.html +0 -97
- data/rdoc/lib/ofac_rb.html +0 -97
- data/rdoc/rdoc-style.css +0 -208
- data/rdoc/rdoc.css +0 -595
- data/rdoc/table_of_contents.html +0 -120
data/rdoc/classes/String.html
DELETED
@@ -1,207 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: String</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">String</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/ofac/ruby_string_extensions_rb.html">
|
59
|
-
lib/ofac/ruby_string_extensions.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000003">ofac_soundex</a>
|
90
|
-
<a href="#M000004">ofac_sounds_like</a>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
|
97
|
-
<!-- if includes -->
|
98
|
-
|
99
|
-
<div id="section">
|
100
|
-
|
101
|
-
|
102
|
-
<div id="constants-list">
|
103
|
-
<h3 class="section-bar">Constants</h3>
|
104
|
-
|
105
|
-
<div class="name-list">
|
106
|
-
<table summary="Constants">
|
107
|
-
<tr class="top-aligned-row context-row">
|
108
|
-
<td class="context-item-name">Ofac_SoundexChars</td>
|
109
|
-
<td>=</td>
|
110
|
-
<td class="context-item-value">'BPFVCSKGJQXZDTLMNR'</td>
|
111
|
-
</tr>
|
112
|
-
<tr class="top-aligned-row context-row">
|
113
|
-
<td class="context-item-name">Ofac_SoundexNums</td>
|
114
|
-
<td>=</td>
|
115
|
-
<td class="context-item-value">'111122222222334556'</td>
|
116
|
-
</tr>
|
117
|
-
<tr class="top-aligned-row context-row">
|
118
|
-
<td class="context-item-name">Ofac_SoundexCharsEx</td>
|
119
|
-
<td>=</td>
|
120
|
-
<td class="context-item-value">'^' + Ofac_SoundexChars</td>
|
121
|
-
</tr>
|
122
|
-
<tr class="top-aligned-row context-row">
|
123
|
-
<td class="context-item-name">Ofac_SoundexCharsDel</td>
|
124
|
-
<td>=</td>
|
125
|
-
<td class="context-item-value">'^A-Z'</td>
|
126
|
-
</tr>
|
127
|
-
</table>
|
128
|
-
</div>
|
129
|
-
</div>
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
<!-- if method_list -->
|
137
|
-
<div id="methods">
|
138
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
139
|
-
|
140
|
-
<div id="method-M000003" class="method-detail">
|
141
|
-
<a name="M000003"></a>
|
142
|
-
|
143
|
-
<div class="method-heading">
|
144
|
-
<a href="#M000003" class="method-signature">
|
145
|
-
<span class="method-name">ofac_soundex</span><span class="method-args">(census = true)</span>
|
146
|
-
</a>
|
147
|
-
</div>
|
148
|
-
|
149
|
-
<div class="method-description">
|
150
|
-
<p>
|
151
|
-
desc: <a
|
152
|
-
href="http://en.wikipedia.org/wiki/Soundex">en.wikipedia.org/wiki/Soundex</a>
|
153
|
-
</p>
|
154
|
-
<p><a class="source-toggle" href="#"
|
155
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
156
|
-
<div class="method-source-code" id="M000003-source">
|
157
|
-
<pre>
|
158
|
-
<span class="ruby-comment cmt"># File lib/ofac/ruby_string_extensions.rb, line 9</span>
|
159
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ofac_soundex</span>(<span class="ruby-identifier">census</span> = <span class="ruby-keyword kw">true</span>)
|
160
|
-
<span class="ruby-identifier">str</span> = <span class="ruby-identifier">upcase</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">Ofac_SoundexCharsDel</span>).<span class="ruby-identifier">squeeze</span>
|
161
|
-
|
162
|
-
<span class="ruby-identifier">str</span>[<span class="ruby-value">0</span> <span class="ruby-operator">..</span> <span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">str</span>[<span class="ruby-value">1</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>].
|
163
|
-
<span class="ruby-identifier">delete</span>(<span class="ruby-constant">Ofac_SoundexCharsEx</span>).
|
164
|
-
<span class="ruby-identifier">tr</span>(<span class="ruby-constant">Ofac_SoundexChars</span>, <span class="ruby-constant">Ofac_SoundexNums</span>)[<span class="ruby-value">0</span> <span class="ruby-operator">..</span> (<span class="ruby-identifier">census</span> <span class="ruby-value">? </span><span class="ruby-value">2</span> <span class="ruby-operator">:</span> <span class="ruby-value">-1</span>)].
|
165
|
-
<span class="ruby-identifier">ljust</span>(<span class="ruby-value">3</span>, <span class="ruby-value str">'0'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-value str">''</span>
|
166
|
-
<span class="ruby-keyword kw">end</span>
|
167
|
-
</pre>
|
168
|
-
</div>
|
169
|
-
</div>
|
170
|
-
</div>
|
171
|
-
|
172
|
-
<div id="method-M000004" class="method-detail">
|
173
|
-
<a name="M000004"></a>
|
174
|
-
|
175
|
-
<div class="method-heading">
|
176
|
-
<a href="#M000004" class="method-signature">
|
177
|
-
<span class="method-name">ofac_sounds_like</span><span class="method-args">(other, census = true)</span>
|
178
|
-
</a>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
<div class="method-description">
|
182
|
-
<p><a class="source-toggle" href="#"
|
183
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
184
|
-
<div class="method-source-code" id="M000004-source">
|
185
|
-
<pre>
|
186
|
-
<span class="ruby-comment cmt"># File lib/ofac/ruby_string_extensions.rb, line 18</span>
|
187
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ofac_sounds_like</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">census</span> = <span class="ruby-keyword kw">true</span>)
|
188
|
-
<span class="ruby-identifier">ofac_soundex</span>(<span class="ruby-identifier">census</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ofac_soundex</span>(<span class="ruby-identifier">census</span>)
|
189
|
-
<span class="ruby-keyword kw">end</span>
|
190
|
-
</pre>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
|
195
|
-
|
196
|
-
</div>
|
197
|
-
|
198
|
-
|
199
|
-
</div>
|
200
|
-
|
201
|
-
|
202
|
-
<div id="validator-badges">
|
203
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
204
|
-
</div>
|
205
|
-
|
206
|
-
</body>
|
207
|
-
</html>
|
data/rdoc/created.rid
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
Tue, 07 Jan 2014 10:20:16 -0500
|
2
|
-
README.rdoc Tue, 07 Jan 2014 09:55:46 -0500
|
3
|
-
lib/generators/ofac_migration/build/build_generator.rb Fri, 16 Mar 2012 15:37:08 -0400
|
4
|
-
lib/generators/ofac_migration/build/templates/create_ofac_sdns.rb Fri, 16 Mar 2012 15:37:08 -0400
|
5
|
-
lib/ofac.rb Thu, 02 Sep 2010 14:42:06 -0400
|
6
|
-
lib/ofac/models/ofac.rb Tue, 07 Jan 2014 09:45:35 -0500
|
7
|
-
lib/ofac/models/ofac_sdn.rb Tue, 07 Jan 2014 10:18:10 -0500
|
8
|
-
lib/ofac/models/ofac_sdn_loader.rb Wed, 05 Jun 2013 09:04:58 -0400
|
9
|
-
lib/ofac/ofac_match.rb Wed, 29 Jul 2009 13:27:13 -0400
|
10
|
-
lib/ofac/ruby_string_extensions.rb Mon, 11 May 2009 12:39:33 -0400
|
data/rdoc/files/README_rdoc.html
DELETED
@@ -1,317 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: README.rdoc</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>README.rdoc</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>README.rdoc
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Tue May 12 11:20:38 -0400 2009</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
<div id="description">
|
72
|
-
<h1>ofac</h1>
|
73
|
-
<ul>
|
74
|
-
<li><a href="http://kevintyll.github.com/ofac">kevintyll.github.com/ofac</a>
|
75
|
-
|
76
|
-
</li>
|
77
|
-
<li><a href="http://www.drexel-labs.com">www.drexel-labs.com</a>
|
78
|
-
|
79
|
-
</li>
|
80
|
-
<li><a
|
81
|
-
href="http://www.treas.gov/offices/enforcement/ofac/sdn/index.shtml">www.treas.gov/offices/enforcement/ofac/sdn/index.shtml</a>
|
82
|
-
|
83
|
-
</li>
|
84
|
-
</ul>
|
85
|
-
<h2>DESCRIPTION:</h2>
|
86
|
-
<p>
|
87
|
-
ofac is a ruby gem that tries to find a match of a person‘s name and
|
88
|
-
address against the Office of Foreign Assets Control‘s Specially
|
89
|
-
Designated Nationals list...the so called terrorist watch list.
|
90
|
-
</p>
|
91
|
-
<p>
|
92
|
-
This gem, like the ssn_validator gem, started as a need for the company I
|
93
|
-
work for, Clarity Services Inc. We decided once again to create a gem out
|
94
|
-
of it and share it with the community. Much thanks goes to the management
|
95
|
-
at Clarity Services Inc. for allowing this code to be open sourced. Thanks
|
96
|
-
also to Larry Berland at Clarity Services Inc. The matching logic in the
|
97
|
-
ofac_match.rb file was derived from his work.
|
98
|
-
</p>
|
99
|
-
<h2>FEATURES:</h2>
|
100
|
-
<p>
|
101
|
-
Creates a score, 1 - 100, based on how well the name, address and city
|
102
|
-
match the data on the SDN list. Since we have to match on strings, the
|
103
|
-
likely hood of an exact match are virtually nil. So we‘ve created an
|
104
|
-
algorithm that creates a score. The better the match, the higher the score.
|
105
|
-
A score of 100 would be a perfect match.
|
106
|
-
</p>
|
107
|
-
<p>
|
108
|
-
The score is calculated by adding up the weightings of each part that is
|
109
|
-
matched. So if only name is matched, then the max score is the weight for
|
110
|
-
<tt>:name</tt> which is 60
|
111
|
-
</p>
|
112
|
-
<p>
|
113
|
-
It‘s possible to get partial matches, which will add partial weight
|
114
|
-
to the score. If there is not a match on the element as it is passed in,
|
115
|
-
then each word element gets broken down and matches are tried on each
|
116
|
-
partial element. The weighting is distrubuted equally for each partial that
|
117
|
-
is matched.
|
118
|
-
</p>
|
119
|
-
<p>
|
120
|
-
If exact matches are not made, then a sounds like match is attempted. Any
|
121
|
-
match made by sounds like is given 75% of it‘s weight to the score.
|
122
|
-
Example:
|
123
|
-
</p>
|
124
|
-
<p>
|
125
|
-
If you are trying to match the name Kevin Tyll and there is a record for
|
126
|
-
Smith, Kevin in the database, then we will try to match both Kevin and Tyll
|
127
|
-
separately, with each element Smith and Kevin. Since only Kevin will find a
|
128
|
-
match, and there were 2 elements in the searched name, the score will be
|
129
|
-
added by half the weighting for <tt>:name</tt>. So since the weight for
|
130
|
-
<tt>:name</tt> is 60, then we will add 30 to the score.
|
131
|
-
</p>
|
132
|
-
<p>
|
133
|
-
If you are trying to match the name Kevin Gregory Tyll and there is a
|
134
|
-
record for Tyll, Kevin in the database, then we will try to match Kevin and
|
135
|
-
Gregory and Tyll separately, with each element Tyll and Kevin. Since both
|
136
|
-
Kevin and Tyll will find a match, and there were 3 elements in the searched
|
137
|
-
name, the score will be added by 2/3 the weighting for <tt>:name</tt>. So
|
138
|
-
since the weight for <tt>:name</tt> is 60, then we will add 40 to the
|
139
|
-
score.
|
140
|
-
</p>
|
141
|
-
<p>
|
142
|
-
If you are trying to match the name Kevin Tyll and there is a record for
|
143
|
-
Kevin Gregory Tyll in the database, then we will try to match Kevin and
|
144
|
-
Tyll separately, with each element Tyll and Kevin and Gregory. Since both
|
145
|
-
Kevin and Tyll will find a match, and there were 2 elements in the searched
|
146
|
-
name, the score will be added by 2/2 the weighting for <tt>:name</tt>. So
|
147
|
-
since the weight for <tt>:name</tt> is 60, then we will add 60 to the
|
148
|
-
score.
|
149
|
-
</p>
|
150
|
-
<p>
|
151
|
-
If you are trying to match the name Kevin Tyll, and there is a record for
|
152
|
-
Teel, Kevin in the database, then an exact match will be found for Kevin,
|
153
|
-
and a sounds like match will be made for Tyll. Since there were 2 elements
|
154
|
-
in the searched name, and the weight for <tt>:name</tt> is 60, then each
|
155
|
-
element is worth 30. Since Kevin was an exact match, it will add 30, and
|
156
|
-
since Tyll was a sounds like match, it will add 30 * .75. So the
|
157
|
-
<tt>:name</tt> portion of the search will be worth 53.
|
158
|
-
</p>
|
159
|
-
<p>
|
160
|
-
If data is in the database for city and or address, and you pass data in
|
161
|
-
for these elements, the score will be reduced by 10% of the weight if there
|
162
|
-
is no match or sounds like match. So if you get a match on name,
|
163
|
-
you‘ve already got a score of 60. So if you don‘t pass in an
|
164
|
-
address or city, or if you do, but there is no city or address info in the
|
165
|
-
database, then your final score will be 60. But if you do pass in a city,
|
166
|
-
say Tampa, and the city in the Database is New York, then we will deduct
|
167
|
-
10% of the weight (30 * .1) = 3 from the score since 30 is the weight for
|
168
|
-
<tt>:city</tt>. So the final score will be 57.
|
169
|
-
</p>
|
170
|
-
<p>
|
171
|
-
If were searching for New York, and the database had New Deli, then there
|
172
|
-
would be a match on New, but not on Deli. Since there were 2 elements in
|
173
|
-
the searched city, each hit is worth 15. So the match on New would add 15,
|
174
|
-
but the non-match on York would subtract (15 * .1) = 1.5 from the score. So
|
175
|
-
the score would be (60 + 15 - 1.5) = 74, due to rounding.
|
176
|
-
</p>
|
177
|
-
<p>
|
178
|
-
Only <tt>:city</tt> and <tt>:address</tt> subtract from the score, No match
|
179
|
-
on name simply returns 0.
|
180
|
-
</p>
|
181
|
-
<p>
|
182
|
-
Matches for name are made for both the name and any aliases in the OFAC
|
183
|
-
database.
|
184
|
-
</p>
|
185
|
-
<p>
|
186
|
-
Matches for <tt>:city</tt> and <tt>:address</tt> will only be added to the
|
187
|
-
score if there is first a match on <tt>:name</tt>.
|
188
|
-
</p>
|
189
|
-
<p>
|
190
|
-
We consider a score of 60 to be reasonable as a hit.
|
191
|
-
</p>
|
192
|
-
<h2>SYNOPSIS:</h2>
|
193
|
-
<p>
|
194
|
-
Accepts a hash with the identity‘s demographic information
|
195
|
-
</p>
|
196
|
-
<pre>
|
197
|
-
Ofac.new({:name => 'Oscar Hernandez', :city => 'Clearwater', :address => '123 somewhere ln'})
|
198
|
-
</pre>
|
199
|
-
<p>
|
200
|
-
<tt>:name</tt> is required to get a score. If <tt>:name</tt> is missing, an
|
201
|
-
error will not be thrown, but a score of 0 will be returned.
|
202
|
-
</p>
|
203
|
-
<p>
|
204
|
-
The more information provided, the higher the score could be. A score of
|
205
|
-
100 would mean all fields were passed in, and all fields were 100% matches.
|
206
|
-
If only the name is passed in without an address, it will be impossible to
|
207
|
-
get a score of 100, even if the name matches perfectly.
|
208
|
-
</p>
|
209
|
-
<p>
|
210
|
-
Acceptable hash keys and their weighting in score calculation:
|
211
|
-
</p>
|
212
|
-
<ul>
|
213
|
-
<li><tt>:name</tt> (weighting = 60%) (required) This can be a person, business,
|
214
|
-
or marine vessel
|
215
|
-
|
216
|
-
</li>
|
217
|
-
<li><tt>:address</tt> (weighting = 10%)
|
218
|
-
|
219
|
-
</li>
|
220
|
-
<li><tt>:city</tt> (weighting = 30%)
|
221
|
-
|
222
|
-
</li>
|
223
|
-
<li>Instantiate the object with the identity‘s name, street address, and
|
224
|
-
city.
|
225
|
-
|
226
|
-
<pre>
|
227
|
-
ofac = Ofac.new(:name => 'Kevin Tyll', :city => 'Clearwater', :address => '123 Somewhere Ln.')
|
228
|
-
</pre>
|
229
|
-
</li>
|
230
|
-
<li>Then get the score
|
231
|
-
|
232
|
-
<pre>
|
233
|
-
ofac.score => return the score 1 - 100
|
234
|
-
</pre>
|
235
|
-
</li>
|
236
|
-
<li>You can also get the list of all the partial matches with the score of each
|
237
|
-
record.
|
238
|
-
|
239
|
-
<pre>
|
240
|
-
ofac.possible_hits => returns an array of hashes.
|
241
|
-
</pre>
|
242
|
-
</li>
|
243
|
-
</ul>
|
244
|
-
<h2>REQUIREMENTS:</h2>
|
245
|
-
<ul>
|
246
|
-
<li>Rails 2.0.0 or greater
|
247
|
-
|
248
|
-
</li>
|
249
|
-
</ul>
|
250
|
-
<h2>INSTALL:</h2>
|
251
|
-
<ul>
|
252
|
-
<li>To install the gem:
|
253
|
-
|
254
|
-
<pre>
|
255
|
-
sudo gem install kevintyll-ofac
|
256
|
-
</pre>
|
257
|
-
</li>
|
258
|
-
<li>To create the necessary db migration, from the command line, run:
|
259
|
-
|
260
|
-
<pre>
|
261
|
-
script/generate ofac_migration
|
262
|
-
</pre>
|
263
|
-
</li>
|
264
|
-
<li>Require the gem in your environment.rb file in the Rails::Initializer
|
265
|
-
block:
|
266
|
-
|
267
|
-
<pre>
|
268
|
-
config.gem 'kevintyll-ofac', :lib => 'ofac'
|
269
|
-
</pre>
|
270
|
-
</li>
|
271
|
-
<li>To load your table with the current OFAC data, from the command line, run:
|
272
|
-
|
273
|
-
<pre>
|
274
|
-
rake ofac:update_data
|
275
|
-
|
276
|
-
* The OFAC data is not updated with any regularity, but you can sign up for email notifications when the data changes at
|
277
|
-
http://www.treas.gov/offices/enforcement/ofac/sdn/index.shtml.
|
278
|
-
</pre>
|
279
|
-
</li>
|
280
|
-
</ul>
|
281
|
-
<h2>Copyright</h2>
|
282
|
-
<p>
|
283
|
-
Copyright (c) 2009 Kevin Tyll. See LICENSE for details.
|
284
|
-
</p>
|
285
|
-
|
286
|
-
</div>
|
287
|
-
|
288
|
-
|
289
|
-
</div>
|
290
|
-
|
291
|
-
|
292
|
-
</div>
|
293
|
-
|
294
|
-
|
295
|
-
<!-- if includes -->
|
296
|
-
|
297
|
-
<div id="section">
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
<!-- if method_list -->
|
307
|
-
|
308
|
-
|
309
|
-
</div>
|
310
|
-
|
311
|
-
|
312
|
-
<div id="validator-badges">
|
313
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
314
|
-
</div>
|
315
|
-
|
316
|
-
</body>
|
317
|
-
</html>
|