Commit bc18b961bdd99fd9f3bb51dc8fd6e88757de3eb8
1 parent
3e81fa06a9
Exists in
master
more doc
Showing 25 changed files with 316 additions and 85 deletions Inline Diff
- doc/classes/RIR.html
- doc/classes/RIR/Document.html
- doc/classes/RIR/WebDocument.html
- doc/classes/RIR/WikipediaPage.html
- doc/classes/String.html
- doc/classes/String.src/M000001.html
- doc/classes/String.src/M000002.html
- doc/classes/String.src/M000003.html
- doc/classes/String.src/M000004.html
- doc/classes/String.src/M000005.html
- doc/classes/String.src/M000006.html
- doc/classes/String.src/M000007.html
- doc/classes/String.src/M000008.html
- doc/classes/String.src/M000009.html
- doc/created.rid
- doc/files/lib/rir/document_rb.html
- doc/files/lib/rir/string_rb.html
- doc/files/lib/rir_rb.html
- doc/fr_class_index.html
- doc/fr_file_index.html
- doc/fr_method_index.html
- doc/index.html
- lib/rir/corpus.rb
- lib/rir/query.rb
- lib/rir/string.rb
doc/classes/RIR.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>Module: RIR [RDoc Documentation]</title> | 5 | <title>Module: RIR [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="classHeader"> | 45 | <div id="classHeader"> |
46 | <table class="header-table"> | 46 | <table class="header-table"> |
47 | <tr class="top-aligned-row"> | 47 | <tr class="top-aligned-row"> |
48 | <td><strong>Module</strong></td> | 48 | <td><strong>Module</strong></td> |
49 | <td class="class-name-in-header">RIR</td> | 49 | <td class="class-name-in-header">RIR</td> |
50 | </tr> | 50 | </tr> |
51 | <tr class="top-aligned-row"> | 51 | <tr class="top-aligned-row"> |
52 | <td><strong>In:</strong></td> | 52 | <td><strong>In:</strong></td> |
53 | <td> | 53 | <td> |
54 | 54 | ||
55 | 55 | ||
56 | <a href="../files/lib/rir/string_rb.html"> | 56 | <a href="../files/lib/rir/corpus_rb.html"> |
57 | 57 | ||
58 | lib/rir/string.rb | 58 | lib/rir/corpus.rb |
59 | 59 | ||
60 | </a> | 60 | </a> |
61 | 61 | ||
62 | 62 | ||
63 | <br /> | 63 | <br /> |
64 | 64 | ||
65 | 65 | ||
66 | <a href="../files/lib/rir/document_rb.html"> | 66 | <a href="../files/lib/rir/query_rb.html"> |
67 | 67 | ||
68 | lib/rir/document.rb | 68 | lib/rir/query.rb |
69 | 69 | ||
70 | </a> | 70 | </a> |
71 | 71 | ||
72 | 72 | ||
73 | <br /> | 73 | <br /> |
74 | 74 | ||
75 | |||
76 | <a href="../files/lib/rir/string_rb.html"> | ||
77 | |||
78 | lib/rir/string.rb | ||
79 | |||
80 | </a> | ||
81 | |||
82 | |||
83 | <br /> | ||
84 | |||
75 | </td> | 85 | </td> |
76 | </tr> | 86 | </tr> |
77 | 87 | ||
78 | 88 | ||
79 | </table> | 89 | </table> |
80 | </div> | 90 | </div> |
81 | <!-- banner header --> | 91 | <!-- banner header --> |
82 | 92 | ||
83 | <div id="bodyContent"> | 93 | <div id="bodyContent"> |
84 | 94 | ||
85 | <div id="contextContent"> | 95 | <div id="contextContent"> |
86 | 96 | ||
87 | <div id="description"> | 97 | <div id="description"> |
88 | <p> | 98 | <p> |
89 | General module for many purposes related to Information Retrieval. | 99 | This file is a part of an Information Retrieval oriented Ruby library |
90 | </p> | 100 | </p> |
101 | <p> | ||
102 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | ||
103 | </p> | ||
104 | <p> | ||
105 | This program is free software: you can redistribute it and/or modify it | ||
106 | under the terms of the GNU General Public License as published by the Free | ||
107 | Software Foundation, either version 3 of the License, or (at your option) | ||
108 | any later version. | ||
109 | </p> | ||
110 | <p> | ||
111 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
112 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
113 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
114 | more details. | ||
115 | </p> | ||
116 | <p> | ||
117 | You should have received a copy of the GNU General Public License along | ||
118 | with this program. If not, see <<a | ||
119 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. | ||
120 | </p> | ||
91 | <hr size="1"></hr><p> | 121 | <hr size="1"></hr><p> |
92 | General module for many purposes related to Information Retrieval. | 122 | This file is a part of an Information Retrieval oriented Ruby library |
93 | </p> | 123 | </p> |
124 | <p> | ||
125 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | ||
126 | </p> | ||
127 | <p> | ||
128 | This program is free software: you can redistribute it and/or modify it | ||
129 | under the terms of the GNU General Public License as published by the Free | ||
130 | Software Foundation, either version 3 of the License, or (at your option) | ||
131 | any later version. | ||
132 | </p> | ||
133 | <p> | ||
134 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
135 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
136 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
137 | more details. | ||
138 | </p> | ||
139 | <p> | ||
140 | You should have received a copy of the GNU General Public License along | ||
141 | with this program. If not, see <<a | ||
142 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. | ||
143 | </p> | ||
144 | <hr size="1"></hr><p> | ||
145 | This file is a part of an Information Retrieval oriented Ruby library | ||
146 | </p> | ||
147 | <p> | ||
148 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | ||
149 | </p> | ||
150 | <p> | ||
151 | This program is free software: you can redistribute it and/or modify it | ||
152 | under the terms of the GNU General Public License as published by the Free | ||
153 | Software Foundation, either version 3 of the License, or (at your option) | ||
154 | any later version. | ||
155 | </p> | ||
156 | <p> | ||
157 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
158 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
159 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
160 | more details. | ||
161 | </p> | ||
162 | <p> | ||
163 | You should have received a copy of the GNU General Public License along | ||
164 | with this program. If not, see <<a | ||
165 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. | ||
166 | </p> | ||
94 | 167 | ||
95 | </div> | 168 | </div> |
96 | 169 | ||
97 | </div> | 170 | </div> |
98 | 171 | ||
99 | 172 | ||
100 | </div> | 173 | </div> |
101 | 174 | ||
102 | <!-- if includes --> | 175 | <!-- if includes --> |
103 | 176 | ||
104 | <div id="section"> | 177 | <div id="section"> |
105 | 178 | ||
106 | <div id="class-list"> | 179 | <div id="class-list"> |
107 | <h3 class="section-bar">Classes and Modules</h3> | 180 | <h3 class="section-bar">Classes and Modules</h3> |
108 | 181 | ||
109 | Class <a href="RIR/Document.html" class="link">RIR::Document</a><br /> | 182 | Module <a href="RIR/Indri.html" class="link">RIR::Indri</a><br /> |
110 | Class <a href="RIR/WebDocument.html" class="link">RIR::WebDocument</a><br /> | 183 | Class <a href="RIR/Corpus.html" class="link">RIR::Corpus</a><br /> |
111 | Class <a href="RIR/WikipediaPage.html" class="link">RIR::WikipediaPage</a><br /> | 184 | Class <a href="RIR/Query.html" class="link">RIR::Query</a><br /> |
112 | 185 | ||
113 | </div> | 186 | </div> |
114 | 187 | ||
115 | <div id="constants-list"> | 188 | <div id="constants-list"> |
116 | <h3 class="section-bar">Constants</h3> | 189 | <h3 class="section-bar">Constants</h3> |
117 | 190 | ||
118 | <div class="name-list"> | 191 | <div class="name-list"> |
119 | <table summary="Constants"> | 192 | <table summary="Constants"> |
120 | 193 | ||
121 | <tr class="top-aligned-row context-row"> | 194 | <tr class="top-aligned-row context-row"> |
122 | <td class="context-item-name">Stoplist</td> | 195 | <td class="context-item-name">Stoplist</td> |
123 | <td>=</td> | 196 | <td>=</td> |
124 | <td class="context-item-value">[ "a", "anything", "anyway", "anywhere", "apart", "are", "around", "as", "at", "av", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", "can", "cannot", "canst", "certain", "cf", "choose", "contrariwise", "cos", "could", "cu", "day", "do", "does", "doesn't", "doing", "dost", "doth", "double", "down", "dual", "during", "each", "either", "else", "elsewhere", "enough", "et", "etc", "even", "ever", "every", "everybody", "everyone", "everything", "everywhere", "except", "excepted", "excepting", "exception", "exclude", "excluding", "exclusive", "far", "farther", "farthest", "few", "ff", "first", "for", "formerly", "forth", "forward", "from", "front", "further", "furthermore", "furthest", "get", "go", "had", "halves", "hardly", "has", "hast", "hath", "have", "he", "hence", "henceforth", "her", "here", "hereabouts", "hereafter", "hereby", "herein", "hereto", "hereupon", "hers", "herself", "him", "himself", "hindmost", "his", "hither", "hitherto", "how", "however", "howsoever", "i", "ie", "if", "in", "inasmuch", "inc", "include", "included", "including", "indeed", "indoors", "inside", "insomuch", "instead", "into", "inward", "inwards", "is", "it", "its", "itself", "just", "kind", "kg", "km", "last", "latter", "latterly", "less", "lest", "let", "like", "little", "ltd", "many", "may", "maybe", "me", "meantime", "meanwhile", "might", "moreover", "most", "mostly", "more", "mr", "mrs", "ms", "much", "must", "my", "myself", "namely", "need", "neither", "never", "nevertheless", "next", "no", "nobody", "none", "nonetheless", "noone", "nope", "nor", "not", "nothing", "notwithstanding", "now", "nowadays", "nowhere", "of", "off", "often", "ok", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "ought", "our", "ours", "ourselves", "out", "outside", "over", "own", "per", "perhaps", "plenty", "provide", "quite", "rather", "really", "round", "said", "sake", "same", "sang", "save", "saw", "see", "seeing", "seem", "seemed", "seeming", "seems", "seen", "seldom", "selves", "sent", "several", "shalt", "she", "should", "shown", "sideways", "since", "slept", "slew", "slung", "slunk", "smote", "so", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", "somewhat", "somewhere", "spake", "spat", "spoke", "spoken", "sprang", "sprung", "stave", "staves", "still", "such", "supposing", "than", "that", "the", "thee", "their", "them", "themselves", "then", "thence", "thenceforth", "there", "thereabout", "thereabouts", "thereafter", "thereby", "therefore", "therein", "thereof", "thereon", "thereto", "thereupon", "these", "they", "this", "those", "thou", "though", "thrice", "through", "throughout", "thru", "thus", "thy", "thyself", "till", "to", "together", "too", "toward", "towards", "ugh", "unable", "under", "underneath", "unless", "unlike", "until", "up", "upon", "upward", "upwards", "us", "use", "used", "using", "very", "via", "vs", "want", "was", "we", "week", "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", "where", "whereabouts", "whereafter", "whereas", "whereat", "whereby", "wherefore", "wherefrom", "wherein", "whereinto", "whereof", "whereon", "wheresoever", "whereto", "whereunto", "whereupon", "wherever", "wherewith", "whether", "whew", "which", "whichever", "whichsoever", "while", "whilst", "whither", "who", "whoa", "whoever", "whole", "whom", "whomever", "whomsoever", "whose", "whosoever", "why", "will", "wilt", "with", "within", "without", "worse", "worst", "would", "wow", "ye", "yet", "year", "yippee", "you", "your", "yours", "yourself", "yourselves" ]</td> | 197 | <td class="context-item-value">[ "a", "anything", "anyway", "anywhere", "apart", "are", "around", "as", "at", "av", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", "can", "cannot", "canst", "certain", "cf", "choose", "contrariwise", "cos", "could", "cu", "day", "do", "does", "doesn't", "doing", "dost", "doth", "double", "down", "dual", "during", "each", "either", "else", "elsewhere", "enough", "et", "etc", "even", "ever", "every", "everybody", "everyone", "everything", "everywhere", "except", "excepted", "excepting", "exception", "exclude", "excluding", "exclusive", "far", "farther", "farthest", "few", "ff", "first", "for", "formerly", "forth", "forward", "from", "front", "further", "furthermore", "furthest", "get", "go", "had", "halves", "hardly", "has", "hast", "hath", "have", "he", "hence", "henceforth", "her", "here", "hereabouts", "hereafter", "hereby", "herein", "hereto", "hereupon", "hers", "herself", "him", "himself", "hindmost", "his", "hither", "hitherto", "how", "however", "howsoever", "i", "ie", "if", "in", "inasmuch", "inc", "include", "included", "including", "indeed", "indoors", "inside", "insomuch", "instead", "into", "inward", "inwards", "is", "it", "its", "itself", "just", "kind", "kg", "km", "last", "latter", "latterly", "less", "lest", "let", "like", "little", "ltd", "many", "may", "maybe", "me", "meantime", "meanwhile", "might", "moreover", "most", "mostly", "more", "mr", "mrs", "ms", "much", "must", "my", "myself", "namely", "need", "neither", "never", "nevertheless", "next", "no", "nobody", "none", "nonetheless", "noone", "nope", "nor", "not", "nothing", "notwithstanding", "now", "nowadays", "nowhere", "of", "off", "often", "ok", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "ought", "our", "ours", "ourselves", "out", "outside", "over", "own", "per", "perhaps", "plenty", "provide", "quite", "rather", "really", "round", "said", "sake", "same", "sang", "save", "saw", "see", "seeing", "seem", "seemed", "seeming", "seems", "seen", "seldom", "selves", "sent", "several", "shalt", "she", "should", "shown", "sideways", "since", "slept", "slew", "slung", "slunk", "smote", "so", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", "somewhat", "somewhere", "spake", "spat", "spoke", "spoken", "sprang", "sprung", "stave", "staves", "still", "such", "supposing", "than", "that", "the", "thee", "their", "them", "themselves", "then", "thence", "thenceforth", "there", "thereabout", "thereabouts", "thereafter", "thereby", "therefore", "therein", "thereof", "thereon", "thereto", "thereupon", "these", "they", "this", "those", "thou", "though", "thrice", "through", "throughout", "thru", "thus", "thy", "thyself", "till", "to", "together", "too", "toward", "towards", "ugh", "unable", "under", "underneath", "unless", "unlike", "until", "up", "upon", "upward", "upwards", "us", "use", "used", "using", "very", "via", "vs", "want", "was", "we", "week", "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", "where", "whereabouts", "whereafter", "whereas", "whereat", "whereby", "wherefore", "wherefrom", "wherein", "whereinto", "whereof", "whereon", "wheresoever", "whereto", "whereunto", "whereupon", "wherever", "wherewith", "whether", "whew", "which", "whichever", "whichsoever", "while", "whilst", "whither", "who", "whoa", "whoever", "whole", "whom", "whomever", "whomsoever", "whose", "whosoever", "why", "will", "wilt", "with", "within", "without", "worse", "worst", "would", "wow", "ye", "yet", "year", "yippee", "you", "your", "yours", "yourself", "yourselves" ]</td> |
125 | 198 | ||
126 | <td> </td> | 199 | <td> </td> |
127 | <td class="context-item-desc"> | 200 | <td class="context-item-desc"> |
128 | These are the default stopwords provided by Lemur. | 201 | These are the default stopwords provided by Lemur. |
129 | 202 | ||
130 | </td> | 203 | </td> |
131 | 204 | ||
132 | </tr> | 205 | </tr> |
133 | 206 | ||
134 | </table> | 207 | </table> |
135 | </div> | 208 | </div> |
136 | </div> | 209 | </div> |
137 | 210 | ||
138 | 211 | ||
139 | 212 | ||
140 | 213 | ||
141 | <!-- if method_list --> | 214 | <!-- if method_list --> |
142 | 215 | ||
143 | 216 | ||
144 | 217 | ||
145 | 218 | ||
146 | </div> | 219 | </div> |
147 | 220 | ||
148 | <div id="validator-badges"> | 221 | <div id="validator-badges"> |
149 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 222 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
150 | </div> | 223 | </div> |
151 | 224 | ||
152 | </body> | 225 | </body> |
153 | </html> | 226 | </html> |
154 | 227 |
doc/classes/RIR/Document.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>Class: RIR::Document [RDoc Documentation]</title> | 5 | <title>Class: RIR::Document [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="classHeader"> | 45 | <div id="classHeader"> |
46 | <table class="header-table"> | 46 | <table class="header-table"> |
47 | <tr class="top-aligned-row"> | 47 | <tr class="top-aligned-row"> |
48 | <td><strong>Class</strong></td> | 48 | <td><strong>Class</strong></td> |
49 | <td class="class-name-in-header">RIR::Document</td> | 49 | <td class="class-name-in-header">RIR::Document</td> |
50 | </tr> | 50 | </tr> |
51 | <tr class="top-aligned-row"> | 51 | <tr class="top-aligned-row"> |
52 | <td><strong>In:</strong></td> | 52 | <td><strong>In:</strong></td> |
53 | <td> | 53 | <td> |
54 | 54 | ||
55 | 55 | ||
56 | <a href="../../files/lib/rir/document_rb.html"> | 56 | <a href="../../files/lib/rir/document_rb.html"> |
57 | 57 | ||
58 | lib/rir/document.rb | 58 | lib/rir/document.rb |
59 | 59 | ||
60 | </a> | 60 | </a> |
61 | 61 | ||
62 | 62 | ||
63 | <br /> | 63 | <br /> |
64 | 64 | ||
65 | </td> | 65 | </td> |
66 | </tr> | 66 | </tr> |
67 | 67 | ||
68 | 68 | ||
69 | <tr class="top-aligned-row"> | 69 | <tr class="top-aligned-row"> |
70 | <td><strong>Parent:</strong></td> | 70 | <td><strong>Parent:</strong></td> |
71 | <td> | 71 | <td> |
72 | 72 | ||
73 | Object | 73 | Object |
74 | 74 | ||
75 | </td> | 75 | </td> |
76 | </tr> | 76 | </tr> |
77 | 77 | ||
78 | </table> | 78 | </table> |
79 | </div> | 79 | </div> |
80 | <!-- banner header --> | 80 | <!-- banner header --> |
81 | 81 | ||
82 | <div id="bodyContent"> | 82 | <div id="bodyContent"> |
83 | 83 | ||
84 | <div id="contextContent"> | 84 | <div id="contextContent"> |
85 | 85 | ||
86 | <div id="description"> | 86 | <div id="description"> |
87 | <p> | 87 | <p> |
88 | A <a href="Document.html">Document</a> is a bag of words and is constructed | 88 | A <a href="Document.html">Document</a> is a bag of words and is constructed |
89 | from a string. | 89 | from a string. |
90 | </p> | 90 | </p> |
91 | 91 | ||
92 | </div> | 92 | </div> |
93 | 93 | ||
94 | </div> | 94 | </div> |
95 | 95 | ||
96 | 96 | ||
97 | <div id="method-list"> | 97 | <div id="method-list"> |
98 | <h3 class="section-bar">Methods</h3> | 98 | <h3 class="section-bar">Methods</h3> |
99 | 99 | ||
100 | <div class="name-list"> | 100 | <div class="name-list"> |
101 | 101 | ||
102 | <a href="#M000012">count_words</a> | 102 | <a href="#M000021">count_words</a> |
103 | 103 | ||
104 | <a href="#M000013">entropy</a> | 104 | <a href="#M000022">entropy</a> |
105 | 105 | ||
106 | <a href="#M000010">format_words</a> | 106 | <a href="#M000019">format_words</a> |
107 | 107 | ||
108 | <a href="#M000014">new</a> | 108 | <a href="#M000023">new</a> |
109 | 109 | ||
110 | <a href="#M000011">ngrams</a> | 110 | <a href="#M000020">ngrams</a> |
111 | 111 | ||
112 | </div> | 112 | </div> |
113 | </div> | 113 | </div> |
114 | 114 | ||
115 | </div> | 115 | </div> |
116 | 116 | ||
117 | <!-- if includes --> | 117 | <!-- if includes --> |
118 | 118 | ||
119 | <div id="section"> | 119 | <div id="section"> |
120 | 120 | ||
121 | 121 | ||
122 | 122 | ||
123 | <div id="attribute-list"> | 123 | <div id="attribute-list"> |
124 | <h3 class="section-bar">Attributes</h3> | 124 | <h3 class="section-bar">Attributes</h3> |
125 | 125 | ||
126 | <div class="name-list"> | 126 | <div class="name-list"> |
127 | <table> | 127 | <table> |
128 | 128 | ||
129 | <tr class="top-aligned-row context-row"> | 129 | <tr class="top-aligned-row context-row"> |
130 | <td class="context-item-name">doc_content</td> | 130 | <td class="context-item-name">doc_content</td> |
131 | 131 | ||
132 | <td class="context-item-value"> [R] </td> | 132 | <td class="context-item-value"> [R] </td> |
133 | 133 | ||
134 | <td class="context-item-desc"></td> | 134 | <td class="context-item-desc"></td> |
135 | </tr> | 135 | </tr> |
136 | 136 | ||
137 | <tr class="top-aligned-row context-row"> | 137 | <tr class="top-aligned-row context-row"> |
138 | <td class="context-item-name">words</td> | 138 | <td class="context-item-name">words</td> |
139 | 139 | ||
140 | <td class="context-item-value"> [R] </td> | 140 | <td class="context-item-value"> [R] </td> |
141 | 141 | ||
142 | <td class="context-item-desc"></td> | 142 | <td class="context-item-desc"></td> |
143 | </tr> | 143 | </tr> |
144 | 144 | ||
145 | </table> | 145 | </table> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | 148 | ||
149 | 149 | ||
150 | <!-- if method_list --> | 150 | <!-- if method_list --> |
151 | 151 | ||
152 | <div id="methods"> | 152 | <div id="methods"> |
153 | 153 | ||
154 | <h3 class="section-bar">Public Class methods</h3> | 154 | <h3 class="section-bar">Public Class methods</h3> |
155 | 155 | ||
156 | 156 | ||
157 | <div id="method-M000014" class="method-detail"> | 157 | <div id="method-M000023" class="method-detail"> |
158 | <a name="M000014"></a> | 158 | <a name="M000023"></a> |
159 | 159 | ||
160 | <div class="method-heading"> | 160 | <div class="method-heading"> |
161 | 161 | ||
162 | <a href="Document.src/M000014.html" target="Code" class="method-signature" | 162 | <a href="Document.src/M000023.html" target="Code" class="method-signature" |
163 | onclick="popupCode('Document.src/M000014.html');return false;"> | 163 | onclick="popupCode('Document.src/M000023.html');return false;"> |
164 | 164 | ||
165 | <span class="method-name">new</span><span class="method-args">(content)</span> | 165 | <span class="method-name">new</span><span class="method-args">(content)</span> |
166 | 166 | ||
167 | </a> | 167 | </a> |
168 | 168 | ||
169 | </div> | 169 | </div> |
170 | 170 | ||
171 | <div class="method-description"> | 171 | <div class="method-description"> |
172 | 172 | ||
173 | </div> | 173 | </div> |
174 | </div> | 174 | </div> |
175 | 175 | ||
176 | 176 | ||
177 | <h3 class="section-bar">Public Instance methods</h3> | 177 | <h3 class="section-bar">Public Instance methods</h3> |
178 | 178 | ||
179 | 179 | ||
180 | <div id="method-M000012" class="method-detail"> | 180 | <div id="method-M000021" class="method-detail"> |
181 | <a name="M000012"></a> | 181 | <a name="M000021"></a> |
182 | 182 | ||
183 | <div class="method-heading"> | 183 | <div class="method-heading"> |
184 | 184 | ||
185 | <a href="Document.src/M000012.html" target="Code" class="method-signature" | 185 | <a href="Document.src/M000021.html" target="Code" class="method-signature" |
186 | onclick="popupCode('Document.src/M000012.html');return false;"> | 186 | onclick="popupCode('Document.src/M000021.html');return false;"> |
187 | 187 | ||
188 | <span class="method-name">count_words</span><span class="method-args">()</span> | 188 | <span class="method-name">count_words</span><span class="method-args">()</span> |
189 | 189 | ||
190 | </a> | 190 | </a> |
191 | 191 | ||
192 | </div> | 192 | </div> |
193 | 193 | ||
194 | <div class="method-description"> | 194 | <div class="method-description"> |
195 | 195 | ||
196 | <p> | 196 | <p> |
197 | Returns a Hash containing the words and their associated counts in the | 197 | Returns a Hash containing the words and their associated counts in the |
198 | current <a href="Document.html">Document</a>. | 198 | current <a href="Document.html">Document</a>. |
199 | </p> | 199 | </p> |
200 | <pre> | 200 | <pre> |
201 | count_words #=> { "guitar"=>1, "bass"=>3, "album"=>20, ... } | 201 | count_words #=> { "guitar"=>1, "bass"=>3, "album"=>20, ... } |
202 | </pre> | 202 | </pre> |
203 | 203 | ||
204 | </div> | 204 | </div> |
205 | </div> | 205 | </div> |
206 | 206 | ||
207 | 207 | ||
208 | <div id="method-M000013" class="method-detail"> | 208 | <div id="method-M000022" class="method-detail"> |
209 | <a name="M000013"></a> | 209 | <a name="M000022"></a> |
210 | 210 | ||
211 | <div class="method-heading"> | 211 | <div class="method-heading"> |
212 | 212 | ||
213 | <a href="Document.src/M000013.html" target="Code" class="method-signature" | 213 | <a href="Document.src/M000022.html" target="Code" class="method-signature" |
214 | onclick="popupCode('Document.src/M000013.html');return false;"> | 214 | onclick="popupCode('Document.src/M000022.html');return false;"> |
215 | 215 | ||
216 | <span class="method-name">entropy</span><span class="method-args">(s)</span> | 216 | <span class="method-name">entropy</span><span class="method-args">(s)</span> |
217 | 217 | ||
218 | </a> | 218 | </a> |
219 | 219 | ||
220 | </div> | 220 | </div> |
221 | 221 | ||
222 | <div class="method-description"> | 222 | <div class="method-description"> |
223 | 223 | ||
224 | <p> | 224 | <p> |
225 | Computes the entropy of a given string <tt>s</tt> inside the document. | 225 | Computes the entropy of a given string <tt>s</tt> inside the document. |
226 | </p> | 226 | </p> |
227 | <p> | 227 | <p> |
228 | If the string parameter is composed of many words (i.e. tokens separated by | 228 | If the string parameter is composed of many words (i.e. tokens separated by |
229 | whitespace(s)), it is considered as an ngram. | 229 | whitespace(s)), it is considered as an ngram. |
230 | </p> | 230 | </p> |
231 | <pre> | 231 | <pre> |
232 | entropy("guitar") #=> 0.00389919463243839 | 232 | entropy("guitar") #=> 0.00389919463243839 |
233 | </pre> | 233 | </pre> |
234 | 234 | ||
235 | </div> | 235 | </div> |
236 | </div> | 236 | </div> |
237 | 237 | ||
238 | 238 | ||
239 | <div id="method-M000011" class="method-detail"> | 239 | <div id="method-M000020" class="method-detail"> |
240 | <a name="M000011"></a> | 240 | <a name="M000020"></a> |
241 | 241 | ||
242 | <div class="method-heading"> | 242 | <div class="method-heading"> |
243 | 243 | ||
244 | <a href="Document.src/M000011.html" target="Code" class="method-signature" | 244 | <a href="Document.src/M000020.html" target="Code" class="method-signature" |
245 | onclick="popupCode('Document.src/M000011.html');return false;"> | 245 | onclick="popupCode('Document.src/M000020.html');return false;"> |
246 | 246 | ||
247 | <span class="method-name">ngrams</span><span class="method-args">(n)</span> | 247 | <span class="method-name">ngrams</span><span class="method-args">(n)</span> |
248 | 248 | ||
249 | </a> | 249 | </a> |
250 | 250 | ||
251 | </div> | 251 | </div> |
252 | 252 | ||
253 | <div class="method-description"> | 253 | <div class="method-description"> |
254 | 254 | ||
255 | <p> | 255 | <p> |
256 | Returns an Array containing the <tt>n</tt>-grams (words) from the current | 256 | Returns an Array containing the <tt>n</tt>-grams (words) from the current |
257 | <a href="Document.html">Document</a>. | 257 | <a href="Document.html">Document</a>. |
258 | </p> | 258 | </p> |
259 | <pre> | 259 | <pre> |
260 | ngrams(2) #=> ["the free", "free encyclopedia", "encyclopedia var", "var skin", ...] | 260 | ngrams(2) #=> ["the free", "free encyclopedia", "encyclopedia var", "var skin", ...] |
261 | </pre> | 261 | </pre> |
262 | 262 | ||
263 | </div> | 263 | </div> |
264 | </div> | 264 | </div> |
265 | 265 | ||
266 | 266 | ||
267 | <h3 class="section-bar">Protected Instance methods</h3> | 267 | <h3 class="section-bar">Protected Instance methods</h3> |
268 | 268 | ||
269 | 269 | ||
270 | <div id="method-M000010" class="method-detail"> | 270 | <div id="method-M000019" class="method-detail"> |
271 | <a name="M000010"></a> | 271 | <a name="M000019"></a> |
272 | 272 | ||
273 | <div class="method-heading"> | 273 | <div class="method-heading"> |
274 | 274 | ||
275 | <a href="Document.src/M000010.html" target="Code" class="method-signature" | 275 | <a href="Document.src/M000019.html" target="Code" class="method-signature" |
276 | onclick="popupCode('Document.src/M000010.html');return false;"> | 276 | onclick="popupCode('Document.src/M000019.html');return false;"> |
277 | 277 | ||
278 | <span class="method-name">format_words</span><span class="method-args">()</span> | 278 | <span class="method-name">format_words</span><span class="method-args">()</span> |
279 | 279 | ||
280 | </a> | 280 | </a> |
281 | 281 | ||
282 | </div> | 282 | </div> |
283 | 283 | ||
284 | <div class="method-description"> | 284 | <div class="method-description"> |
285 | 285 | ||
286 | <p> | 286 | <p> |
287 | Any non-word characters are removed from the words (see <a | 287 | Any non-word characters are removed from the words (see <a |
288 | href="http://perldoc.perl.org/perlre.html">perldoc.perl.org/perlre.html</a> | 288 | href="http://perldoc.perl.org/perlre.html">perldoc.perl.org/perlre.html</a> |
289 | and the W special escape). | 289 | and the W special escape). |
290 | </p> | 290 | </p> |
291 | <p> | 291 | <p> |
292 | Protected function, only meant to by called at the initialization. | 292 | Protected function, only meant to by called at the initialization. |
293 | </p> | 293 | </p> |
294 | 294 | ||
295 | </div> | 295 | </div> |
296 | </div> | 296 | </div> |
297 | 297 | ||
298 | 298 | ||
299 | 299 | ||
300 | </div> | 300 | </div> |
301 | 301 | ||
302 | 302 | ||
303 | 303 | ||
304 | 304 | ||
305 | </div> | 305 | </div> |
306 | 306 | ||
307 | <div id="validator-badges"> | 307 | <div id="validator-badges"> |
308 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 308 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
309 | </div> | 309 | </div> |
310 | 310 | ||
311 | </body> | 311 | </body> |
312 | </html> | 312 | </html> |
313 | 313 |
doc/classes/RIR/WebDocument.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>Class: RIR::WebDocument [RDoc Documentation]</title> | 5 | <title>Class: RIR::WebDocument [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="classHeader"> | 45 | <div id="classHeader"> |
46 | <table class="header-table"> | 46 | <table class="header-table"> |
47 | <tr class="top-aligned-row"> | 47 | <tr class="top-aligned-row"> |
48 | <td><strong>Class</strong></td> | 48 | <td><strong>Class</strong></td> |
49 | <td class="class-name-in-header">RIR::WebDocument</td> | 49 | <td class="class-name-in-header">RIR::WebDocument</td> |
50 | </tr> | 50 | </tr> |
51 | <tr class="top-aligned-row"> | 51 | <tr class="top-aligned-row"> |
52 | <td><strong>In:</strong></td> | 52 | <td><strong>In:</strong></td> |
53 | <td> | 53 | <td> |
54 | 54 | ||
55 | 55 | ||
56 | <a href="../../files/lib/rir/document_rb.html"> | 56 | <a href="../../files/lib/rir/document_rb.html"> |
57 | 57 | ||
58 | lib/rir/document.rb | 58 | lib/rir/document.rb |
59 | 59 | ||
60 | </a> | 60 | </a> |
61 | 61 | ||
62 | 62 | ||
63 | <br /> | 63 | <br /> |
64 | 64 | ||
65 | </td> | 65 | </td> |
66 | </tr> | 66 | </tr> |
67 | 67 | ||
68 | 68 | ||
69 | <tr class="top-aligned-row"> | 69 | <tr class="top-aligned-row"> |
70 | <td><strong>Parent:</strong></td> | 70 | <td><strong>Parent:</strong></td> |
71 | <td> | 71 | <td> |
72 | 72 | ||
73 | <a href="Document.html"> | 73 | <a href="Document.html"> |
74 | 74 | ||
75 | RIR::Document | 75 | RIR::Document |
76 | 76 | ||
77 | </a> | 77 | </a> |
78 | 78 | ||
79 | </td> | 79 | </td> |
80 | </tr> | 80 | </tr> |
81 | 81 | ||
82 | </table> | 82 | </table> |
83 | </div> | 83 | </div> |
84 | <!-- banner header --> | 84 | <!-- banner header --> |
85 | 85 | ||
86 | <div id="bodyContent"> | 86 | <div id="bodyContent"> |
87 | 87 | ||
88 | <div id="contextContent"> | 88 | <div id="contextContent"> |
89 | 89 | ||
90 | <div id="description"> | 90 | <div id="description"> |
91 | <p> | 91 | <p> |
92 | A <a href="WebDocument.html">WebDocument</a> is a <a | 92 | A <a href="WebDocument.html">WebDocument</a> is a <a |
93 | href="Document.html">Document</a> with a <tt>url</tt>. | 93 | href="Document.html">Document</a> with a <tt>url</tt>. |
94 | </p> | 94 | </p> |
95 | 95 | ||
96 | </div> | 96 | </div> |
97 | 97 | ||
98 | </div> | 98 | </div> |
99 | 99 | ||
100 | 100 | ||
101 | <div id="method-list"> | 101 | <div id="method-list"> |
102 | <h3 class="section-bar">Methods</h3> | 102 | <h3 class="section-bar">Methods</h3> |
103 | 103 | ||
104 | <div class="name-list"> | 104 | <div class="name-list"> |
105 | 105 | ||
106 | <a href="#M000015">get_content</a> | 106 | <a href="#M000024">get_content</a> |
107 | 107 | ||
108 | <a href="#M000016">new</a> | 108 | <a href="#M000025">new</a> |
109 | 109 | ||
110 | </div> | 110 | </div> |
111 | </div> | 111 | </div> |
112 | 112 | ||
113 | </div> | 113 | </div> |
114 | 114 | ||
115 | <!-- if includes --> | 115 | <!-- if includes --> |
116 | 116 | ||
117 | <div id="section"> | 117 | <div id="section"> |
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | <div id="attribute-list"> | 121 | <div id="attribute-list"> |
122 | <h3 class="section-bar">Attributes</h3> | 122 | <h3 class="section-bar">Attributes</h3> |
123 | 123 | ||
124 | <div class="name-list"> | 124 | <div class="name-list"> |
125 | <table> | 125 | <table> |
126 | 126 | ||
127 | <tr class="top-aligned-row context-row"> | 127 | <tr class="top-aligned-row context-row"> |
128 | <td class="context-item-name">url</td> | 128 | <td class="context-item-name">url</td> |
129 | 129 | ||
130 | <td class="context-item-value"> [R] </td> | 130 | <td class="context-item-value"> [R] </td> |
131 | 131 | ||
132 | <td class="context-item-desc"></td> | 132 | <td class="context-item-desc"></td> |
133 | </tr> | 133 | </tr> |
134 | 134 | ||
135 | </table> | 135 | </table> |
136 | </div> | 136 | </div> |
137 | </div> | 137 | </div> |
138 | 138 | ||
139 | 139 | ||
140 | <!-- if method_list --> | 140 | <!-- if method_list --> |
141 | 141 | ||
142 | <div id="methods"> | 142 | <div id="methods"> |
143 | 143 | ||
144 | <h3 class="section-bar">Public Class methods</h3> | 144 | <h3 class="section-bar">Public Class methods</h3> |
145 | 145 | ||
146 | 146 | ||
147 | <div id="method-M000015" class="method-detail"> | 147 | <div id="method-M000024" class="method-detail"> |
148 | <a name="M000015"></a> | 148 | <a name="M000024"></a> |
149 | 149 | ||
150 | <div class="method-heading"> | 150 | <div class="method-heading"> |
151 | 151 | ||
152 | <a href="WebDocument.src/M000015.html" target="Code" class="method-signature" | 152 | <a href="WebDocument.src/M000024.html" target="Code" class="method-signature" |
153 | onclick="popupCode('WebDocument.src/M000015.html');return false;"> | 153 | onclick="popupCode('WebDocument.src/M000024.html');return false;"> |
154 | 154 | ||
155 | <span class="method-name">get_content</span><span class="method-args">(url)</span> | 155 | <span class="method-name">get_content</span><span class="method-args">(url)</span> |
156 | 156 | ||
157 | </a> | 157 | </a> |
158 | 158 | ||
159 | </div> | 159 | </div> |
160 | 160 | ||
161 | <div class="method-description"> | 161 | <div class="method-description"> |
162 | 162 | ||
163 | <p> | 163 | <p> |
164 | Returns the HTML text from the page of a given <tt>url</tt>. | 164 | Returns the HTML text from the page of a given <tt>url</tt>. |
165 | </p> | 165 | </p> |
166 | 166 | ||
167 | </div> | 167 | </div> |
168 | </div> | 168 | </div> |
169 | 169 | ||
170 | 170 | ||
171 | <div id="method-M000016" class="method-detail"> | 171 | <div id="method-M000025" class="method-detail"> |
172 | <a name="M000016"></a> | 172 | <a name="M000025"></a> |
173 | 173 | ||
174 | <div class="method-heading"> | 174 | <div class="method-heading"> |
175 | 175 | ||
176 | <a href="WebDocument.src/M000016.html" target="Code" class="method-signature" | 176 | <a href="WebDocument.src/M000025.html" target="Code" class="method-signature" |
177 | onclick="popupCode('WebDocument.src/M000016.html');return false;"> | 177 | onclick="popupCode('WebDocument.src/M000025.html');return false;"> |
178 | 178 | ||
179 | <span class="method-name">new</span><span class="method-args">(url)</span> | 179 | <span class="method-name">new</span><span class="method-args">(url)</span> |
180 | 180 | ||
181 | </a> | 181 | </a> |
182 | 182 | ||
183 | </div> | 183 | </div> |
184 | 184 | ||
185 | <div class="method-description"> | 185 | <div class="method-description"> |
186 | 186 | ||
187 | <p> | 187 | <p> |
188 | <a href="WebDocument.html">WebDocument</a> constructor, the content of the | 188 | <a href="WebDocument.html">WebDocument</a> constructor, the content of the |
189 | <a href="Document.html">Document</a> is the HTML page without the tags. | 189 | <a href="Document.html">Document</a> is the HTML page without the tags. |
190 | </p> | 190 | </p> |
191 | 191 | ||
192 | </div> | 192 | </div> |
193 | </div> | 193 | </div> |
194 | 194 | ||
195 | 195 | ||
196 | 196 | ||
197 | </div> | 197 | </div> |
198 | 198 | ||
199 | 199 | ||
200 | 200 | ||
201 | 201 | ||
202 | </div> | 202 | </div> |
203 | 203 | ||
204 | <div id="validator-badges"> | 204 | <div id="validator-badges"> |
205 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 205 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
206 | </div> | 206 | </div> |
207 | 207 | ||
208 | </body> | 208 | </body> |
209 | </html> | 209 | </html> |
210 | 210 |
doc/classes/RIR/WikipediaPage.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>Class: RIR::WikipediaPage [RDoc Documentation]</title> | 5 | <title>Class: RIR::WikipediaPage [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="classHeader"> | 45 | <div id="classHeader"> |
46 | <table class="header-table"> | 46 | <table class="header-table"> |
47 | <tr class="top-aligned-row"> | 47 | <tr class="top-aligned-row"> |
48 | <td><strong>Class</strong></td> | 48 | <td><strong>Class</strong></td> |
49 | <td class="class-name-in-header">RIR::WikipediaPage</td> | 49 | <td class="class-name-in-header">RIR::WikipediaPage</td> |
50 | </tr> | 50 | </tr> |
51 | <tr class="top-aligned-row"> | 51 | <tr class="top-aligned-row"> |
52 | <td><strong>In:</strong></td> | 52 | <td><strong>In:</strong></td> |
53 | <td> | 53 | <td> |
54 | 54 | ||
55 | 55 | ||
56 | <a href="../../files/lib/rir/document_rb.html"> | 56 | <a href="../../files/lib/rir/document_rb.html"> |
57 | 57 | ||
58 | lib/rir/document.rb | 58 | lib/rir/document.rb |
59 | 59 | ||
60 | </a> | 60 | </a> |
61 | 61 | ||
62 | 62 | ||
63 | <br /> | 63 | <br /> |
64 | 64 | ||
65 | </td> | 65 | </td> |
66 | </tr> | 66 | </tr> |
67 | 67 | ||
68 | 68 | ||
69 | <tr class="top-aligned-row"> | 69 | <tr class="top-aligned-row"> |
70 | <td><strong>Parent:</strong></td> | 70 | <td><strong>Parent:</strong></td> |
71 | <td> | 71 | <td> |
72 | 72 | ||
73 | <a href="WebDocument.html"> | 73 | <a href="WebDocument.html"> |
74 | 74 | ||
75 | RIR::WebDocument | 75 | RIR::WebDocument |
76 | 76 | ||
77 | </a> | 77 | </a> |
78 | 78 | ||
79 | </td> | 79 | </td> |
80 | </tr> | 80 | </tr> |
81 | 81 | ||
82 | </table> | 82 | </table> |
83 | </div> | 83 | </div> |
84 | <!-- banner header --> | 84 | <!-- banner header --> |
85 | 85 | ||
86 | <div id="bodyContent"> | 86 | <div id="bodyContent"> |
87 | 87 | ||
88 | <div id="contextContent"> | 88 | <div id="contextContent"> |
89 | 89 | ||
90 | <div id="description"> | 90 | <div id="description"> |
91 | <p> | 91 | <p> |
92 | A <a href="WikipediaPage.html">WikipediaPage</a> is a <a | 92 | A <a href="WikipediaPage.html">WikipediaPage</a> is a <a |
93 | href="WebDocument.html">WebDocument</a>. | 93 | href="WebDocument.html">WebDocument</a>. |
94 | </p> | 94 | </p> |
95 | 95 | ||
96 | </div> | 96 | </div> |
97 | 97 | ||
98 | </div> | 98 | </div> |
99 | 99 | ||
100 | 100 | ||
101 | <div id="method-list"> | ||
102 | <h3 class="section-bar">Methods</h3> | ||
103 | |||
104 | <div class="name-list"> | ||
105 | |||
106 | <a href="#M000027">get_url</a> | ||
107 | |||
108 | <a href="#M000028">search_homepage</a> | ||
109 | |||
110 | <a href="#M000026">search_wikipedia_titles</a> | ||
111 | |||
112 | </div> | ||
113 | </div> | ||
114 | |||
101 | </div> | 115 | </div> |
102 | 116 | ||
103 | <!-- if includes --> | 117 | <!-- if includes --> |
104 | 118 | ||
105 | <div id="section"> | 119 | <div id="section"> |
106 | 120 | ||
107 | 121 | ||
108 | 122 | ||
109 | 123 | ||
110 | <!-- if method_list --> | 124 | <!-- if method_list --> |
125 | |||
126 | <div id="methods"> | ||
127 | |||
128 | <h3 class="section-bar">Public Class methods</h3> | ||
129 | |||
130 | |||
131 | <div id="method-M000027" class="method-detail"> | ||
132 | <a name="M000027"></a> | ||
133 | |||
134 | <div class="method-heading"> | ||
135 | |||
136 | <a href="WikipediaPage.src/M000027.html" target="Code" class="method-signature" | ||
137 | onclick="popupCode('WikipediaPage.src/M000027.html');return false;"> | ||
138 | |||
139 | <span class="method-name">get_url</span><span class="method-args">(name)</span> | ||
140 | |||
141 | </a> | ||
142 | |||
143 | </div> | ||
144 | |||
145 | <div class="method-description"> | ||
146 | |||
147 | </div> | ||
148 | </div> | ||
149 | |||
150 | |||
151 | <div id="method-M000028" class="method-detail"> | ||
152 | <a name="M000028"></a> | ||
153 | |||
154 | <div class="method-heading"> | ||
155 | |||
156 | <a href="WikipediaPage.src/M000028.html" target="Code" class="method-signature" | ||
157 | onclick="popupCode('WikipediaPage.src/M000028.html');return false;"> | ||
158 | |||
159 | <span class="method-name">search_homepage</span><span class="method-args">(name)</span> | ||
160 | |||
161 | </a> | ||
162 | |||
163 | </div> | ||
164 | |||
165 | <div class="method-description"> | ||
166 | |||
167 | </div> | ||
168 | </div> | ||
169 | |||
170 | |||
171 | <div id="method-M000026" class="method-detail"> | ||
172 | <a name="M000026"></a> | ||
173 | |||
174 | <div class="method-heading"> | ||
175 | |||
176 | <a href="WikipediaPage.src/M000026.html" target="Code" class="method-signature" | ||
177 | onclick="popupCode('WikipediaPage.src/M000026.html');return false;"> | ||
178 | |||
179 | <span class="method-name">search_wikipedia_titles</span><span class="method-args">(name)</span> | ||
180 | |||
181 | </a> | ||
182 | |||
183 | </div> | ||
184 | |||
185 | <div class="method-description"> | ||
186 | |||
187 | </div> | ||
188 | </div> | ||
189 | |||
190 | |||
191 | |||
192 | </div> | ||
111 | 193 | ||
112 | 194 | ||
113 | 195 | ||
114 | 196 | ||
115 | </div> | 197 | </div> |
116 | 198 | ||
117 | <div id="validator-badges"> | 199 | <div id="validator-badges"> |
118 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 200 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
119 | </div> | 201 | </div> |
120 | 202 | ||
121 | </body> | 203 | </body> |
122 | </html> | 204 | </html> |
123 | 205 |
doc/classes/String.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>Class: String [RDoc Documentation]</title> | 5 | <title>Class: String [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="classHeader"> | 45 | <div id="classHeader"> |
46 | <table class="header-table"> | 46 | <table class="header-table"> |
47 | <tr class="top-aligned-row"> | 47 | <tr class="top-aligned-row"> |
48 | <td><strong>Class</strong></td> | 48 | <td><strong>Class</strong></td> |
49 | <td class="class-name-in-header">String</td> | 49 | <td class="class-name-in-header">String</td> |
50 | </tr> | 50 | </tr> |
51 | <tr class="top-aligned-row"> | 51 | <tr class="top-aligned-row"> |
52 | <td><strong>In:</strong></td> | 52 | <td><strong>In:</strong></td> |
53 | <td> | 53 | <td> |
54 | 54 | ||
55 | 55 | ||
56 | <a href="../files/lib/rir/string_rb.html"> | 56 | <a href="../files/lib/rir/string_rb.html"> |
57 | 57 | ||
58 | lib/rir/string.rb | 58 | lib/rir/string.rb |
59 | 59 | ||
60 | </a> | 60 | </a> |
61 | 61 | ||
62 | 62 | ||
63 | <br /> | 63 | <br /> |
64 | 64 | ||
65 | </td> | 65 | </td> |
66 | </tr> | 66 | </tr> |
67 | 67 | ||
68 | 68 | ||
69 | <tr class="top-aligned-row"> | 69 | <tr class="top-aligned-row"> |
70 | <td><strong>Parent:</strong></td> | 70 | <td><strong>Parent:</strong></td> |
71 | <td> | 71 | <td> |
72 | 72 | ||
73 | Object | 73 | Object |
74 | 74 | ||
75 | </td> | 75 | </td> |
76 | </tr> | 76 | </tr> |
77 | 77 | ||
78 | </table> | 78 | </table> |
79 | </div> | 79 | </div> |
80 | <!-- banner header --> | 80 | <!-- banner header --> |
81 | 81 | ||
82 | <div id="bodyContent"> | 82 | <div id="bodyContent"> |
83 | 83 | ||
84 | <div id="contextContent"> | 84 | <div id="contextContent"> |
85 | 85 | ||
86 | <div id="description"> | 86 | <div id="description"> |
87 | <p> | 87 | <p> |
88 | Extention of the standard class <a href="String.html">String</a> with | 88 | Extention of the standard class <a href="String.html">String</a> with |
89 | useful function. | 89 | useful function. |
90 | </p> | 90 | </p> |
91 | 91 | ||
92 | </div> | 92 | </div> |
93 | 93 | ||
94 | </div> | 94 | </div> |
95 | 95 | ||
96 | 96 | ||
97 | <div id="method-list"> | 97 | <div id="method-list"> |
98 | <h3 class="section-bar">Methods</h3> | 98 | <h3 class="section-bar">Methods</h3> |
99 | 99 | ||
100 | <div class="name-list"> | 100 | <div class="name-list"> |
101 | 101 | ||
102 | <a href="#M000009">extract_xmltags_values</a> | 102 | <a href="#M000011">extract_xmltags_values</a> |
103 | 103 | ||
104 | <a href="#M000001">is_stopword?</a> | 104 | <a href="#M000001">is_stopword?</a> |
105 | 105 | ||
106 | <a href="#M000002">remove_special_characters</a> | 106 | <a href="#M000002">remove_special_characters</a> |
107 | 107 | ||
108 | <a href="#M000006">strip_javascripts</a> | 108 | <a href="#M000006">strip_javascripts</a> |
109 | 109 | ||
110 | <a href="#M000005">strip_javascripts!</a> | 110 | <a href="#M000005">strip_javascripts!</a> |
111 | 111 | ||
112 | <a href="#M000010">strip_punctuation</a> | ||
113 | |||
114 | <a href="#M000009">strip_punctuation!</a> | ||
115 | |||
112 | <a href="#M000008">strip_stylesheets</a> | 116 | <a href="#M000008">strip_stylesheets</a> |
113 | 117 | ||
114 | <a href="#M000007">strip_stylesheets!</a> | 118 | <a href="#M000007">strip_stylesheets!</a> |
115 | 119 | ||
116 | <a href="#M000004">strip_xml_tags</a> | 120 | <a href="#M000004">strip_xml_tags</a> |
117 | 121 | ||
118 | <a href="#M000003">strip_xml_tags!</a> | 122 | <a href="#M000003">strip_xml_tags!</a> |
119 | 123 | ||
120 | </div> | 124 | </div> |
121 | </div> | 125 | </div> |
122 | 126 | ||
123 | </div> | 127 | </div> |
124 | 128 | ||
125 | <!-- if includes --> | 129 | <!-- if includes --> |
126 | 130 | ||
127 | <div id="includes"> | 131 | <div id="includes"> |
128 | <h3 class="section-bar">Included Modules</h3> | 132 | <h3 class="section-bar">Included Modules</h3> |
129 | 133 | ||
130 | <div id="includes-list"> | 134 | <div id="includes-list"> |
131 | 135 | ||
132 | <span class="include-name"><a href="RIR.html">RIR</a></span> | 136 | <span class="include-name"><a href="RIR.html">RIR</a></span> |
133 | 137 | ||
134 | </div> | 138 | </div> |
135 | </div> | 139 | </div> |
136 | 140 | ||
137 | <div id="section"> | 141 | <div id="section"> |
138 | 142 | ||
139 | 143 | ||
140 | 144 | ||
141 | 145 | ||
142 | <!-- if method_list --> | 146 | <!-- if method_list --> |
143 | 147 | ||
144 | <div id="methods"> | 148 | <div id="methods"> |
145 | 149 | ||
146 | <h3 class="section-bar">Public Instance methods</h3> | 150 | <h3 class="section-bar">Public Instance methods</h3> |
147 | 151 | ||
148 | 152 | ||
149 | <div id="method-M000009" class="method-detail"> | 153 | <div id="method-M000011" class="method-detail"> |
150 | <a name="M000009"></a> | 154 | <a name="M000011"></a> |
151 | 155 | ||
152 | <div class="method-heading"> | 156 | <div class="method-heading"> |
153 | 157 | ||
154 | <a href="String.src/M000009.html" target="Code" class="method-signature" | 158 | <a href="String.src/M000011.html" target="Code" class="method-signature" |
155 | onclick="popupCode('String.src/M000009.html');return false;"> | 159 | onclick="popupCode('String.src/M000011.html');return false;"> |
156 | 160 | ||
157 | <span class="method-name">extract_xmltags_values</span><span class="method-args">(tag_name)</span> | 161 | <span class="method-name">extract_xmltags_values</span><span class="method-args">(tag_name)</span> |
158 | 162 | ||
159 | </a> | 163 | </a> |
160 | 164 | ||
161 | </div> | 165 | </div> |
162 | 166 | ||
163 | <div class="method-description"> | 167 | <div class="method-description"> |
164 | 168 | ||
165 | <p> | 169 | <p> |
166 | Returns the text values inside all occurences of a XML tag in <tt>self</tt> | 170 | Returns the text values inside all occurences of a XML tag in <tt>self</tt> |
167 | </p> | 171 | </p> |
168 | <pre> | 172 | <pre> |
169 | s = "four-piece in <a href='#'>Indianapolis</a>, <a href='#'>Indiana</a> at the Murat Theatre" | 173 | s = "four-piece in <a href='#'>Indianapolis</a>, <a href='#'>Indiana</a> at the Murat Theatre" |
170 | s.extract_xmltags_values 'a' #=> ["Indianapolis", "Indiana"] | 174 | s.extract_xmltags_values 'a' #=> ["Indianapolis", "Indiana"] |
171 | </pre> | 175 | </pre> |
172 | 176 | ||
173 | </div> | 177 | </div> |
174 | </div> | 178 | </div> |
175 | 179 | ||
176 | 180 | ||
177 | <div id="method-M000001" class="method-detail"> | 181 | <div id="method-M000001" class="method-detail"> |
178 | <a name="M000001"></a> | 182 | <a name="M000001"></a> |
179 | 183 | ||
180 | <div class="method-heading"> | 184 | <div class="method-heading"> |
181 | 185 | ||
182 | <a href="String.src/M000001.html" target="Code" class="method-signature" | 186 | <a href="String.src/M000001.html" target="Code" class="method-signature" |
183 | onclick="popupCode('String.src/M000001.html');return false;"> | 187 | onclick="popupCode('String.src/M000001.html');return false;"> |
184 | 188 | ||
185 | <span class="method-name">is_stopword?</span><span class="method-args">()</span> | 189 | <span class="method-name">is_stopword?</span><span class="method-args">()</span> |
186 | 190 | ||
187 | </a> | 191 | </a> |
188 | 192 | ||
189 | </div> | 193 | </div> |
190 | 194 | ||
191 | <div class="method-description"> | 195 | <div class="method-description"> |
192 | 196 | ||
193 | <p> | 197 | <p> |
194 | Returns <tt>true</tt> if <tt>self</tt> belongs to Rir::Stoplist, | 198 | Returns <tt>true</tt> if <tt>self</tt> belongs to Rir::Stoplist, |
195 | <tt>false</tt> otherwise. | 199 | <tt>false</tt> otherwise. |
196 | </p> | 200 | </p> |
197 | 201 | ||
198 | </div> | 202 | </div> |
199 | </div> | 203 | </div> |
200 | 204 | ||
201 | 205 | ||
202 | <div id="method-M000002" class="method-detail"> | 206 | <div id="method-M000002" class="method-detail"> |
203 | <a name="M000002"></a> | 207 | <a name="M000002"></a> |
204 | 208 | ||
205 | <div class="method-heading"> | 209 | <div class="method-heading"> |
206 | 210 | ||
207 | <a href="String.src/M000002.html" target="Code" class="method-signature" | 211 | <a href="String.src/M000002.html" target="Code" class="method-signature" |
208 | onclick="popupCode('String.src/M000002.html');return false;"> | 212 | onclick="popupCode('String.src/M000002.html');return false;"> |
209 | 213 | ||
210 | <span class="method-name">remove_special_characters</span><span class="method-args">()</span> | 214 | <span class="method-name">remove_special_characters</span><span class="method-args">()</span> |
211 | 215 | ||
212 | </a> | 216 | </a> |
213 | 217 | ||
214 | </div> | 218 | </div> |
215 | 219 | ||
216 | <div class="method-description"> | 220 | <div class="method-description"> |
217 | 221 | ||
218 | <p> | 222 | <p> |
219 | Do not use. TODO: rewamp. find why this function is here. | 223 | Do not use. TODO: rewamp. find why this function is here. |
220 | </p> | 224 | </p> |
221 | 225 | ||
222 | </div> | 226 | </div> |
223 | </div> | 227 | </div> |
224 | 228 | ||
225 | 229 | ||
226 | <div id="method-M000006" class="method-detail"> | 230 | <div id="method-M000006" class="method-detail"> |
227 | <a name="M000006"></a> | 231 | <a name="M000006"></a> |
228 | 232 | ||
229 | <div class="method-heading"> | 233 | <div class="method-heading"> |
230 | 234 | ||
231 | <a href="String.src/M000006.html" target="Code" class="method-signature" | 235 | <a href="String.src/M000006.html" target="Code" class="method-signature" |
232 | onclick="popupCode('String.src/M000006.html');return false;"> | 236 | onclick="popupCode('String.src/M000006.html');return false;"> |
233 | 237 | ||
234 | <span class="method-name">strip_javascripts</span><span class="method-args">()</span> | 238 | <span class="method-name">strip_javascripts</span><span class="method-args">()</span> |
235 | 239 | ||
236 | </a> | 240 | </a> |
237 | 241 | ||
238 | </div> | 242 | </div> |
239 | 243 | ||
240 | <div class="method-description"> | 244 | <div class="method-description"> |
241 | 245 | ||
242 | <p> | 246 | <p> |
243 | Removes all Javascript sources from <tt>self</tt>. | 247 | Removes all Javascript sources from <tt>self</tt>. |
244 | </p> | 248 | </p> |
245 | <pre> | 249 | <pre> |
246 | s = "<script type='text/javascript'> | 250 | s = "<script type='text/javascript'> |
247 | var skin='vector', | 251 | var skin='vector', |
248 | stylepath='http://bits.wikimedia.org/skins-1.5' | 252 | stylepath='http://bits.wikimedia.org/skins-1.5' |
249 | </script> | 253 | </script> |
250 | 254 | ||
251 | test" | 255 | test" |
252 | s.strip_javascripts #=> "test" | 256 | s.strip_javascripts #=> "test" |
253 | </pre> | 257 | </pre> |
254 | 258 | ||
255 | </div> | 259 | </div> |
256 | </div> | 260 | </div> |
257 | 261 | ||
258 | 262 | ||
259 | <div id="method-M000005" class="method-detail"> | 263 | <div id="method-M000005" class="method-detail"> |
260 | <a name="M000005"></a> | 264 | <a name="M000005"></a> |
261 | 265 | ||
262 | <div class="method-heading"> | 266 | <div class="method-heading"> |
263 | 267 | ||
264 | <a href="String.src/M000005.html" target="Code" class="method-signature" | 268 | <a href="String.src/M000005.html" target="Code" class="method-signature" |
265 | onclick="popupCode('String.src/M000005.html');return false;"> | 269 | onclick="popupCode('String.src/M000005.html');return false;"> |
266 | 270 | ||
267 | <span class="method-name">strip_javascripts!</span><span class="method-args">()</span> | 271 | <span class="method-name">strip_javascripts!</span><span class="method-args">()</span> |
268 | 272 | ||
269 | </a> | 273 | </a> |
270 | 274 | ||
271 | </div> | 275 | </div> |
272 | 276 | ||
273 | <div class="method-description"> | 277 | <div class="method-description"> |
274 | 278 | ||
275 | <p> | 279 | <p> |
276 | Removes all Javascript sources from <tt>self</tt>. | 280 | Removes all Javascript sources from <tt>self</tt>. |
277 | </p> | 281 | </p> |
278 | <pre> | 282 | <pre> |
279 | s = "<script type='text/javascript'> | 283 | s = "<script type='text/javascript'> |
280 | var skin='vector', | 284 | var skin='vector', |
281 | stylepath='http://bits.wikimedia.org/skins-1.5' | 285 | stylepath='http://bits.wikimedia.org/skins-1.5' |
282 | </script> | 286 | </script> |
283 | 287 | ||
284 | test" | 288 | test" |
285 | s.strip_javascripts! | 289 | s.strip_javascripts! |
286 | s #=> "test" | 290 | s #=> "test" |
291 | </pre> | ||
292 | |||
293 | </div> | ||
294 | </div> | ||
295 | |||
296 | |||
297 | <div id="method-M000010" class="method-detail"> | ||
298 | <a name="M000010"></a> | ||
299 | |||
300 | <div class="method-heading"> | ||
301 | |||
302 | <a href="String.src/M000010.html" target="Code" class="method-signature" | ||
303 | onclick="popupCode('String.src/M000010.html');return false;"> | ||
304 | |||
305 | <span class="method-name">strip_punctuation</span><span class="method-args">()</span> | ||
306 | |||
307 | </a> | ||
308 | |||
309 | </div> | ||
310 | |||
311 | <div class="method-description"> | ||
312 | |||
313 | <p> | ||
314 | Removes punctuation from <tt>self</tt>. | ||
315 | </p> | ||
316 | <pre> | ||
317 | s = "hello, world. how are you?!" | ||
318 | s.strip_punctuation # => "hello world how are you" | ||
319 | </pre> | ||
320 | |||
321 | </div> | ||
322 | </div> | ||
323 | |||
324 | |||
325 | <div id="method-M000009" class="method-detail"> | ||
326 | <a name="M000009"></a> | ||
327 | |||
328 | <div class="method-heading"> | ||
329 | |||
330 | <a href="String.src/M000009.html" target="Code" class="method-signature" | ||
331 | onclick="popupCode('String.src/M000009.html');return false;"> | ||
332 | |||
333 | <span class="method-name">strip_punctuation!</span><span class="method-args">()</span> | ||
334 | |||
335 | </a> | ||
336 | |||
337 | </div> | ||
338 | |||
339 | <div class="method-description"> | ||
340 | |||
341 | <p> | ||
342 | Removes punctuation from <tt>self</tt>. | ||
343 | </p> | ||
344 | <pre> | ||
345 | s = "hello, world. how are you?!" | ||
346 | s.strip_punctuation! | ||
347 | s # => "hello world how are you" | ||
287 | </pre> | 348 | </pre> |
288 | 349 | ||
289 | </div> | 350 | </div> |
290 | </div> | 351 | </div> |
291 | 352 | ||
292 | 353 | ||
293 | <div id="method-M000008" class="method-detail"> | 354 | <div id="method-M000008" class="method-detail"> |
294 | <a name="M000008"></a> | 355 | <a name="M000008"></a> |
295 | 356 | ||
296 | <div class="method-heading"> | 357 | <div class="method-heading"> |
297 | 358 | ||
298 | <a href="String.src/M000008.html" target="Code" class="method-signature" | 359 | <a href="String.src/M000008.html" target="Code" class="method-signature" |
299 | onclick="popupCode('String.src/M000008.html');return false;"> | 360 | onclick="popupCode('String.src/M000008.html');return false;"> |
300 | 361 | ||
301 | <span class="method-name">strip_stylesheets</span><span class="method-args">()</span> | 362 | <span class="method-name">strip_stylesheets</span><span class="method-args">()</span> |
302 | 363 | ||
303 | </a> | 364 | </a> |
304 | 365 | ||
305 | </div> | 366 | </div> |
306 | 367 | ||
307 | <div class="method-description"> | 368 | <div class="method-description"> |
308 | 369 | ||
309 | </div> | 370 | </div> |
310 | </div> | 371 | </div> |
311 | 372 | ||
312 | 373 | ||
313 | <div id="method-M000007" class="method-detail"> | 374 | <div id="method-M000007" class="method-detail"> |
314 | <a name="M000007"></a> | 375 | <a name="M000007"></a> |
315 | 376 | ||
316 | <div class="method-heading"> | 377 | <div class="method-heading"> |
317 | 378 | ||
318 | <a href="String.src/M000007.html" target="Code" class="method-signature" | 379 | <a href="String.src/M000007.html" target="Code" class="method-signature" |
319 | onclick="popupCode('String.src/M000007.html');return false;"> | 380 | onclick="popupCode('String.src/M000007.html');return false;"> |
320 | 381 | ||
321 | <span class="method-name">strip_stylesheets!</span><span class="method-args">()</span> | 382 | <span class="method-name">strip_stylesheets!</span><span class="method-args">()</span> |
322 | 383 | ||
323 | </a> | 384 | </a> |
324 | 385 | ||
325 | </div> | 386 | </div> |
326 | 387 | ||
327 | <div class="method-description"> | 388 | <div class="method-description"> |
328 | 389 | ||
329 | </div> | 390 | </div> |
330 | </div> | 391 | </div> |
331 | 392 | ||
332 | 393 | ||
333 | <div id="method-M000004" class="method-detail"> | 394 | <div id="method-M000004" class="method-detail"> |
334 | <a name="M000004"></a> | 395 | <a name="M000004"></a> |
335 | 396 | ||
336 | <div class="method-heading"> | 397 | <div class="method-heading"> |
337 | 398 | ||
338 | <a href="String.src/M000004.html" target="Code" class="method-signature" | 399 | <a href="String.src/M000004.html" target="Code" class="method-signature" |
339 | onclick="popupCode('String.src/M000004.html');return false;"> | 400 | onclick="popupCode('String.src/M000004.html');return false;"> |
340 | 401 | ||
341 | <span class="method-name">strip_xml_tags</span><span class="method-args">()</span> | 402 | <span class="method-name">strip_xml_tags</span><span class="method-args">()</span> |
342 | 403 | ||
343 | </a> | 404 | </a> |
344 | 405 | ||
345 | </div> | 406 | </div> |
346 | 407 | ||
347 | <div class="method-description"> | 408 | <div class="method-description"> |
348 | 409 | ||
349 | <p> | 410 | <p> |
350 | Removes all XML-like tags from <tt>self</tt>. | 411 | Removes all XML-like tags from <tt>self</tt>. |
351 | </p> | 412 | </p> |
352 | <pre> | 413 | <pre> |
353 | s = "<html><body>test</body></html>" | 414 | s = "<html><body>test</body></html>" |
354 | s.strip_xml_tags #=> "test" | 415 | s.strip_xml_tags #=> "test" |
355 | s #=> "<html><body>test</body></html>" | 416 | s #=> "<html><body>test</body></html>" |
356 | </pre> | 417 | </pre> |
357 | 418 | ||
358 | </div> | 419 | </div> |
359 | </div> | 420 | </div> |
360 | 421 | ||
361 | 422 | ||
362 | <div id="method-M000003" class="method-detail"> | 423 | <div id="method-M000003" class="method-detail"> |
363 | <a name="M000003"></a> | 424 | <a name="M000003"></a> |
364 | 425 | ||
365 | <div class="method-heading"> | 426 | <div class="method-heading"> |
366 | 427 | ||
367 | <a href="String.src/M000003.html" target="Code" class="method-signature" | 428 | <a href="String.src/M000003.html" target="Code" class="method-signature" |
368 | onclick="popupCode('String.src/M000003.html');return false;"> | 429 | onclick="popupCode('String.src/M000003.html');return false;"> |
369 | 430 | ||
370 | <span class="method-name">strip_xml_tags!</span><span class="method-args">()</span> | 431 | <span class="method-name">strip_xml_tags!</span><span class="method-args">()</span> |
371 | 432 | ||
372 | </a> | 433 | </a> |
373 | 434 | ||
374 | </div> | 435 | </div> |
375 | 436 | ||
376 | <div class="method-description"> | 437 | <div class="method-description"> |
377 | 438 | ||
378 | <p> | 439 | <p> |
379 | Removes all XML-like tags from <tt>self</tt>. | 440 | Removes all XML-like tags from <tt>self</tt>. |
380 | </p> | 441 | </p> |
381 | <pre> | 442 | <pre> |
382 | s = "<html><body>test</body></html>" | 443 | s = "<html><body>test</body></html>" |
383 | s.strip_xml_tags! | 444 | s.strip_xml_tags! |
384 | s #=> "test" | 445 | s #=> "test" |
385 | </pre> | 446 | </pre> |
386 | 447 | ||
387 | </div> | 448 | </div> |
388 | </div> | 449 | </div> |
389 | 450 | ||
390 | 451 | ||
391 | 452 | ||
392 | </div> | 453 | </div> |
393 | 454 | ||
394 | 455 | ||
395 | 456 | ||
396 | 457 | ||
397 | </div> | 458 | </div> |
398 | 459 | ||
399 | <div id="validator-badges"> | 460 | <div id="validator-badges"> |
400 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 461 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
401 | </div> | 462 | </div> |
402 | 463 | ||
403 | </body> | 464 | </body> |
404 | </html> | 465 | </html> |
405 | 466 |
doc/classes/String.src/M000001.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>is_stopword? (String)</title> | 5 | <title>is_stopword? (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 77</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 76</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_stopword?</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_stopword?</span> |
12 | <span class="ruby-constant">Stoplist</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">downcase</span>) | 12 | <span class="ruby-constant">Stoplist</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">downcase</span>) |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000002.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>remove_special_characters (String)</title> | 5 | <title>remove_special_characters (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 83</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 82</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_special_characters</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_special_characters</span> |
12 | <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">split</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\W/</span>,<span class="ruby-value str">' '</span>).<span class="ruby-identifier">split</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\W/</span>,<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\A.\z/</span>, <span class="ruby-value str">''</span>)}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\A.\z/</span>, <span class="ruby-value str">''</span>)}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>) | 12 | <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">split</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\W/</span>,<span class="ruby-value str">' '</span>).<span class="ruby-identifier">split</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\W/</span>,<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\A.\z/</span>, <span class="ruby-value str">''</span>)}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\A.\z/</span>, <span class="ruby-value str">''</span>)}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>) |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000003.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>strip_xml_tags! (String)</title> | 5 | <title>strip_xml_tags! (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 92</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 91</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_xml_tags!</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_xml_tags!</span> |
12 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span><span class="ruby-operator"><</span>\<span class="ruby-regexp re">/?[^>]*>/</span> | 12 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span><span class="ruby-operator"><</span>\<span class="ruby-regexp re">/?[^>]*>/</span> |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000004.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>strip_xml_tags (String)</title> | 5 | <title>strip_xml_tags (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 101</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 100</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_xml_tags</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_xml_tags</span> |
12 | <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">strip_xml_tags!</span> | 12 | <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">strip_xml_tags!</span> |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000005.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>strip_javascripts! (String)</title> | 5 | <title>strip_javascripts! (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 115</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 114</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_javascripts!</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_javascripts!</span> |
12 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span><span class="ruby-operator"><</span><span class="ruby-identifier">script</span> <span class="ruby-identifier">type</span>=<span class="ruby-value str">"text\/javascript"</span><span class="ruby-operator">></span>(.<span class="ruby-operator">+</span><span class="ruby-value">?)</span><span class="ruby-operator"><</span>\<span class="ruby-regexp re">/script>/</span><span class="ruby-identifier">m</span> | 12 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span><span class="ruby-operator"><</span><span class="ruby-identifier">script</span> <span class="ruby-identifier">type</span>=<span class="ruby-value str">"text\/javascript"</span><span class="ruby-operator">></span>(.<span class="ruby-operator">+</span><span class="ruby-value">?)</span><span class="ruby-operator"><</span>\<span class="ruby-regexp re">/script>/</span><span class="ruby-identifier">m</span> |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000006.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>strip_javascripts (String)</title> | 5 | <title>strip_javascripts (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 128</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 127</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_javascripts</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_javascripts</span> |
12 | <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">strip_javascripts!</span> | 12 | <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">strip_javascripts!</span> |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000007.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>strip_stylesheets! (String)</title> | 5 | <title>strip_stylesheets! (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 132</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 131</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_stylesheets!</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_stylesheets!</span> |
12 | <span class="ruby-comment cmt"># TODO: rewamp. dunno what is it.</span> | 12 | <span class="ruby-comment cmt"># TODO: rewamp. dunno what is it.</span> |
13 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span><span class="ruby-operator"><</span><span class="ruby-identifier">style</span> <span class="ruby-identifier">type</span>=<span class="ruby-value str">"text\/css"</span><span class="ruby-operator">></span>(.<span class="ruby-operator">+</span><span class="ruby-value">?)</span><span class="ruby-operator"><</span>\<span class="ruby-regexp re">/style>/</span><span class="ruby-identifier">m</span> | 13 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span><span class="ruby-operator"><</span><span class="ruby-identifier">style</span> <span class="ruby-identifier">type</span>=<span class="ruby-value str">"text\/css"</span><span class="ruby-operator">></span>(.<span class="ruby-operator">+</span><span class="ruby-value">?)</span><span class="ruby-operator"><</span>\<span class="ruby-regexp re">/style>/</span><span class="ruby-identifier">m</span> |
14 | <span class="ruby-keyword kw">end</span></pre> | 14 | <span class="ruby-keyword kw">end</span></pre> |
15 | </body> | 15 | </body> |
16 | </html> | 16 | </html> |
17 | 17 |
doc/classes/String.src/M000008.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>strip_stylesheets (String)</title> | 5 | <title>strip_stylesheets (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 137</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 136</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_stylesheets</span> | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_stylesheets</span> |
12 | <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">strip_stylesheets!</span> | 12 | <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">strip_stylesheets!</span> |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/classes/String.src/M000009.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>extract_xmltags_values (String)</title> | 5 | <title>strip_punctuation! (String)</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | </head> | 8 | </head> |
9 | <body class="standalone-code"> | 9 | <body class="standalone-code"> |
10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 145</span> | 10 | <pre><span class="ruby-comment cmt"># File lib/rir/string.rb, line 145</span> |
11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract_xmltags_values</span>(<span class="ruby-identifier">tag_name</span>) | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strip_punctuation!</span> |
12 | <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-node">/<#{tag_name}.*?>(.+?)<\/#{tag_name}>/</span>).<span class="ruby-identifier">flatten</span> | 12 | <span class="ruby-identifier">replace</span> <span class="ruby-identifier">strip_with_pattern</span> <span class="ruby-operator">/</span>[<span class="ruby-operator">^</span><span class="ruby-identifier">a</span><span class="ruby-operator">-</span><span class="ruby-identifier">zA</span><span class="ruby-operator">-</span><span class="ruby-constant">Z0</span><span class="ruby-operator">-</span><span class="ruby-value">9</span>\<span class="ruby-operator">-</span>\<span class="ruby-identifier">s</span>]<span class="ruby-operator">/</span> |
13 | <span class="ruby-keyword kw">end</span></pre> | 13 | <span class="ruby-keyword kw">end</span></pre> |
14 | </body> | 14 | </body> |
15 | </html> | 15 | </html> |
16 | 16 |
doc/created.rid
1 | Fri, 05 Nov 2010 15:06:41 +0100 | 1 | Tue, 23 Nov 2010 18:20:46 +0100 |
2 | 2 |
doc/files/lib/rir/document_rb.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>File: document.rb [RDoc Documentation]</title> | 5 | <title>File: document.rb [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="fileHeader"> | 45 | <div id="fileHeader"> |
46 | <h1>document.rb</h1> | 46 | <h1>document.rb</h1> |
47 | <table class="header-table"> | 47 | <table class="header-table"> |
48 | <tr class="top-aligned-row"> | 48 | <tr class="top-aligned-row"> |
49 | <td><strong>Path:</strong></td> | 49 | <td><strong>Path:</strong></td> |
50 | <td>lib/rir/document.rb | 50 | <td>lib/rir/document.rb |
51 | 51 | ||
52 | </td> | 52 | </td> |
53 | </tr> | 53 | </tr> |
54 | <tr class="top-aligned-row"> | 54 | <tr class="top-aligned-row"> |
55 | <td><strong>Last Update:</strong></td> | 55 | <td><strong>Last Update:</strong></td> |
56 | <td>2010-11-05 15:06:24 +0100</td> | 56 | <td>2010-11-23 18:14:13 +0100</td> |
57 | </tr> | 57 | </tr> |
58 | </table> | 58 | </table> |
59 | </div> | 59 | </div> |
60 | <!-- banner header --> | 60 | <!-- banner header --> |
61 | 61 | ||
62 | <div id="bodyContent"> | 62 | <div id="bodyContent"> |
63 | 63 | ||
64 | <div id="contextContent"> | 64 | <div id="contextContent"> |
65 | 65 | ||
66 | <div id="description"> | 66 | <div id="description"> |
67 | <p> | 67 | <p> |
68 | This file is a part of an Information Retrieval oriented Ruby library | 68 | This file is a part of an Information Retrieval oriented Ruby library |
69 | </p> | 69 | </p> |
70 | <p> | 70 | <p> |
71 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | 71 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> |
72 | </p> | 72 | </p> |
73 | <p> | 73 | <p> |
74 | This program is free software: you can redistribute it and/or modify it | 74 | This program is free software: you can redistribute it and/or modify it |
75 | under the terms of the GNU General Public License as published by the Free | 75 | under the terms of the GNU General Public License as published by the Free |
76 | Software Foundation, either version 3 of the License, or (at your option) | 76 | Software Foundation, either version 3 of the License, or (at your option) |
77 | any later version. | 77 | any later version. |
78 | </p> | 78 | </p> |
79 | <p> | 79 | <p> |
80 | This program is distributed in the hope that it will be useful, but WITHOUT | 80 | This program is distributed in the hope that it will be useful, but WITHOUT |
81 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 81 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
82 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 82 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
83 | more details. | 83 | more details. |
84 | </p> | 84 | </p> |
85 | <p> | 85 | <p> |
86 | You should have received a copy of the GNU General Public License along | 86 | You should have received a copy of the GNU General Public License along |
87 | with this program. If not, see <<a | 87 | with this program. If not, see <<a |
88 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. | 88 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. |
89 | </p> | 89 | </p> |
90 | 90 | ||
91 | </div> | 91 | </div> |
92 | 92 | ||
93 | <div id="requires-list"> | 93 | <div id="requires-list"> |
94 | <h3 class="section-bar">Required files</h3> | 94 | <h3 class="section-bar">Required files</h3> |
95 | 95 | ||
96 | <div class="name-list"> | 96 | <div class="name-list"> |
97 | 97 | ||
98 | net/http | 98 | net/http |
99 | |||
100 | rexml/document | ||
101 | |||
102 | net/http | ||
103 | |||
104 | kconv | ||
99 | 105 | ||
100 | </div> | 106 | </div> |
101 | </div> | 107 | </div> |
102 | 108 | ||
103 | </div> | 109 | </div> |
104 | 110 | ||
105 | 111 | ||
106 | </div> | 112 | </div> |
107 | 113 | ||
108 | <!-- if includes --> | 114 | <!-- if includes --> |
109 | 115 | ||
110 | <div id="section"> | 116 | <div id="section"> |
111 | 117 | ||
112 | 118 | ||
113 | 119 | ||
114 | 120 | ||
115 | <!-- if method_list --> | 121 | <!-- if method_list --> |
116 | 122 | ||
117 | 123 | ||
118 | 124 | ||
119 | 125 | ||
120 | </div> | 126 | </div> |
121 | 127 | ||
122 | <div id="validator-badges"> | 128 | <div id="validator-badges"> |
123 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 129 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
124 | </div> | 130 | </div> |
125 | 131 | ||
126 | </body> | 132 | </body> |
127 | </html> | 133 | </html> |
128 | 134 |
doc/files/lib/rir/string_rb.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>File: string.rb [RDoc Documentation]</title> | 5 | <title>File: string.rb [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="fileHeader"> | 45 | <div id="fileHeader"> |
46 | <h1>string.rb</h1> | 46 | <h1>string.rb</h1> |
47 | <table class="header-table"> | 47 | <table class="header-table"> |
48 | <tr class="top-aligned-row"> | 48 | <tr class="top-aligned-row"> |
49 | <td><strong>Path:</strong></td> | 49 | <td><strong>Path:</strong></td> |
50 | <td>lib/rir/string.rb | 50 | <td>lib/rir/string.rb |
51 | 51 | ||
52 | </td> | 52 | </td> |
53 | </tr> | 53 | </tr> |
54 | <tr class="top-aligned-row"> | 54 | <tr class="top-aligned-row"> |
55 | <td><strong>Last Update:</strong></td> | 55 | <td><strong>Last Update:</strong></td> |
56 | <td>2010-11-05 15:06:35 +0100</td> | 56 | <td>2010-11-23 18:20:41 +0100</td> |
57 | </tr> | 57 | </tr> |
58 | </table> | 58 | </table> |
59 | </div> | 59 | </div> |
60 | <!-- banner header --> | 60 | <!-- banner header --> |
61 | 61 | ||
62 | <div id="bodyContent"> | 62 | <div id="bodyContent"> |
63 | 63 | ||
64 | <div id="contextContent"> | 64 | <div id="contextContent"> |
65 | 65 | ||
66 | <div id="description"> | 66 | <div id="description"> |
67 | <p> | 67 | <p> |
68 | This file is a part of an Information Retrieval oriented Ruby library | 68 | This file is a part of an Information Retrieval oriented Ruby library |
69 | </p> | 69 | </p> |
70 | <p> | 70 | <p> |
71 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | 71 | Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> |
72 | </p> | 72 | </p> |
73 | <p> | 73 | <p> |
74 | This program is free software: you can redistribute it and/or modify it | 74 | This program is free software: you can redistribute it and/or modify it |
75 | under the terms of the GNU General Public License as published by the Free | 75 | under the terms of the GNU General Public License as published by the Free |
76 | Software Foundation, either version 3 of the License, or (at your option) | 76 | Software Foundation, either version 3 of the License, or (at your option) |
77 | any later version. | 77 | any later version. |
78 | </p> | 78 | </p> |
79 | <p> | 79 | <p> |
80 | This program is distributed in the hope that it will be useful, but WITHOUT | 80 | This program is distributed in the hope that it will be useful, but WITHOUT |
81 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 81 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
82 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 82 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
83 | more details. | 83 | more details. |
84 | </p> | 84 | </p> |
85 | <p> | 85 | <p> |
86 | You should have received a copy of the GNU General Public License along | 86 | You should have received a copy of the GNU General Public License along |
87 | with this program. If not, see <<a | 87 | with this program. If not, see <<a |
88 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. | 88 | href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>>. |
89 | </p> | 89 | </p> |
90 | 90 | ||
91 | </div> | 91 | </div> |
92 | 92 | ||
93 | <div id="requires-list"> | 93 | <div id="requires-list"> |
94 | <h3 class="section-bar">Required files</h3> | 94 | <h3 class="section-bar">Required files</h3> |
95 | 95 | ||
96 | <div class="name-list"> | 96 | <div class="name-list"> |
97 | 97 | ||
98 | cgi | 98 | cgi |
99 | 99 | ||
100 | kconv | 100 | kconv |
101 | 101 | ||
102 | </div> | 102 | </div> |
103 | </div> | 103 | </div> |
104 | 104 | ||
105 | </div> | 105 | </div> |
106 | 106 | ||
107 | 107 | ||
108 | </div> | 108 | </div> |
109 | 109 | ||
110 | <!-- if includes --> | 110 | <!-- if includes --> |
111 | 111 | ||
112 | <div id="section"> | 112 | <div id="section"> |
113 | 113 | ||
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | <!-- if method_list --> | 117 | <!-- if method_list --> |
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | 121 | ||
122 | </div> | 122 | </div> |
123 | 123 | ||
124 | <div id="validator-badges"> | 124 | <div id="validator-badges"> |
125 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 125 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
126 | </div> | 126 | </div> |
127 | 127 | ||
128 | </body> | 128 | </body> |
129 | </html> | 129 | </html> |
130 | 130 |
doc/files/lib/rir_rb.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <head> | 4 | <head> |
5 | <title>File: rir.rb [RDoc Documentation]</title> | 5 | <title>File: rir.rb [RDoc Documentation]</title> |
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> | 7 | <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | 8 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
9 | <script type="text/javascript"> | 9 | <script type="text/javascript"> |
10 | // <![CDATA[ | 10 | // <![CDATA[ |
11 | 11 | ||
12 | function popupCode( url ) { | 12 | function popupCode( url ) { |
13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | 13 | window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
14 | } | 14 | } |
15 | 15 | ||
16 | function toggleCode( id ) { | 16 | function toggleCode( id ) { |
17 | if ( document.getElementById ) | 17 | if ( document.getElementById ) |
18 | elem = document.getElementById( id ); | 18 | elem = document.getElementById( id ); |
19 | else if ( document.all ) | 19 | else if ( document.all ) |
20 | elem = eval( "document.all." + id ); | 20 | elem = eval( "document.all." + id ); |
21 | else | 21 | else |
22 | return false; | 22 | return false; |
23 | 23 | ||
24 | elemStyle = elem.style; | 24 | elemStyle = elem.style; |
25 | 25 | ||
26 | if ( elemStyle.display != "block" ) { | 26 | if ( elemStyle.display != "block" ) { |
27 | elemStyle.display = "block" | 27 | elemStyle.display = "block" |
28 | } else { | 28 | } else { |
29 | elemStyle.display = "none" | 29 | elemStyle.display = "none" |
30 | } | 30 | } |
31 | 31 | ||
32 | return true; | 32 | return true; |
33 | } | 33 | } |
34 | 34 | ||
35 | // Make codeblocks hidden by default | 35 | // Make codeblocks hidden by default |
36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | 36 | document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) |
37 | 37 | ||
38 | // ]]> | 38 | // ]]> |
39 | </script> | 39 | </script> |
40 | 40 | ||
41 | </head> | 41 | </head> |
42 | <body> | 42 | <body> |
43 | 43 | ||
44 | 44 | ||
45 | <div id="fileHeader"> | 45 | <div id="fileHeader"> |
46 | <h1>rir.rb</h1> | 46 | <h1>rir.rb</h1> |
47 | <table class="header-table"> | 47 | <table class="header-table"> |
48 | <tr class="top-aligned-row"> | 48 | <tr class="top-aligned-row"> |
49 | <td><strong>Path:</strong></td> | 49 | <td><strong>Path:</strong></td> |
50 | <td>lib/rir.rb | 50 | <td>lib/rir.rb |
51 | 51 | ||
52 | </td> | 52 | </td> |
53 | </tr> | 53 | </tr> |
54 | <tr class="top-aligned-row"> | 54 | <tr class="top-aligned-row"> |
55 | <td><strong>Last Update:</strong></td> | 55 | <td><strong>Last Update:</strong></td> |
56 | <td>2010-11-05 14:39:35 +0100</td> | 56 | <td>2010-11-19 11:27:16 +0100</td> |
57 | </tr> | 57 | </tr> |
58 | </table> | 58 | </table> |
59 | </div> | 59 | </div> |
60 | <!-- banner header --> | 60 | <!-- banner header --> |
61 | 61 | ||
62 | <div id="bodyContent"> | 62 | <div id="bodyContent"> |
63 | 63 | ||
64 | <div id="contextContent"> | 64 | <div id="contextContent"> |
65 | 65 | ||
66 | <div id="requires-list"> | 66 | <div id="requires-list"> |
67 | <h3 class="section-bar">Required files</h3> | 67 | <h3 class="section-bar">Required files</h3> |
68 | 68 | ||
69 | <div class="name-list"> | 69 | <div class="name-list"> |
70 | 70 | ||
71 | rir/document | 71 | rir/document |
72 | 72 | ||
73 | rir/string | 73 | rir/string |
74 | |||
75 | rir/query | ||
76 | |||
77 | rir/corpus | ||
78 | |||
79 | rir/regexp | ||
74 | 80 | ||
75 | </div> | 81 | </div> |
76 | </div> | 82 | </div> |
77 | 83 | ||
78 | </div> | 84 | </div> |
79 | 85 | ||
80 | 86 | ||
81 | </div> | 87 | </div> |
82 | 88 | ||
83 | <!-- if includes --> | 89 | <!-- if includes --> |
84 | 90 | ||
85 | <div id="section"> | 91 | <div id="section"> |
86 | 92 | ||
87 | 93 | ||
88 | 94 | ||
89 | 95 | ||
90 | <!-- if method_list --> | 96 | <!-- if method_list --> |
91 | 97 | ||
92 | 98 | ||
93 | 99 | ||
94 | 100 | ||
95 | </div> | 101 | </div> |
96 | 102 | ||
97 | <div id="validator-badges"> | 103 | <div id="validator-badges"> |
98 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | 104 | <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
99 | </div> | 105 | </div> |
100 | 106 | ||
101 | </body> | 107 | </body> |
102 | </html> | 108 | </html> |
103 | 109 |
doc/fr_class_index.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <!-- | 4 | <!-- |
5 | 5 | ||
6 | Classes [RDoc Documentation] | 6 | Classes [RDoc Documentation] |
7 | 7 | ||
8 | --> | 8 | --> |
9 | <head> | 9 | <head> |
10 | <title>Classes [RDoc Documentation]</title> | 10 | <title>Classes [RDoc Documentation]</title> |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
12 | <link rel="stylesheet" href="rdoc-style.css" type="text/css" /> | 12 | <link rel="stylesheet" href="rdoc-style.css" type="text/css" /> |
13 | <base target="docwin" /> | 13 | <base target="docwin" /> |
14 | </head> | 14 | </head> |
15 | <body> | 15 | <body> |
16 | <div class="index"> | 16 | <div class="index"> |
17 | <h1 class="section-bar">Classes</h1> | 17 | <h1 class="section-bar">Classes</h1> |
18 | <div id="index-entries"> | 18 | <div id="index-entries"> |
19 | 19 | ||
20 | <a href="classes/RIR.html">RIR</a><br /> | 20 | <a href="classes/RIR.html">RIR</a><br /> |
21 | 21 | ||
22 | <a href="classes/RIR/Document.html">RIR::Document</a><br /> | 22 | <a href="classes/RIR/Corpus.html">RIR::Corpus</a><br /> |
23 | 23 | ||
24 | <a href="classes/RIR/WebDocument.html">RIR::WebDocument</a><br /> | 24 | <a href="classes/RIR/Indri.html">RIR::Indri</a><br /> |
25 | 25 | ||
26 | <a href="classes/RIR/WikipediaPage.html">RIR::WikipediaPage</a><br /> | 26 | <a href="classes/RIR/Indri/IndriQuery.html">RIR::Indri::IndriQuery</a><br /> |
27 | |||
28 | <a href="classes/RIR/Indri/Parameters.html">RIR::Indri::Parameters</a><br /> | ||
29 | |||
30 | <a href="classes/RIR/Query.html">RIR::Query</a><br /> | ||
27 | 31 | ||
28 | <a href="classes/String.html">String</a><br /> | 32 | <a href="classes/String.html">String</a><br /> |
29 | 33 | ||
30 | </div> | 34 | </div> |
31 | </div> | 35 | </div> |
32 | </body> | 36 | </body> |
33 | </html> | 37 | </html> |
34 | 38 |
doc/fr_file_index.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <!-- | 4 | <!-- |
5 | 5 | ||
6 | Files [RDoc Documentation] | 6 | Files [RDoc Documentation] |
7 | 7 | ||
8 | --> | 8 | --> |
9 | <head> | 9 | <head> |
10 | <title>Files [RDoc Documentation]</title> | 10 | <title>Files [RDoc Documentation]</title> |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
12 | <link rel="stylesheet" href="rdoc-style.css" type="text/css" /> | 12 | <link rel="stylesheet" href="rdoc-style.css" type="text/css" /> |
13 | <base target="docwin" /> | 13 | <base target="docwin" /> |
14 | </head> | 14 | </head> |
15 | <body> | 15 | <body> |
16 | <div class="index"> | 16 | <div class="index"> |
17 | <h1 class="section-bar">Files</h1> | 17 | <h1 class="section-bar">Files</h1> |
18 | <div id="index-entries"> | 18 | <div id="index-entries"> |
19 | 19 | ||
20 | <a href="files/lib/rir/document_rb.html">lib/rir/document.rb</a><br /> | 20 | <a href="files/lib/rir/corpus_rb.html">lib/rir/corpus.rb</a><br /> |
21 | 21 | ||
22 | <a href="files/lib/rir/string_rb.html">lib/rir/string.rb</a><br /> | 22 | <a href="files/lib/rir/query_rb.html">lib/rir/query.rb</a><br /> |
23 | 23 | ||
24 | <a href="files/main_rb.html">main.rb</a><br /> | 24 | <a href="files/lib/rir/string_rb.html">lib/rir/string.rb</a><br /> |
25 | 25 | ||
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | </body> | 28 | </body> |
29 | </html> | 29 | </html> |
30 | 30 |
doc/fr_method_index.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <!-- | 4 | <!-- |
5 | 5 | ||
6 | Methods [RDoc Documentation] | 6 | Methods [RDoc Documentation] |
7 | 7 | ||
8 | --> | 8 | --> |
9 | <head> | 9 | <head> |
10 | <title>Methods [RDoc Documentation]</title> | 10 | <title>Methods [RDoc Documentation]</title> |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
12 | <link rel="stylesheet" href="rdoc-style.css" type="text/css" /> | 12 | <link rel="stylesheet" href="rdoc-style.css" type="text/css" /> |
13 | <base target="docwin" /> | 13 | <base target="docwin" /> |
14 | </head> | 14 | </head> |
15 | <body> | 15 | <body> |
16 | <div class="index"> | 16 | <div class="index"> |
17 | <h1 class="section-bar">Methods</h1> | 17 | <h1 class="section-bar">Methods</h1> |
18 | <div id="index-entries"> | 18 | <div id="index-entries"> |
19 | 19 | ||
20 | <a href="classes/RIR/Document.html#M000012">count_words (RIR::Document)</a><br /> | 20 | <a href="classes/String.html#M000011">extract_xmltags_values (String)</a><br /> |
21 | 21 | ||
22 | <a href="classes/RIR/Document.html#M000013">entropy (RIR::Document)</a><br /> | 22 | <a href="classes/RIR/Corpus.html#M000017">files (RIR::Corpus)</a><br /> |
23 | 23 | ||
24 | <a href="classes/String.html#M000009">extract_xmltags_values (String)</a><br /> | ||
25 | |||
26 | <a href="classes/RIR/Document.html#M000010">format_words (RIR::Document)</a><br /> | ||
27 | |||
28 | <a href="classes/RIR/WebDocument.html#M000015">get_content (RIR::WebDocument)</a><br /> | ||
29 | |||
30 | <a href="classes/String.html#M000001">is_stopword? (String)</a><br /> | 24 | <a href="classes/String.html#M000001">is_stopword? (String)</a><br /> |
31 | 25 | ||
32 | <a href="classes/RIR/WebDocument.html#M000016">new (RIR::WebDocument)</a><br /> | 26 | <a href="classes/RIR/Corpus.html#M000016">new (RIR::Corpus)</a><br /> |
33 | 27 | ||
34 | <a href="classes/RIR/Document.html#M000014">new (RIR::Document)</a><br /> | 28 | <a href="classes/RIR/Indri/Parameters.html#M000012">new (RIR::Indri::Parameters)</a><br /> |
35 | 29 | ||
36 | <a href="classes/RIR/Document.html#M000011">ngrams (RIR::Document)</a><br /> | 30 | <a href="classes/RIR/Indri/IndriQuery.html#M000014">new (RIR::Indri::IndriQuery)</a><br /> |
37 | 31 | ||
38 | <a href="classes/String.html#M000002">remove_special_characters (String)</a><br /> | 32 | <a href="classes/String.html#M000002">remove_special_characters (String)</a><br /> |
39 | 33 | ||
40 | <a href="classes/String.html#M000006">strip_javascripts (String)</a><br /> | 34 | <a href="classes/String.html#M000006">strip_javascripts (String)</a><br /> |
41 | 35 | ||
42 | <a href="classes/String.html#M000005">strip_javascripts! (String)</a><br /> | 36 | <a href="classes/String.html#M000005">strip_javascripts! (String)</a><br /> |
43 | 37 | ||
38 | <a href="classes/String.html#M000010">strip_punctuation (String)</a><br /> | ||
39 | |||
40 | <a href="classes/String.html#M000009">strip_punctuation! (String)</a><br /> | ||
41 | |||
44 | <a href="classes/String.html#M000008">strip_stylesheets (String)</a><br /> | 42 | <a href="classes/String.html#M000008">strip_stylesheets (String)</a><br /> |
45 | 43 | ||
46 | <a href="classes/String.html#M000007">strip_stylesheets! (String)</a><br /> | 44 | <a href="classes/String.html#M000007">strip_stylesheets! (String)</a><br /> |
47 | 45 | ||
48 | <a href="classes/String.html#M000004">strip_xml_tags (String)</a><br /> | 46 | <a href="classes/String.html#M000004">strip_xml_tags (String)</a><br /> |
49 | 47 | ||
50 | <a href="classes/String.html#M000003">strip_xml_tags! (String)</a><br /> | 48 | <a href="classes/String.html#M000003">strip_xml_tags! (String)</a><br /> |
49 | |||
50 | <a href="classes/RIR/Indri/Parameters.html#M000013">to_s (RIR::Indri::Parameters)</a><br /> | ||
51 | |||
52 | <a href="classes/RIR/Indri/IndriQuery.html#M000015">to_s (RIR::Indri::IndriQuery)</a><br /> |
doc/index.html
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> | 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | <!-- | 4 | <!-- |
5 | 5 | ||
6 | RDoc Documentation | 6 | RDoc Documentation |
7 | 7 | ||
8 | --> | 8 | --> |
9 | <head> | 9 | <head> |
10 | <title>RDoc Documentation</title> | 10 | <title>RDoc Documentation</title> |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
12 | </head> | 12 | </head> |
13 | <frameset rows="20%, 80%"> | 13 | <frameset rows="20%, 80%"> |
14 | <frameset cols="25%,35%,45%"> | 14 | <frameset cols="25%,35%,45%"> |
15 | <frame src="fr_file_index.html" title="Files" name="Files" /> | 15 | <frame src="fr_file_index.html" title="Files" name="Files" /> |
16 | <frame src="fr_class_index.html" name="Classes" /> | 16 | <frame src="fr_class_index.html" name="Classes" /> |
17 | <frame src="fr_method_index.html" name="Methods" /> | 17 | <frame src="fr_method_index.html" name="Methods" /> |
18 | </frameset> | 18 | </frameset> |
19 | <frame src="files/lib/rir/string_rb.html" name="docwin" /> | 19 | <frame src="files/lib/rir/corpus_rb.html" name="docwin" /> |
20 | </frameset> | 20 | </frameset> |
21 | </html> | 21 | </html> |
22 | 22 |
lib/rir/corpus.rb
1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
2 | 2 | ||
3 | # This file is a part of an Information Retrieval oriented Ruby library | 3 | # This file is a part of an Information Retrieval oriented Ruby library |
4 | # | 4 | # |
5 | # Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | 5 | # Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> |
6 | # | 6 | # |
7 | # This program is free software: you can redistribute it and/or modify | 7 | # This program is free software: you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by | 8 | # it under the terms of the GNU General Public License as published by |
9 | # the Free Software Foundation, either version 3 of the License, or | 9 | # the Free Software Foundation, either version 3 of the License, or |
10 | # (at your option) any later version. | 10 | # (at your option) any later version. |
11 | # | 11 | # |
12 | # This program is distributed in the hope that it will be useful, | 12 | # This program is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | # GNU General Public License for more details. | 15 | # GNU General Public License for more details. |
16 | # | 16 | # |
17 | # You should have received a copy of the GNU General Public License | 17 | # You should have received a copy of the GNU General Public License |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | # General module for many purposes related to Information Retrieval. | ||
21 | module RIR | 20 | module RIR |
22 | 21 | ||
23 | class Corpus | 22 | class Corpus |
24 | attr_accessor :path | 23 | attr_accessor :path |
25 | 24 | ||
26 | def initialize(path) | 25 | def initialize(path) |
27 | @path = path.chomp "/" | 26 | @path = path.chomp "/" |
28 | end | 27 | end |
29 | 28 | ||
30 | # Recursively outputs all files in +self.path+. | 29 | # Recursively outputs all files in +self.path+. |
31 | # WARNING ! This function may take a lot of time if many | 30 | # WARNING ! This function may take a lot of time if many |
32 | # files are in subdirectories. | 31 | # files are in subdirectories. |
33 | # | 32 | # |
34 | # c = Corpus.new "my/path" | 33 | # c = Corpus.new "my/path" |
35 | # c.files # => ["README.txt", "lib/code.rb"] | 34 | # c.files # => ["README.txt", "lib/code.rb"] |
36 | def files | 35 | def files |
37 | Dir["#{@path}/**/*.*"] | 36 | Dir["#{@path}/**/*.*"] |
38 | end | 37 | end |
39 | end | 38 | end |
40 | 39 | ||
41 | end | 40 | end |
42 | 41 |
lib/rir/query.rb
1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
2 | 2 | ||
3 | # This file is a part of an Information Retrieval oriented Ruby library | 3 | # This file is a part of an Information Retrieval oriented Ruby library |
4 | # | 4 | # |
5 | # Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | 5 | # Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> |
6 | # | 6 | # |
7 | # This program is free software: you can redistribute it and/or modify | 7 | # This program is free software: you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by | 8 | # it under the terms of the GNU General Public License as published by |
9 | # the Free Software Foundation, either version 3 of the License, or | 9 | # the Free Software Foundation, either version 3 of the License, or |
10 | # (at your option) any later version. | 10 | # (at your option) any later version. |
11 | # | 11 | # |
12 | # This program is distributed in the hope that it will be useful, | 12 | # This program is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | # GNU General Public License for more details. | 15 | # GNU General Public License for more details. |
16 | # | 16 | # |
17 | # You should have received a copy of the GNU General Public License | 17 | # You should have received a copy of the GNU General Public License |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | # General module for many purposes related to Information Retrieval. | ||
21 | module RIR | 20 | module RIR |
22 | 21 | ||
23 | class Query | 22 | class Query |
24 | end | 23 | end |
25 | 24 | ||
26 | module Indri | 25 | module Indri |
27 | 26 | ||
28 | class Parameters | 27 | class Parameters |
29 | attr_accessor :corpus, :memory, :count, :offset, :run_id, :print_query, :print_docs, :rule, :baseline | 28 | attr_accessor :corpus, :memory, :count, :offset, :run_id, :print_query, :print_docs, :rule, :baseline |
30 | 29 | ||
31 | def initialize(corpus,mem="1g",count="1000",offset="1",run_id="default",print_query=false,print_docs=false) | 30 | def initialize(corpus,mem="1g",count="1000",offset="1",run_id="default",print_query=false,print_docs=false) |
32 | @corpus = corpus | 31 | @corpus = corpus |
33 | @memory = mem | 32 | @memory = mem |
34 | @count = count | 33 | @count = count |
35 | @offset = offset | 34 | @offset = offset |
36 | @run_id = run_id | 35 | @run_id = run_id |
37 | @print_query = print_query ? "true" : "false" | 36 | @print_query = print_query ? "true" : "false" |
38 | @print_docs = print_docs ? "true" : "false" | 37 | @print_docs = print_docs ? "true" : "false" |
39 | end | 38 | end |
40 | 39 | ||
41 | def to_s | 40 | def to_s |
42 | h = "<parameters>\n" | 41 | h = "<parameters>\n" |
43 | h += "<memory>#{@memory}</memory>\n" | 42 | h += "<memory>#{@memory}</memory>\n" |
44 | h += "<index>#{@corpus}</index>\n" | 43 | h += "<index>#{@corpus}</index>\n" |
45 | h += "<count>#{@count}</count>\n" | 44 | h += "<count>#{@count}</count>\n" |
46 | unless @baseline.nil? | 45 | unless @baseline.nil? |
47 | h += "<baseline>#{@baseline}</baseline>\n" | 46 | h += "<baseline>#{@baseline}</baseline>\n" |
48 | else | 47 | else |
49 | h += "<rule>#{@rule}</rule>\n" | 48 | h += "<rule>#{@rule}</rule>\n" |
50 | end | 49 | end |
51 | h += "<queryOffset>#{@offset}</queryOffset>\n" | 50 | h += "<queryOffset>#{@offset}</queryOffset>\n" |
52 | h += "<runID>#{@run_id}</runID>\n" | 51 | h += "<runID>#{@run_id}</runID>\n" |
53 | h += "<printQuery>#{@print_query}</printQuery>\n" | 52 | h += "<printQuery>#{@print_query}</printQuery>\n" |
54 | h += "<printDocuments>#{@print_docs}</printDocuments>\n" | 53 | h += "<printDocuments>#{@print_docs}</printDocuments>\n" |
55 | 54 | ||
56 | h | 55 | h |
57 | end | 56 | end |
58 | end | 57 | end |
59 | 58 | ||
60 | class IndriQuery < Query | 59 | class IndriQuery < Query |
61 | attr_accessor :id, :query, :params, :rule | 60 | attr_accessor :id, :query, :params, :rule |
62 | 61 | ||
63 | def initialize(id,query,params) | 62 | def initialize(id,query,params) |
64 | @params = params | 63 | @params = params |
65 | # Here we set the default retrieval model as Language Modeling | 64 | # Here we set the default retrieval model as Language Modeling |
66 | # with a Dirichlet smoothing at 2500. | 65 | # with a Dirichlet smoothing at 2500. |
67 | # TODO: maybe a Rule class... | 66 | # TODO: maybe a Rule class... |
68 | @params.rule = 'method:dirichlet,mu:2500' if @params.rule.nil? | 67 | @params.rule = 'method:dirichlet,mu:2500' if @params.rule.nil? |
69 | 68 | ||
70 | @id = id | 69 | @id = id |
71 | @query = query | 70 | @query = query |
72 | end | 71 | end |
73 | 72 | ||
74 | def to_s | 73 | def to_s |
75 | h = @params.to_s | 74 | h = @params.to_s |
76 | h += "<query>\n" | 75 | h += "<query>\n" |
77 | h += "<number>#{@id}</number>\n" | 76 | h += "<number>#{@id}</number>\n" |
78 | h += "<text>#{@query}</text>\n" | 77 | h += "<text>#{@query}</text>\n" |
79 | h += "</query>\n" | 78 | h += "</query>\n" |
80 | h += "</parameters>" | 79 | h += "</parameters>" |
81 | 80 | ||
82 | h | 81 | h |
83 | end | 82 | end |
84 | end | 83 | end |
85 | 84 | ||
86 | end | 85 | end |
87 | end | 86 | end |
88 | 87 |
lib/rir/string.rb
1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
2 | 2 | ||
3 | # This file is a part of an Information Retrieval oriented Ruby library | 3 | # This file is a part of an Information Retrieval oriented Ruby library |
4 | # | 4 | # |
5 | # Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> | 5 | # Copyright (C) 2010-2011 Romain Deveaud <romain.deveaud@gmail.com> |
6 | # | 6 | # |
7 | # This program is free software: you can redistribute it and/or modify | 7 | # This program is free software: you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by | 8 | # it under the terms of the GNU General Public License as published by |
9 | # the Free Software Foundation, either version 3 of the License, or | 9 | # the Free Software Foundation, either version 3 of the License, or |
10 | # (at your option) any later version. | 10 | # (at your option) any later version. |
11 | # | 11 | # |
12 | # This program is distributed in the hope that it will be useful, | 12 | # This program is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | # GNU General Public License for more details. | 15 | # GNU General Public License for more details. |
16 | # | 16 | # |
17 | # You should have received a copy of the GNU General Public License | 17 | # You should have received a copy of the GNU General Public License |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | ||
20 | # General module for many purposes related to Information Retrieval. | ||
21 | module RIR | 20 | module RIR |
22 | 21 | ||
23 | # These are the default stopwords provided by Lemur. | 22 | # These are the default stopwords provided by Lemur. |
24 | Stoplist = [ | 23 | Stoplist = [ |
25 | "a", "anything", "anyway", "anywhere", "apart", "are", "around", "as", "at", "av", | 24 | "a", "anything", "anyway", "anywhere", "apart", "are", "around", "as", "at", "av", |
26 | "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", | 25 | "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", |
27 | "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", | 26 | "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", |
28 | "can", "cannot", "canst", "certain", "cf", "choose", "contrariwise", "cos", "could", "cu", | 27 | "can", "cannot", "canst", "certain", "cf", "choose", "contrariwise", "cos", "could", "cu", |
29 | "day", "do", "does", "doesn't", "doing", "dost", "doth", "double", "down", "dual", "during", | 28 | "day", "do", "does", "doesn't", "doing", "dost", "doth", "double", "down", "dual", "during", |
30 | "each", "either", "else", "elsewhere", "enough", "et", "etc", "even", "ever", "every", | 29 | "each", "either", "else", "elsewhere", "enough", "et", "etc", "even", "ever", "every", |
31 | "everybody", "everyone", "everything", "everywhere", "except", "excepted", "excepting", | 30 | "everybody", "everyone", "everything", "everywhere", "except", "excepted", "excepting", |
32 | "exception", "exclude", "excluding", "exclusive", "far", "farther", "farthest", "few", "ff", | 31 | "exception", "exclude", "excluding", "exclusive", "far", "farther", "farthest", "few", "ff", |
33 | "first", "for", "formerly", "forth", "forward", "from", "front", "further", "furthermore", | 32 | "first", "for", "formerly", "forth", "forward", "from", "front", "further", "furthermore", |
34 | "furthest", "get", "go", "had", "halves", "hardly", "has", "hast", "hath", "have", "he", | 33 | "furthest", "get", "go", "had", "halves", "hardly", "has", "hast", "hath", "have", "he", |
35 | "hence", "henceforth", "her", "here", "hereabouts", "hereafter", "hereby", "herein", "hereto", | 34 | "hence", "henceforth", "her", "here", "hereabouts", "hereafter", "hereby", "herein", "hereto", |
36 | "hereupon", "hers", "herself", "him", "himself", "hindmost", "his", "hither", "hitherto", | 35 | "hereupon", "hers", "herself", "him", "himself", "hindmost", "his", "hither", "hitherto", |
37 | "how", "however", "howsoever", "i", "ie", "if", "in", "inasmuch", "inc", "include", | 36 | "how", "however", "howsoever", "i", "ie", "if", "in", "inasmuch", "inc", "include", |
38 | "included", "including", "indeed", "indoors", "inside", "insomuch", "instead", "into", | 37 | "included", "including", "indeed", "indoors", "inside", "insomuch", "instead", "into", |
39 | "inward", "inwards", "is", "it", "its", "itself", "just", "kind", "kg", "km", "last", | 38 | "inward", "inwards", "is", "it", "its", "itself", "just", "kind", "kg", "km", "last", |
40 | "latter", "latterly", "less", "lest", "let", "like", "little", "ltd", "many", "may", "maybe", | 39 | "latter", "latterly", "less", "lest", "let", "like", "little", "ltd", "many", "may", "maybe", |
41 | "me", "meantime", "meanwhile", "might", "moreover", "most", "mostly", "more", "mr", "mrs", | 40 | "me", "meantime", "meanwhile", "might", "moreover", "most", "mostly", "more", "mr", "mrs", |
42 | "ms", "much", "must", "my", "myself", "namely", "need", "neither", "never", "nevertheless", | 41 | "ms", "much", "must", "my", "myself", "namely", "need", "neither", "never", "nevertheless", |
43 | "next", "no", "nobody", "none", "nonetheless", "noone", "nope", "nor", "not", "nothing", | 42 | "next", "no", "nobody", "none", "nonetheless", "noone", "nope", "nor", "not", "nothing", |
44 | "notwithstanding", "now", "nowadays", "nowhere", "of", "off", "often", "ok", "on", "once", | 43 | "notwithstanding", "now", "nowadays", "nowhere", "of", "off", "often", "ok", "on", "once", |
45 | "one", "only", "onto", "or", "other", "others", "otherwise", "ought", "our", "ours", | 44 | "one", "only", "onto", "or", "other", "others", "otherwise", "ought", "our", "ours", |
46 | "ourselves", "out", "outside", "over", "own", "per", "perhaps", "plenty", "provide", "quite", | 45 | "ourselves", "out", "outside", "over", "own", "per", "perhaps", "plenty", "provide", "quite", |
47 | "rather", "really", "round", "said", "sake", "same", "sang", "save", "saw", "see", "seeing", | 46 | "rather", "really", "round", "said", "sake", "same", "sang", "save", "saw", "see", "seeing", |
48 | "seem", "seemed", "seeming", "seems", "seen", "seldom", "selves", "sent", "several", "shalt", | 47 | "seem", "seemed", "seeming", "seems", "seen", "seldom", "selves", "sent", "several", "shalt", |
49 | "she", "should", "shown", "sideways", "since", "slept", "slew", "slung", "slunk", "smote", | 48 | "she", "should", "shown", "sideways", "since", "slept", "slew", "slung", "slunk", "smote", |
50 | "so", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", | 49 | "so", "some", "somebody", "somehow", "someone", "something", "sometime", "sometimes", |
51 | "somewhat", "somewhere", "spake", "spat", "spoke", "spoken", "sprang", "sprung", "stave", | 50 | "somewhat", "somewhere", "spake", "spat", "spoke", "spoken", "sprang", "sprung", "stave", |
52 | "staves", "still", "such", "supposing", "than", "that", "the", "thee", "their", "them", | 51 | "staves", "still", "such", "supposing", "than", "that", "the", "thee", "their", "them", |
53 | "themselves", "then", "thence", "thenceforth", "there", "thereabout", "thereabouts", | 52 | "themselves", "then", "thence", "thenceforth", "there", "thereabout", "thereabouts", |
54 | "thereafter", "thereby", "therefore", "therein", "thereof", "thereon", "thereto", "thereupon", | 53 | "thereafter", "thereby", "therefore", "therein", "thereof", "thereon", "thereto", "thereupon", |
55 | "these", "they", "this", "those", "thou", "though", "thrice", "through", "throughout", "thru", | 54 | "these", "they", "this", "those", "thou", "though", "thrice", "through", "throughout", "thru", |
56 | "thus", "thy", "thyself", "till", "to", "together", "too", "toward", "towards", "ugh", | 55 | "thus", "thy", "thyself", "till", "to", "together", "too", "toward", "towards", "ugh", |
57 | "unable", "under", "underneath", "unless", "unlike", "until", "up", "upon", "upward", | 56 | "unable", "under", "underneath", "unless", "unlike", "until", "up", "upon", "upward", |
58 | "upwards", "us", "use", "used", "using", "very", "via", "vs", "want", "was", "we", "week", | 57 | "upwards", "us", "use", "used", "using", "very", "via", "vs", "want", "was", "we", "week", |
59 | "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", | 58 | "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", |
60 | "where", "whereabouts", "whereafter", "whereas", "whereat", "whereby", "wherefore", | 59 | "where", "whereabouts", "whereafter", "whereas", "whereat", "whereby", "wherefore", |
61 | "wherefrom", "wherein", "whereinto", "whereof", "whereon", "wheresoever", "whereto", | 60 | "wherefrom", "wherein", "whereinto", "whereof", "whereon", "wheresoever", "whereto", |
62 | "whereunto", "whereupon", "wherever", "wherewith", "whether", "whew", "which", "whichever", | 61 | "whereunto", "whereupon", "wherever", "wherewith", "whether", "whew", "which", "whichever", |
63 | "whichsoever", "while", "whilst", "whither", "who", "whoa", "whoever", "whole", "whom", | 62 | "whichsoever", "while", "whilst", "whither", "who", "whoa", "whoever", "whole", "whom", |
64 | "whomever", "whomsoever", "whose", "whosoever", "why", "will", "wilt", "with", "within", | 63 | "whomever", "whomsoever", "whose", "whosoever", "why", "will", "wilt", "with", "within", |
65 | "without", "worse", "worst", "would", "wow", "ye", "yet", "year", "yippee", "you", "your", | 64 | "without", "worse", "worst", "would", "wow", "ye", "yet", "year", "yippee", "you", "your", |
66 | "yours", "yourself", "yourselves" | 65 | "yours", "yourself", "yourselves" |
67 | ] | 66 | ] |
68 | 67 | ||
69 | 68 | ||
70 | end | 69 | end |
71 | 70 | ||
72 | # Extention of the standard class String with useful function. | 71 | # Extention of the standard class String with useful function. |
73 | class String | 72 | class String |
74 | include RIR | 73 | include RIR |
75 | 74 | ||
76 | # Returns +true+ if +self+ belongs to Rir::Stoplist, +false+ otherwise. | 75 | # Returns +true+ if +self+ belongs to Rir::Stoplist, +false+ otherwise. |
77 | def is_stopword? | 76 | def is_stopword? |
78 | Stoplist.include?(self.downcase) | 77 | Stoplist.include?(self.downcase) |
79 | end | 78 | end |
80 | 79 | ||
81 | # Do not use. | 80 | # Do not use. |
82 | # TODO: rewamp. find why this function is here. | 81 | # TODO: rewamp. find why this function is here. |
83 | def remove_special_characters | 82 | def remove_special_characters |
84 | self.split.collect { |w| w.gsub(/\W/,' ').split.collect { |w| w.gsub(/\W/,' ').strip.sub(/\A.\z/, '')}.join(' ').strip.sub(/\A.\z/, '')}.join(' ') | 83 | self.split.collect { |w| w.gsub(/\W/,' ').split.collect { |w| w.gsub(/\W/,' ').strip.sub(/\A.\z/, '')}.join(' ').strip.sub(/\A.\z/, '')}.join(' ') |
85 | end | 84 | end |
86 | 85 | ||
87 | # Removes all XML-like tags from +self+. | 86 | # Removes all XML-like tags from +self+. |
88 | # | 87 | # |
89 | # s = "<html><body>test</body></html>" | 88 | # s = "<html><body>test</body></html>" |
90 | # s.strip_xml_tags! | 89 | # s.strip_xml_tags! |
91 | # s #=> "test" | 90 | # s #=> "test" |
92 | def strip_xml_tags! | 91 | def strip_xml_tags! |
93 | replace strip_with_pattern /<\/?[^>]*>/ | 92 | replace strip_with_pattern /<\/?[^>]*>/ |
94 | end | 93 | end |
95 | 94 | ||
96 | # Removes all XML-like tags from +self+. | 95 | # Removes all XML-like tags from +self+. |
97 | # | 96 | # |
98 | # s = "<html><body>test</body></html>" | 97 | # s = "<html><body>test</body></html>" |
99 | # s.strip_xml_tags #=> "test" | 98 | # s.strip_xml_tags #=> "test" |
100 | # s #=> "<html><body>test</body></html>" | 99 | # s #=> "<html><body>test</body></html>" |
101 | def strip_xml_tags | 100 | def strip_xml_tags |
102 | dup.strip_xml_tags! | 101 | dup.strip_xml_tags! |
103 | end | 102 | end |
104 | 103 | ||
105 | # Removes all Javascript sources from +self+. | 104 | # Removes all Javascript sources from +self+. |
106 | # | 105 | # |
107 | # s = "<script type='text/javascript'> | 106 | # s = "<script type='text/javascript'> |
108 | # var skin='vector', | 107 | # var skin='vector', |
109 | # stylepath='http://bits.wikimedia.org/skins-1.5' | 108 | # stylepath='http://bits.wikimedia.org/skins-1.5' |
110 | # </script> | 109 | # </script> |
111 | # | 110 | # |
112 | # test" | 111 | # test" |
113 | # s.strip_javascripts! | 112 | # s.strip_javascripts! |
114 | # s #=> "test" | 113 | # s #=> "test" |
115 | def strip_javascripts! | 114 | def strip_javascripts! |
116 | replace strip_with_pattern /<script type="text\/javascript">(.+?)<\/script>/m | 115 | replace strip_with_pattern /<script type="text\/javascript">(.+?)<\/script>/m |
117 | end | 116 | end |
118 | 117 | ||
119 | # Removes all Javascript sources from +self+. | 118 | # Removes all Javascript sources from +self+. |
120 | # | 119 | # |
121 | # s = "<script type='text/javascript'> | 120 | # s = "<script type='text/javascript'> |
122 | # var skin='vector', | 121 | # var skin='vector', |
123 | # stylepath='http://bits.wikimedia.org/skins-1.5' | 122 | # stylepath='http://bits.wikimedia.org/skins-1.5' |
124 | # </script> | 123 | # </script> |
125 | # | 124 | # |
126 | # test" | 125 | # test" |
127 | # s.strip_javascripts #=> "test" | 126 | # s.strip_javascripts #=> "test" |
128 | def strip_javascripts | 127 | def strip_javascripts |
129 | dup.strip_javascripts! | 128 | dup.strip_javascripts! |
130 | end | 129 | end |
131 | 130 | ||
132 | def strip_stylesheets! | 131 | def strip_stylesheets! |
133 | # TODO: rewamp. dunno what is it. | 132 | # TODO: rewamp. dunno what is it. |
134 | replace strip_with_pattern /<style type="text\/css">(.+?)<\/style>/m | 133 | replace strip_with_pattern /<style type="text\/css">(.+?)<\/style>/m |
135 | end | 134 | end |
136 | 135 | ||
137 | def strip_stylesheets | 136 | def strip_stylesheets |
138 | dup.strip_stylesheets! | 137 | dup.strip_stylesheets! |
139 | end | 138 | end |
140 | 139 | ||
141 | # Removes punctuation from +self+. | 140 | # Removes punctuation from +self+. |
142 | # | 141 | # |
143 | # s = "hello, world. how are you?!" | 142 | # s = "hello, world. how are you?!" |
144 | # s.strip_punctuation! | 143 | # s.strip_punctuation! |
145 | # s # => "hello world how are you" | 144 | # s # => "hello world how are you" |
146 | def strip_punctuation! | 145 | def strip_punctuation! |
147 | replace strip_with_pattern /[^a-zA-Z0-9\-\s]/ | 146 | replace strip_with_pattern /[^a-zA-Z0-9\-\s]/ |
148 | end | 147 | end |
149 | 148 | ||
150 | # Removes punctuation from +self+. | 149 | # Removes punctuation from +self+. |
151 | # | 150 | # |
152 | # s = "hello, world. how are you?!" | 151 | # s = "hello, world. how are you?!" |
153 | # s.strip_punctuation # => "hello world how are you" | 152 | # s.strip_punctuation # => "hello world how are you" |
154 | def strip_punctuation | 153 | def strip_punctuation |
155 | dup.strip_punctuation! | 154 | dup.strip_punctuation! |
156 | end | 155 | end |
157 | 156 | ||
158 | # Returns the text values inside all occurences of a XML tag in +self+ | 157 | # Returns the text values inside all occurences of a XML tag in +self+ |
159 | # | 158 | # |
160 | # s = "four-piece in <a href='#'>Indianapolis</a>, <a href='#'>Indiana</a> at the Murat Theatre" | 159 | # s = "four-piece in <a href='#'>Indianapolis</a>, <a href='#'>Indiana</a> at the Murat Theatre" |
161 | # s.extract_xmltags_values 'a' #=> ["Indianapolis", "Indiana"] | 160 | # s.extract_xmltags_values 'a' #=> ["Indianapolis", "Indiana"] |
162 | def extract_xmltags_values(tag_name) | 161 | def extract_xmltags_values(tag_name) |
163 | self.scan(/<#{tag_name}.*?>(.+?)<\/#{tag_name}>/).flatten | 162 | self.scan(/<#{tag_name}.*?>(.+?)<\/#{tag_name}>/).flatten |
164 | end | 163 | end |
165 | 164 | ||
166 | def strip_with_pattern(pattern) | 165 | def strip_with_pattern(pattern) |
167 | require 'cgi' | 166 | require 'cgi' |
168 | require 'kconv' | 167 | require 'kconv' |
169 | CGI::unescapeHTML(self.gsub(pattern,"")).toutf8 | 168 | CGI::unescapeHTML(self.gsub(pattern,"")).toutf8 |
170 | end | 169 | end |
171 | 170 | ||
172 | private :strip_with_pattern | 171 | private :strip_with_pattern |
173 | end | 172 | end |
174 | 173 |