namecase 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +39 -0
- data/doc/CVS/Entries +8 -0
- data/doc/CVS/Repository +1 -0
- data/doc/CVS/Root +1 -0
- data/doc/classes/CVS/Entries +6 -0
- data/doc/classes/CVS/Repository +1 -0
- data/doc/classes/CVS/Root +1 -0
- data/doc/classes/NameCase.html +158 -0
- data/doc/classes/NameCase.src/CVS/Entries +3 -0
- data/doc/classes/NameCase.src/CVS/Repository +1 -0
- data/doc/classes/NameCase.src/CVS/Root +1 -0
- data/doc/classes/NameCase.src/M000001.html +59 -0
- data/doc/classes/NameCase.src/M000002.html +18 -0
- data/doc/classes/String.html +159 -0
- data/doc/classes/String.src/CVS/Entries +3 -0
- data/doc/classes/String.src/CVS/Repository +1 -0
- data/doc/classes/String.src/CVS/Root +1 -0
- data/doc/classes/String.src/M000004.html +59 -0
- data/doc/classes/String.src/M000005.html +18 -0
- data/doc/classes/TestNameCase.html +167 -0
- data/doc/classes/TestNameCase.src/CVS/Entries +6 -0
- data/doc/classes/TestNameCase.src/CVS/Repository +1 -0
- data/doc/classes/TestNameCase.src/CVS/Root +1 -0
- data/doc/classes/TestNameCase.src/M000001.html +38 -0
- data/doc/classes/TestNameCase.src/M000002.html +20 -0
- data/doc/classes/TestNameCase.src/M000003.html +38 -0
- data/doc/classes/TestNameCase.src/M000004.html +21 -0
- data/doc/classes/TestNameCase.src/M000005.html +21 -0
- data/doc/created.rid +1 -0
- data/doc/files/CVS/Entries +3 -0
- data/doc/files/CVS/Repository +1 -0
- data/doc/files/CVS/Root +1 -0
- data/doc/files/README.html +162 -0
- data/doc/files/lib/CVS/Entries +2 -0
- data/doc/files/lib/CVS/Repository +1 -0
- data/doc/files/lib/CVS/Root +1 -0
- data/doc/files/lib/namecase_rb.html +101 -0
- data/doc/files/test/CVS/Entries +2 -0
- data/doc/files/test/CVS/Repository +1 -0
- data/doc/files/test/CVS/Root +1 -0
- data/doc/files/test/test_namecase_rb.html +109 -0
- data/doc/fr_class_index.html +28 -0
- data/doc/fr_file_index.html +28 -0
- data/doc/fr_method_index.html +31 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/CVS/Entries +2 -0
- data/lib/CVS/Repository +1 -0
- data/lib/CVS/Root +1 -0
- data/lib/namecase.rb +53 -0
- data/test/CVS/Entries +2 -0
- data/test/CVS/Repository +1 -0
- data/test/CVS/Root +1 -0
- data/test/test_namecase.rb +44 -0
- metadata +110 -0
@@ -0,0 +1 @@
|
|
1
|
+
namecase/doc/classes/String.src
|
@@ -0,0 +1 @@
|
|
1
|
+
:ext:aaronp@rubyforge.org:/var/cvs/namecase
|
@@ -0,0 +1,59 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>nc (String)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/namecase.rb, line 4</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nc</span>
|
15
|
+
<span class="ruby-identifier">localstring</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">downcase</span>
|
16
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\b\w/</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">first</span><span class="ruby-operator">|</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">upcase</span> }
|
17
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">"\'\w\b"</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">downcase</span> } <span class="ruby-comment cmt"># Lowercase 's</span>
|
18
|
+
|
19
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">localstring</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\bMac[A-Za-z]{2,}[^aciozj]\b/</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">localstring</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\bMc/</span>
|
20
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\b(Ma?c)([A-Za-z]+)/</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">$1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">capitalize</span> }
|
21
|
+
|
22
|
+
<span class="ruby-comment cmt"># Now fix "Mac" exceptions</span>
|
23
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacEvicius/</span>, <span class="ruby-value str">'Macevicius'</span>)
|
24
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacHado/</span>, <span class="ruby-value str">'Machado'</span>)
|
25
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacHar/</span>, <span class="ruby-value str">'Machar'</span>)
|
26
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacHin/</span>, <span class="ruby-value str">'Machin'</span>)
|
27
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacHlin/</span>, <span class="ruby-value str">'Machlin'</span>)
|
28
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacIas/</span>, <span class="ruby-value str">'Macias'</span>)
|
29
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacIulis/</span>, <span class="ruby-value str">'Maciulis'</span>)
|
30
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacKie/</span>, <span class="ruby-value str">'Mackie'</span>)
|
31
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacKle/</span>, <span class="ruby-value str">'Mackle'</span>)
|
32
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacKlin/</span>, <span class="ruby-value str">'Macklin'</span>)
|
33
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bMacQuarie/</span>, <span class="ruby-value str">'Macquarie'</span>)
|
34
|
+
<span class="ruby-keyword kw">end</span>
|
35
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">'Macmurdo'</span>,<span class="ruby-value str">'MacMurdo'</span>)
|
36
|
+
|
37
|
+
<span class="ruby-comment cmt"># Fixes for "son (daughter) of" etc</span>
|
38
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bAl(?=\s+\w)/</span>, <span class="ruby-value str">'al'</span>) <span class="ruby-comment cmt"># al Arabic or forename Al.</span>
|
39
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bAp\b/</span>, <span class="ruby-value str">'ap'</span>) <span class="ruby-comment cmt"># ap Welsh.</span>
|
40
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bBen(?=\s+\w)/</span>,<span class="ruby-value str">'ben'</span>) <span class="ruby-comment cmt"># ben Hebrew or forename Ben.</span>
|
41
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bDell([ae])\b/</span>,<span class="ruby-value str">'dell\1'</span>) <span class="ruby-comment cmt"># della and delle Italian.</span>
|
42
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bD([aeiu])\b/</span>,<span class="ruby-value str">'d\1'</span>) <span class="ruby-comment cmt"># da, de, di Italian; du French.</span>
|
43
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bDe([lr])\b/</span>,<span class="ruby-value str">'de\1'</span>) <span class="ruby-comment cmt"># del Italian; der Dutch/Flemish.</span>
|
44
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bEl\b/</span>,<span class="ruby-value str">'el'</span>) <span class="ruby-comment cmt"># el Greek or El Spanish.</span>
|
45
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bLa\b/</span>,<span class="ruby-value str">'la'</span>) <span class="ruby-comment cmt"># la French or La Spanish.</span>
|
46
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bL([eo])\b/</span>,<span class="ruby-value str">'l\1'</span>) <span class="ruby-comment cmt"># lo Italian; le French.</span>
|
47
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bVan(?=\s+\w)/</span>,<span class="ruby-value str">'van'</span>) <span class="ruby-comment cmt"># van German or forename Van.</span>
|
48
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\bVon\b/</span>,<span class="ruby-value str">'von'</span>) <span class="ruby-comment cmt"># von Dutch/Flemish</span>
|
49
|
+
|
50
|
+
<span class="ruby-comment cmt"># Fix roman numeral names</span>
|
51
|
+
<span class="ruby-identifier">localstring</span>.<span class="ruby-identifier">gsub!</span>(
|
52
|
+
<span class="ruby-regexp re">/ \b ( (?: [Xx]{1,3} | [Xx][Ll] | [Ll][Xx]{0,3} )?
|
53
|
+
(?: [Ii]{1,3} | [Ii][VvXx] | [Vv][Ii]{0,3} )? ) \b /</span><span class="ruby-identifier">x</span>
|
54
|
+
) { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>.<span class="ruby-identifier">upcase</span> }
|
55
|
+
|
56
|
+
<span class="ruby-identifier">localstring</span>
|
57
|
+
<span class="ruby-keyword kw">end</span></pre>
|
58
|
+
</body>
|
59
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>nc! (String)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/namecase.rb, line 50</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nc!</span>
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">nc</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,167 @@
|
|
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: TestNameCase</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">TestNameCase</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/test/test_namecase_rb.html">
|
59
|
+
test/test_namecase.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
|
+
Test::Unit::TestCase
|
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">setup</a>
|
90
|
+
<a href="#M000004">test_namecase</a>
|
91
|
+
<a href="#M000005">test_namecase_modify</a>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if includes -->
|
99
|
+
|
100
|
+
<div id="section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<!-- if method_list -->
|
110
|
+
<div id="methods">
|
111
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
112
|
+
|
113
|
+
<div id="method-M000003" class="method-detail">
|
114
|
+
<a name="M000003"></a>
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<a href="TestNameCase.src/M000003.html" target="Code" class="method-signature"
|
118
|
+
onclick="popupCode('TestNameCase.src/M000003.html');return false;">
|
119
|
+
<span class="method-name">setup</span><span class="method-args">()</span>
|
120
|
+
</a>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="method-description">
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div id="method-M000004" class="method-detail">
|
128
|
+
<a name="M000004"></a>
|
129
|
+
|
130
|
+
<div class="method-heading">
|
131
|
+
<a href="TestNameCase.src/M000004.html" target="Code" class="method-signature"
|
132
|
+
onclick="popupCode('TestNameCase.src/M000004.html');return false;">
|
133
|
+
<span class="method-name">test_namecase</span><span class="method-args">()</span>
|
134
|
+
</a>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="method-description">
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div id="method-M000005" class="method-detail">
|
142
|
+
<a name="M000005"></a>
|
143
|
+
|
144
|
+
<div class="method-heading">
|
145
|
+
<a href="TestNameCase.src/M000005.html" target="Code" class="method-signature"
|
146
|
+
onclick="popupCode('TestNameCase.src/M000005.html');return false;">
|
147
|
+
<span class="method-name">test_namecase_modify</span><span class="method-args">()</span>
|
148
|
+
</a>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<div class="method-description">
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
|
156
|
+
</div>
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
<div id="validator-badges">
|
163
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
</body>
|
167
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
namecase/doc/classes/TestNameCase.src
|
@@ -0,0 +1 @@
|
|
1
|
+
:ext:aaronp@rubyforge.org:/var/cvs/namecase
|
@@ -0,0 +1,38 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>setup (TestNameCase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File test/test_namecase.rb, line 7</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15
|
+
<span class="ruby-ivar">@proper_names</span> = [
|
16
|
+
<span class="ruby-value str">"Keith"</span>, <span class="ruby-value str">"Leigh-Williams"</span>, <span class="ruby-value str">"McCarthy"</span>,
|
17
|
+
<span class="ruby-value str">"O'Callaghan"</span>, <span class="ruby-value str">"St. John"</span>, <span class="ruby-value str">"von Streit"</span>,
|
18
|
+
<span class="ruby-value str">"van Dyke"</span>, <span class="ruby-value str">"Van"</span>, <span class="ruby-value str">"ap Llwyd Dafydd"</span>,
|
19
|
+
<span class="ruby-value str">"al Fahd"</span>, <span class="ruby-value str">"Al"</span>,
|
20
|
+
<span class="ruby-value str">"el Grecco"</span>,
|
21
|
+
<span class="ruby-value str">"ben Gurion"</span>, <span class="ruby-value str">"Ben"</span>,
|
22
|
+
<span class="ruby-value str">"da Vinci"</span>,
|
23
|
+
<span class="ruby-value str">"di Caprio"</span>, <span class="ruby-value str">"du Pont"</span>, <span class="ruby-value str">"de Legate"</span>,
|
24
|
+
<span class="ruby-value str">"del Crond"</span>, <span class="ruby-value str">"der Sind"</span>, <span class="ruby-value str">"van der Post"</span>,
|
25
|
+
<span class="ruby-value str">"von Trapp"</span>, <span class="ruby-value str">"la Poisson"</span>, <span class="ruby-value str">"le Figaro"</span>,
|
26
|
+
<span class="ruby-value str">"Mack Knife"</span>, <span class="ruby-value str">"Dougal MacDonald"</span>,
|
27
|
+
<span class="ruby-comment cmt"># Mac exceptions</span>
|
28
|
+
<span class="ruby-value str">"Machin"</span>, <span class="ruby-value str">"Machlin"</span>, <span class="ruby-value str">"Machar"</span>,
|
29
|
+
<span class="ruby-value str">"Mackle"</span>, <span class="ruby-value str">"Macklin"</span>, <span class="ruby-value str">"Mackie"</span>,
|
30
|
+
<span class="ruby-value str">"Macquarie"</span>, <span class="ruby-value str">"Machado"</span>, <span class="ruby-value str">"Macevicius"</span>,
|
31
|
+
<span class="ruby-value str">"Maciulis"</span>, <span class="ruby-value str">"Macias"</span>, <span class="ruby-value str">"MacMurdo"</span>,
|
32
|
+
<span class="ruby-comment cmt"># Roman numerals</span>
|
33
|
+
<span class="ruby-value str">"Henry VIII"</span>, <span class="ruby-value str">"Louis III"</span>, <span class="ruby-value str">"Louis XIV"</span>,
|
34
|
+
<span class="ruby-value str">"Charles II"</span>, <span class="ruby-value str">"Fred XLIX"</span>,
|
35
|
+
]
|
36
|
+
<span class="ruby-keyword kw">end</span></pre>
|
37
|
+
</body>
|
38
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>test_namecase (TestNameCase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File test/test_namecase.rb, line 31</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_namecase</span>
|
15
|
+
<span class="ruby-ivar">@proper_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">nc</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,38 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>setup (TestNameCase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File test/test_namecase.rb, line 7</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15
|
+
<span class="ruby-ivar">@proper_names</span> = [
|
16
|
+
<span class="ruby-value str">"Keith"</span>, <span class="ruby-value str">"Leigh-Williams"</span>, <span class="ruby-value str">"McCarthy"</span>,
|
17
|
+
<span class="ruby-value str">"O'Callaghan"</span>, <span class="ruby-value str">"St. John"</span>, <span class="ruby-value str">"von Streit"</span>,
|
18
|
+
<span class="ruby-value str">"van Dyke"</span>, <span class="ruby-value str">"Van"</span>, <span class="ruby-value str">"ap Llwyd Dafydd"</span>,
|
19
|
+
<span class="ruby-value str">"al Fahd"</span>, <span class="ruby-value str">"Al"</span>,
|
20
|
+
<span class="ruby-value str">"el Grecco"</span>,
|
21
|
+
<span class="ruby-value str">"ben Gurion"</span>, <span class="ruby-value str">"Ben"</span>,
|
22
|
+
<span class="ruby-value str">"da Vinci"</span>,
|
23
|
+
<span class="ruby-value str">"di Caprio"</span>, <span class="ruby-value str">"du Pont"</span>, <span class="ruby-value str">"de Legate"</span>,
|
24
|
+
<span class="ruby-value str">"del Crond"</span>, <span class="ruby-value str">"der Sind"</span>, <span class="ruby-value str">"van der Post"</span>,
|
25
|
+
<span class="ruby-value str">"von Trapp"</span>, <span class="ruby-value str">"la Poisson"</span>, <span class="ruby-value str">"le Figaro"</span>,
|
26
|
+
<span class="ruby-value str">"Mack Knife"</span>, <span class="ruby-value str">"Dougal MacDonald"</span>,
|
27
|
+
<span class="ruby-comment cmt"># Mac exceptions</span>
|
28
|
+
<span class="ruby-value str">"Machin"</span>, <span class="ruby-value str">"Machlin"</span>, <span class="ruby-value str">"Machar"</span>,
|
29
|
+
<span class="ruby-value str">"Mackle"</span>, <span class="ruby-value str">"Macklin"</span>, <span class="ruby-value str">"Mackie"</span>,
|
30
|
+
<span class="ruby-value str">"Macquarie"</span>, <span class="ruby-value str">"Machado"</span>, <span class="ruby-value str">"Macevicius"</span>,
|
31
|
+
<span class="ruby-value str">"Maciulis"</span>, <span class="ruby-value str">"Macias"</span>, <span class="ruby-value str">"MacMurdo"</span>,
|
32
|
+
<span class="ruby-comment cmt"># Roman numerals</span>
|
33
|
+
<span class="ruby-value str">"Henry VIII"</span>, <span class="ruby-value str">"Louis III"</span>, <span class="ruby-value str">"Louis XIV"</span>,
|
34
|
+
<span class="ruby-value str">"Charles II"</span>, <span class="ruby-value str">"Fred XLIX"</span>,
|
35
|
+
]
|
36
|
+
<span class="ruby-keyword kw">end</span></pre>
|
37
|
+
</body>
|
38
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>test_namecase (TestNameCase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File test/test_namecase.rb, line 31</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_namecase</span>
|
15
|
+
<span class="ruby-ivar">@proper_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-identifier">nc_name</span> = <span class="ruby-constant">NameCase</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)
|
17
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">nc_name</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">nc</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>test_namecase_modify (TestNameCase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File test/test_namecase.rb, line 38</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_namecase_modify</span>
|
15
|
+
<span class="ruby-ivar">@proper_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-identifier">nc_name</span> = <span class="ruby-constant">NameCase</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)
|
17
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">nc_name</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">nc!</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Mon Nov 07 15:59:22 PST 2005
|
@@ -0,0 +1 @@
|
|
1
|
+
namecase/doc/files
|
data/doc/files/CVS/Root
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
:ext:aaronp@rubyforge.org:/var/cvs/namecase
|
@@ -0,0 +1,162 @@
|
|
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</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</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Nov 07 15:56:38 PST 2005</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
|
+
<h2>NameCase</h2>
|
73
|
+
<p>
|
74
|
+
Version 1.0.0 - 2005/11/2
|
75
|
+
</p>
|
76
|
+
<p>
|
77
|
+
Original version by Mark Summerfield <<a
|
78
|
+
href="http://search.cpan.org/~summer">search.cpan.org/~summer</a>/> Ruby
|
79
|
+
port by Aaron Patterson <aaronp@rubyforge.org>
|
80
|
+
</p>
|
81
|
+
<p>
|
82
|
+
NameCase is a Ruby implementation of Lingua::EN::NameCase, a library for
|
83
|
+
converting strings to be properly cased. This is good for converting
|
84
|
+
denormalized data to human friendly data.
|
85
|
+
</p>
|
86
|
+
<ul>
|
87
|
+
<li>Example Usage
|
88
|
+
|
89
|
+
</li>
|
90
|
+
</ul>
|
91
|
+
<p>
|
92
|
+
NameCase is a subclass of Ruby’s <tt>String</tt>, and can be used
|
93
|
+
similarly:
|
94
|
+
</p>
|
95
|
+
<pre>
|
96
|
+
string = NameCase.new( string )
|
97
|
+
puts string.nc
|
98
|
+
puts string.nc!
|
99
|
+
</pre>
|
100
|
+
<ul>
|
101
|
+
<li>Acknowledgements
|
102
|
+
|
103
|
+
</li>
|
104
|
+
</ul>
|
105
|
+
<p>
|
106
|
+
This library is a port of the Perl library, and owes most of its
|
107
|
+
functionality to the Perl version by Mark Summerfield. Any bugs in the Ruby
|
108
|
+
port are my fault.
|
109
|
+
</p>
|
110
|
+
<ul>
|
111
|
+
<li>Author
|
112
|
+
|
113
|
+
</li>
|
114
|
+
</ul>
|
115
|
+
<p>
|
116
|
+
Original Version: Copyright © Mark Summerfield 1998-2002.
|
117
|
+
<summer@perlpress.com> All Rights Reserved
|
118
|
+
</p>
|
119
|
+
<p>
|
120
|
+
Ruby Version: Copyright © Aaron Patterson 2005
|
121
|
+
</p>
|
122
|
+
<ul>
|
123
|
+
<li>License
|
124
|
+
|
125
|
+
</li>
|
126
|
+
</ul>
|
127
|
+
<p>
|
128
|
+
NameCase is distributed under the GPL license. Please see the LICENSE file.
|
129
|
+
</p>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
<!-- if includes -->
|
141
|
+
|
142
|
+
<div id="section">
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<!-- if method_list -->
|
152
|
+
|
153
|
+
|
154
|
+
</div>
|
155
|
+
|
156
|
+
|
157
|
+
<div id="validator-badges">
|
158
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</body>
|
162
|
+
</html>
|