Commit b3995017e62d8ceab00ee0f900199a2e6121b382
1 parent
81ed24dd04
Exists in
master
changing the name of the lib
Showing 94 changed files with 78 additions and 4466 deletions Side-by-side Diff
- README.markdown
- Rakefile
- doc/classes/Corpus.html
- doc/classes/Corpus.src/M000001.html
- doc/classes/Corpus.src/M000002.html
- doc/classes/Indri.html
- doc/classes/Indri/IndriQuery.html
- doc/classes/Indri/IndriQuery.src/M000020.html
- doc/classes/Indri/IndriQuery.src/M000021.html
- doc/classes/Indri/Parameters.html
- doc/classes/Indri/Parameters.src/M000018.html
- doc/classes/Indri/Parameters.src/M000019.html
- doc/classes/Query.html
- doc/classes/RIR.html
- doc/classes/RIR/Corpus.html
- doc/classes/RIR/Corpus.src/M000020.html
- doc/classes/RIR/Corpus.src/M000021.html
- doc/classes/RIR/Document.html
- doc/classes/RIR/Document.src/M000022.html
- doc/classes/RIR/Document.src/M000023.html
- doc/classes/RIR/Document.src/M000024.html
- doc/classes/RIR/Document.src/M000025.html
- doc/classes/RIR/Document.src/M000026.html
- doc/classes/RIR/Document.src/M000027.html
- doc/classes/RIR/Indri.html
- doc/classes/RIR/Indri/IndriQuery.html
- doc/classes/RIR/Indri/IndriQuery.src/M000018.html
- doc/classes/RIR/Indri/IndriQuery.src/M000019.html
- doc/classes/RIR/Indri/Parameters.html
- doc/classes/RIR/Indri/Parameters.src/M000016.html
- doc/classes/RIR/Indri/Parameters.src/M000017.html
- doc/classes/RIR/Query.html
- doc/classes/RIR/TreeTagger.html
- doc/classes/RIR/TreeTagger/Chunk.html
- doc/classes/RIR/TreeTagger/Chunk.src/M000015.html
- doc/classes/RIR/TreeTagger/TaggerChunker.html
- doc/classes/RIR/TreeTagger/TaggerChunker.src/M000013.html
- doc/classes/RIR/TreeTagger/TaggerChunker.src/M000014.html
- doc/classes/RIR/TreeTagger/TaggerChunkerEnglish.html
- doc/classes/RIR/TreeTagger/TaggerChunkerFrench.html
- doc/classes/RIR/TreeTagger/TaggerChunkerGerman.html
- doc/classes/RIR/WebDocument.html
- doc/classes/RIR/WebDocument.src/M000028.html
- doc/classes/RIR/WebDocument.src/M000029.html
- doc/classes/RIR/WikipediaPage.html
- doc/classes/RIR/WikipediaPage.src/M000030.html
- doc/classes/RIR/WikipediaPage.src/M000031.html
- doc/classes/RIR/WikipediaPage.src/M000032.html
- doc/classes/Regexp.html
- doc/classes/Regexp.src/M000001.html
- doc/classes/Regexp.src/M000003.html
- doc/classes/String.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/classes/String.src/M000010.html
- doc/classes/String.src/M000011.html
- doc/classes/String.src/M000012.html
- doc/classes/String.src/M000013.html
- doc/classes/String.src/M000014.html
- doc/classes/TreeTagger.html
- doc/classes/TreeTagger/Chunk.html
- doc/classes/TreeTagger/Chunk.src/M000017.html
- doc/classes/TreeTagger/TaggerChunker.html
- doc/classes/TreeTagger/TaggerChunker.src/M000015.html
- doc/classes/TreeTagger/TaggerChunker.src/M000016.html
- doc/classes/TreeTagger/TaggerChunkerEnglish.html
- doc/classes/TreeTagger/TaggerChunkerFrench.html
- doc/classes/TreeTagger/TaggerChunkerGerman.html
- doc/created.rid
- doc/files/lib/rir/corpus_rb.html
- doc/files/lib/rir/document_rb.html
- doc/files/lib/rir/query_rb.html
- doc/files/lib/rir/regexp_rb.html
- doc/files/lib/rir/string_rb.html
- doc/files/lib/rir/ttagger_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.rb
- lib/rir/corpus.rb
- lib/rir/document.rb
- lib/rir/query.rb
- lib/rir/regexp.rb
- lib/rir/string.rb
- lib/rir/ttagger.rb
- main.rb
README.markdown
Rakefile
doc/classes/Corpus.html
doc/classes/Corpus.src/M000001.html
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | 8 | </head> |
9 | 9 | <body class="standalone-code"> |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/corpus.rb, line 25</span> | |
10 | + <pre><span class="ruby-comment cmt"># File lib/mirimiri/corpus.rb, line 25</span> | |
11 | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">path</span>) |
12 | 12 | <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">chomp</span> <span class="ruby-value str">"/"</span> |
13 | 13 | <span class="ruby-keyword kw">end</span></pre> |
doc/classes/Corpus.src/M000002.html
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | 8 | </head> |
9 | 9 | <body class="standalone-code"> |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/corpus.rb, line 35</span> | |
10 | + <pre><span class="ruby-comment cmt"># File lib/mirimiri/corpus.rb, line 35</span> | |
11 | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">files</span> |
12 | 12 | <span class="ruby-constant">Dir</span>[<span class="ruby-node">"#{@path}/**/*.*"</span>] |
13 | 13 | <span class="ruby-keyword kw">end</span></pre> |
doc/classes/Indri.html
doc/classes/Indri/IndriQuery.html
doc/classes/Indri/IndriQuery.src/M000020.html
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | 8 | </head> |
9 | 9 | <body class="standalone-code"> |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/query.rb, line 62</span> | |
10 | + <pre><span class="ruby-comment cmt"># File lib/mirimiri/query.rb, line 62</span> | |
11 | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">id</span>,<span class="ruby-identifier">query</span>,<span class="ruby-identifier">params</span>) |
12 | 12 | <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span> |
13 | 13 | <span class="ruby-comment cmt"># Here we set the default retrieval model as Language Modeling</span> |
doc/classes/Indri/IndriQuery.src/M000021.html
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | 8 | </head> |
9 | 9 | <body class="standalone-code"> |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/query.rb, line 73</span> | |
10 | + <pre><span class="ruby-comment cmt"># File lib/mirimiri/query.rb, line 73</span> | |
11 | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span> |
12 | 12 | <span class="ruby-identifier">h</span> = <span class="ruby-ivar">@params</span>.<span class="ruby-identifier">to_s</span> |
13 | 13 | <span class="ruby-identifier">h</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"<query>\n"</span> |
doc/classes/Indri/Parameters.html
doc/classes/Indri/Parameters.src/M000018.html
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | 8 | </head> |
9 | 9 | <body class="standalone-code"> |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/query.rb, line 30</span> | |
10 | + <pre><span class="ruby-comment cmt"># File lib/mirimiri/query.rb, line 30</span> | |
11 | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">corpus</span>,<span class="ruby-identifier">mem</span>=<span class="ruby-value str">"1g"</span>,<span class="ruby-identifier">count</span>=<span class="ruby-value str">"1000"</span>,<span class="ruby-identifier">offset</span>=<span class="ruby-value str">"1"</span>,<span class="ruby-identifier">run_id</span>=<span class="ruby-value str">"default"</span>,<span class="ruby-identifier">print_query</span>=<span class="ruby-keyword kw">false</span>,<span class="ruby-identifier">print_docs</span>=<span class="ruby-keyword kw">false</span>) |
12 | 12 | <span class="ruby-ivar">@index_path</span> = <span class="ruby-identifier">corpus</span> |
13 | 13 | <span class="ruby-ivar">@memory</span> = <span class="ruby-identifier">mem</span> |
doc/classes/Indri/Parameters.src/M000019.html
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
8 | 8 | </head> |
9 | 9 | <body class="standalone-code"> |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/query.rb, line 40</span> | |
10 | + <pre><span class="ruby-comment cmt"># File lib/mirimiri/query.rb, line 40</span> | |
11 | 11 | <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span> |
12 | 12 | <span class="ruby-identifier">h</span> = <span class="ruby-value str">"<parameters>\n"</span> |
13 | 13 | <span class="ruby-identifier">h</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"<memory>#{@memory}</memory>\n"</span> |
doc/classes/Query.html
doc/classes/RIR.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>Module: RIR [RDoc Documentation]</title> | |
6 | - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
7 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
8 | - <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> | |
9 | - <script type="text/javascript"> | |
10 | - // <![CDATA[ | |
11 | - | |
12 | - function popupCode( url ) { | |
13 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | |
14 | - } | |
15 | - | |
16 | - function toggleCode( id ) { | |
17 | - if ( document.getElementById ) | |
18 | - elem = document.getElementById( id ); | |
19 | - else if ( document.all ) | |
20 | - elem = eval( "document.all." + id ); | |
21 | - else | |
22 | - return false; | |
23 | - | |
24 | - elemStyle = elem.style; | |
25 | - | |
26 | - if ( elemStyle.display != "block" ) { | |
27 | - elemStyle.display = "block" | |
28 | - } else { | |
29 | - elemStyle.display = "none" | |
30 | - } | |
31 | - | |
32 | - return true; | |
33 | - } | |
34 | - | |
35 | - // Make codeblocks hidden by default | |
36 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | |
37 | - | |
38 | - // ]]> | |
39 | - </script> | |
40 | - | |
41 | -</head> | |
42 | -<body> | |
43 | - | |
44 | - | |
45 | - <div id="classHeader"> | |
46 | - <table class="header-table"> | |
47 | - <tr class="top-aligned-row"> | |
48 | - <td><strong>Module</strong></td> | |
49 | - <td class="class-name-in-header">RIR</td> | |
50 | - </tr> | |
51 | - <tr class="top-aligned-row"> | |
52 | - <td><strong>In:</strong></td> | |
53 | - <td> | |
54 | - | |
55 | - | |
56 | - <a href="../files/lib/rir/string_rb.html"> | |
57 | - | |
58 | - lib/rir/string.rb | |
59 | - | |
60 | - </a> | |
61 | - | |
62 | - | |
63 | - <br /> | |
64 | - | |
65 | - | |
66 | - <a href="../files/lib/rir/document_rb.html"> | |
67 | - | |
68 | - lib/rir/document.rb | |
69 | - | |
70 | - </a> | |
71 | - | |
72 | - | |
73 | - <br /> | |
74 | - | |
75 | - </td> | |
76 | - </tr> | |
77 | - | |
78 | - | |
79 | - </table> | |
80 | - </div> | |
81 | - <!-- banner header --> | |
82 | - | |
83 | - <div id="bodyContent"> | |
84 | - | |
85 | - <div id="contextContent"> | |
86 | - | |
87 | - <div id="description"> | |
88 | - <hr size="1"></hr><p> | |
89 | -General module for many purposes related to Information Retrieval. | |
90 | -</p> | |
91 | - | |
92 | - </div> | |
93 | - | |
94 | - </div> | |
95 | - | |
96 | - | |
97 | - </div> | |
98 | - | |
99 | - <!-- if includes --> | |
100 | - | |
101 | - <div id="section"> | |
102 | - | |
103 | - <div id="class-list"> | |
104 | - <h3 class="section-bar">Classes and Modules</h3> | |
105 | - | |
106 | - Class <a href="RIR/Document.html" class="link">RIR::Document</a><br /> | |
107 | -Class <a href="RIR/WebDocument.html" class="link">RIR::WebDocument</a><br /> | |
108 | -Class <a href="RIR/WikipediaPage.html" class="link">RIR::WikipediaPage</a><br /> | |
109 | - | |
110 | - </div> | |
111 | - | |
112 | - <div id="constants-list"> | |
113 | - <h3 class="section-bar">Constants</h3> | |
114 | - | |
115 | - <div class="name-list"> | |
116 | - <table summary="Constants"> | |
117 | - | |
118 | - <tr class="top-aligned-row context-row"> | |
119 | - <td class="context-item-name">Stoplist</td> | |
120 | - <td>=</td> | |
121 | - <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> | |
122 | - | |
123 | - <td> </td> | |
124 | - <td class="context-item-desc"> | |
125 | -These are the default stopwords provided by Lemur. | |
126 | - | |
127 | -</td> | |
128 | - | |
129 | - </tr> | |
130 | - | |
131 | - </table> | |
132 | - </div> | |
133 | - </div> | |
134 | - | |
135 | - | |
136 | - | |
137 | - | |
138 | - <!-- if method_list --> | |
139 | - | |
140 | - | |
141 | - | |
142 | - | |
143 | - </div> | |
144 | - | |
145 | -<div id="validator-badges"> | |
146 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | |
147 | -</div> | |
148 | - | |
149 | -</body> | |
150 | -</html> |
doc/classes/RIR/Corpus.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>Class: RIR::Corpus [RDoc Documentation]</title> | |
6 | - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
7 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
8 | - <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | |
9 | - <script type="text/javascript"> | |
10 | - // <![CDATA[ | |
11 | - | |
12 | - function popupCode( url ) { | |
13 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | |
14 | - } | |
15 | - | |
16 | - function toggleCode( id ) { | |
17 | - if ( document.getElementById ) | |
18 | - elem = document.getElementById( id ); | |
19 | - else if ( document.all ) | |
20 | - elem = eval( "document.all." + id ); | |
21 | - else | |
22 | - return false; | |
23 | - | |
24 | - elemStyle = elem.style; | |
25 | - | |
26 | - if ( elemStyle.display != "block" ) { | |
27 | - elemStyle.display = "block" | |
28 | - } else { | |
29 | - elemStyle.display = "none" | |
30 | - } | |
31 | - | |
32 | - return true; | |
33 | - } | |
34 | - | |
35 | - // Make codeblocks hidden by default | |
36 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | |
37 | - | |
38 | - // ]]> | |
39 | - </script> | |
40 | - | |
41 | -</head> | |
42 | -<body> | |
43 | - | |
44 | - | |
45 | - <div id="classHeader"> | |
46 | - <table class="header-table"> | |
47 | - <tr class="top-aligned-row"> | |
48 | - <td><strong>Class</strong></td> | |
49 | - <td class="class-name-in-header">RIR::Corpus</td> | |
50 | - </tr> | |
51 | - <tr class="top-aligned-row"> | |
52 | - <td><strong>In:</strong></td> | |
53 | - <td> | |
54 | - | |
55 | - | |
56 | - <a href="../../files/lib/rir/corpus_rb.html"> | |
57 | - | |
58 | - lib/rir/corpus.rb | |
59 | - | |
60 | - </a> | |
61 | - | |
62 | - | |
63 | - <br /> | |
64 | - | |
65 | - </td> | |
66 | - </tr> | |
67 | - | |
68 | - | |
69 | - <tr class="top-aligned-row"> | |
70 | - <td><strong>Parent:</strong></td> | |
71 | - <td> | |
72 | - | |
73 | - Object | |
74 | - | |
75 | - </td> | |
76 | - </tr> | |
77 | - | |
78 | - </table> | |
79 | - </div> | |
80 | - <!-- banner header --> | |
81 | - | |
82 | - <div id="bodyContent"> | |
83 | - | |
84 | - <div id="contextContent"> | |
85 | - | |
86 | - </div> | |
87 | - | |
88 | - | |
89 | - <div id="method-list"> | |
90 | - <h3 class="section-bar">Methods</h3> | |
91 | - | |
92 | - <div class="name-list"> | |
93 | - | |
94 | - <a href="#M000021">files</a> | |
95 | - | |
96 | - <a href="#M000020">new</a> | |
97 | - | |
98 | - </div> | |
99 | - </div> | |
100 | - | |
101 | - </div> | |
102 | - | |
103 | - <!-- if includes --> | |
104 | - | |
105 | - <div id="section"> | |
106 | - | |
107 | - | |
108 | - | |
109 | - <div id="attribute-list"> | |
110 | - <h3 class="section-bar">Attributes</h3> | |
111 | - | |
112 | - <div class="name-list"> | |
113 | - <table> | |
114 | - | |
115 | - <tr class="top-aligned-row context-row"> | |
116 | - <td class="context-item-name">path</td> | |
117 | - | |
118 | - <td class="context-item-value"> [RW] </td> | |
119 | - | |
120 | - <td class="context-item-desc"></td> | |
121 | - </tr> | |
122 | - | |
123 | - </table> | |
124 | - </div> | |
125 | - </div> | |
126 | - | |
127 | - | |
128 | - <!-- if method_list --> | |
129 | - | |
130 | - <div id="methods"> | |
131 | - | |
132 | - <h3 class="section-bar">Public Class methods</h3> | |
133 | - | |
134 | - | |
135 | - <div id="method-M000020" class="method-detail"> | |
136 | - <a name="M000020"></a> | |
137 | - | |
138 | - <div class="method-heading"> | |
139 | - | |
140 | - <a href="Corpus.src/M000020.html" target="Code" class="method-signature" | |
141 | - onclick="popupCode('Corpus.src/M000020.html');return false;"> | |
142 | - | |
143 | - <span class="method-name">new</span><span class="method-args">(path)</span> | |
144 | - | |
145 | - </a> | |
146 | - | |
147 | - </div> | |
148 | - | |
149 | - <div class="method-description"> | |
150 | - | |
151 | - </div> | |
152 | - </div> | |
153 | - | |
154 | - | |
155 | - <h3 class="section-bar">Public Instance methods</h3> | |
156 | - | |
157 | - | |
158 | - <div id="method-M000021" class="method-detail"> | |
159 | - <a name="M000021"></a> | |
160 | - | |
161 | - <div class="method-heading"> | |
162 | - | |
163 | - <a href="Corpus.src/M000021.html" target="Code" class="method-signature" | |
164 | - onclick="popupCode('Corpus.src/M000021.html');return false;"> | |
165 | - | |
166 | - <span class="method-name">files</span><span class="method-args">()</span> | |
167 | - | |
168 | - </a> | |
169 | - | |
170 | - </div> | |
171 | - | |
172 | - <div class="method-description"> | |
173 | - | |
174 | - <p> | |
175 | -Recursively outputs all files in <tt>self.path</tt>. WARNING ! This | |
176 | -function may take a lot of time if many files are in subdirectories. | |
177 | -</p> | |
178 | -<pre> | |
179 | - c = Corpus.new "my/path" | |
180 | - c.files # => ["README.txt", "lib/code.rb"] | |
181 | -</pre> | |
182 | - | |
183 | - </div> | |
184 | - </div> | |
185 | - | |
186 | - | |
187 | - | |
188 | - </div> | |
189 | - | |
190 | - | |
191 | - | |
192 | - | |
193 | - </div> | |
194 | - | |
195 | -<div id="validator-badges"> | |
196 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | |
197 | -</div> | |
198 | - | |
199 | -</body> | |
200 | -</html> |
doc/classes/RIR/Corpus.src/M000020.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>new (RIR::Corpus)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/corpus.rb, line 25</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">path</span>) | |
12 | - <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">chomp</span> <span class="ruby-value str">"/"</span> | |
13 | - <span class="ruby-keyword kw">end</span></pre> | |
14 | -</body> | |
15 | -</html> |
doc/classes/RIR/Corpus.src/M000021.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>files (RIR::Corpus)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/corpus.rb, line 35</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">files</span> | |
12 | - <span class="ruby-constant">Dir</span>[<span class="ruby-node">"#{@path}/**/*.*"</span>] | |
13 | - <span class="ruby-keyword kw">end</span></pre> | |
14 | -</body> | |
15 | -</html> |
doc/classes/RIR/Document.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>Class: RIR::Document [RDoc Documentation]</title> | |
6 | - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
7 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
8 | - <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | |
9 | - <script type="text/javascript"> | |
10 | - // <![CDATA[ | |
11 | - | |
12 | - function popupCode( url ) { | |
13 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | |
14 | - } | |
15 | - | |
16 | - function toggleCode( id ) { | |
17 | - if ( document.getElementById ) | |
18 | - elem = document.getElementById( id ); | |
19 | - else if ( document.all ) | |
20 | - elem = eval( "document.all." + id ); | |
21 | - else | |
22 | - return false; | |
23 | - | |
24 | - elemStyle = elem.style; | |
25 | - | |
26 | - if ( elemStyle.display != "block" ) { | |
27 | - elemStyle.display = "block" | |
28 | - } else { | |
29 | - elemStyle.display = "none" | |
30 | - } | |
31 | - | |
32 | - return true; | |
33 | - } | |
34 | - | |
35 | - // Make codeblocks hidden by default | |
36 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | |
37 | - | |
38 | - // ]]> | |
39 | - </script> | |
40 | - | |
41 | -</head> | |
42 | -<body> | |
43 | - | |
44 | - | |
45 | - <div id="classHeader"> | |
46 | - <table class="header-table"> | |
47 | - <tr class="top-aligned-row"> | |
48 | - <td><strong>Class</strong></td> | |
49 | - <td class="class-name-in-header">RIR::Document</td> | |
50 | - </tr> | |
51 | - <tr class="top-aligned-row"> | |
52 | - <td><strong>In:</strong></td> | |
53 | - <td> | |
54 | - | |
55 | - | |
56 | - <a href="../../files/lib/rir/document_rb.html"> | |
57 | - | |
58 | - lib/rir/document.rb | |
59 | - | |
60 | - </a> | |
61 | - | |
62 | - | |
63 | - <br /> | |
64 | - | |
65 | - </td> | |
66 | - </tr> | |
67 | - | |
68 | - | |
69 | - <tr class="top-aligned-row"> | |
70 | - <td><strong>Parent:</strong></td> | |
71 | - <td> | |
72 | - | |
73 | - Object | |
74 | - | |
75 | - </td> | |
76 | - </tr> | |
77 | - | |
78 | - </table> | |
79 | - </div> | |
80 | - <!-- banner header --> | |
81 | - | |
82 | - <div id="bodyContent"> | |
83 | - | |
84 | - <div id="contextContent"> | |
85 | - | |
86 | - <div id="description"> | |
87 | - <p> | |
88 | -A <a href="Document.html">Document</a> is a bag of words and is constructed | |
89 | -from a string. | |
90 | -</p> | |
91 | - | |
92 | - </div> | |
93 | - | |
94 | - </div> | |
95 | - | |
96 | - | |
97 | - <div id="method-list"> | |
98 | - <h3 class="section-bar">Methods</h3> | |
99 | - | |
100 | - <div class="name-list"> | |
101 | - | |
102 | - <a href="#M000024">count_words</a> | |
103 | - | |
104 | - <a href="#M000025">entropy</a> | |
105 | - | |
106 | - <a href="#M000022">format_words</a> | |
107 | - | |
108 | - <a href="#M000027">new</a> | |
109 | - | |
110 | - <a href="#M000023">ngrams</a> | |
111 | - | |
112 | - <a href="#M000026">tf</a> | |
113 | - | |
114 | - </div> | |
115 | - </div> | |
116 | - | |
117 | - </div> | |
118 | - | |
119 | - <!-- if includes --> | |
120 | - | |
121 | - <div id="section"> | |
122 | - | |
123 | - | |
124 | - | |
125 | - <div id="attribute-list"> | |
126 | - <h3 class="section-bar">Attributes</h3> | |
127 | - | |
128 | - <div class="name-list"> | |
129 | - <table> | |
130 | - | |
131 | - <tr class="top-aligned-row context-row"> | |
132 | - <td class="context-item-name">doc_content</td> | |
133 | - | |
134 | - <td class="context-item-value"> [R] </td> | |
135 | - | |
136 | - <td class="context-item-desc"></td> | |
137 | - </tr> | |
138 | - | |
139 | - <tr class="top-aligned-row context-row"> | |
140 | - <td class="context-item-name">words</td> | |
141 | - | |
142 | - <td class="context-item-value"> [R] </td> | |
143 | - | |
144 | - <td class="context-item-desc"></td> | |
145 | - </tr> | |
146 | - | |
147 | - </table> | |
148 | - </div> | |
149 | - </div> | |
150 | - | |
151 | - | |
152 | - <!-- if method_list --> | |
153 | - | |
154 | - <div id="methods"> | |
155 | - | |
156 | - <h3 class="section-bar">Public Class methods</h3> | |
157 | - | |
158 | - | |
159 | - <div id="method-M000027" class="method-detail"> | |
160 | - <a name="M000027"></a> | |
161 | - | |
162 | - <div class="method-heading"> | |
163 | - | |
164 | - <a href="Document.src/M000027.html" target="Code" class="method-signature" | |
165 | - onclick="popupCode('Document.src/M000027.html');return false;"> | |
166 | - | |
167 | - <span class="method-name">new</span><span class="method-args">(content)</span> | |
168 | - | |
169 | - </a> | |
170 | - | |
171 | - </div> | |
172 | - | |
173 | - <div class="method-description"> | |
174 | - | |
175 | - </div> | |
176 | - </div> | |
177 | - | |
178 | - | |
179 | - <h3 class="section-bar">Public Instance methods</h3> | |
180 | - | |
181 | - | |
182 | - <div id="method-M000024" class="method-detail"> | |
183 | - <a name="M000024"></a> | |
184 | - | |
185 | - <div class="method-heading"> | |
186 | - | |
187 | - <a href="Document.src/M000024.html" target="Code" class="method-signature" | |
188 | - onclick="popupCode('Document.src/M000024.html');return false;"> | |
189 | - | |
190 | - <span class="method-name">count_words</span><span class="method-args">()</span> | |
191 | - | |
192 | - </a> | |
193 | - | |
194 | - </div> | |
195 | - | |
196 | - <div class="method-description"> | |
197 | - | |
198 | - <p> | |
199 | -Returns a Hash containing the words and their associated counts in the | |
200 | -current <a href="Document.html">Document</a>. | |
201 | -</p> | |
202 | -<pre> | |
203 | - count_words #=> { "guitar"=>1, "bass"=>3, "album"=>20, ... } | |
204 | -</pre> | |
205 | - | |
206 | - </div> | |
207 | - </div> | |
208 | - | |
209 | - | |
210 | - <div id="method-M000025" class="method-detail"> | |
211 | - <a name="M000025"></a> | |
212 | - | |
213 | - <div class="method-heading"> | |
214 | - | |
215 | - <a href="Document.src/M000025.html" target="Code" class="method-signature" | |
216 | - onclick="popupCode('Document.src/M000025.html');return false;"> | |
217 | - | |
218 | - <span class="method-name">entropy</span><span class="method-args">(s)</span> | |
219 | - | |
220 | - </a> | |
221 | - | |
222 | - </div> | |
223 | - | |
224 | - <div class="method-description"> | |
225 | - | |
226 | - <p> | |
227 | -Computes the entropy of a given string <tt>s</tt> inside the document. | |
228 | -</p> | |
229 | -<p> | |
230 | -If the string parameter is composed of many words (i.e. tokens separated by | |
231 | -whitespace(s)), it is considered as an ngram. | |
232 | -</p> | |
233 | -<pre> | |
234 | - entropy("guitar") #=> 0.00432114812727959 | |
235 | - entropy("dillinger escape plan") #=> 0.265862076325102 | |
236 | -</pre> | |
237 | - | |
238 | - </div> | |
239 | - </div> | |
240 | - | |
241 | - | |
242 | - <div id="method-M000023" class="method-detail"> | |
243 | - <a name="M000023"></a> | |
244 | - | |
245 | - <div class="method-heading"> | |
246 | - | |
247 | - <a href="Document.src/M000023.html" target="Code" class="method-signature" | |
248 | - onclick="popupCode('Document.src/M000023.html');return false;"> | |
249 | - | |
250 | - <span class="method-name">ngrams</span><span class="method-args">(n)</span> | |
251 | - | |
252 | - </a> | |
253 | - | |
254 | - </div> | |
255 | - | |
256 | - <div class="method-description"> | |
257 | - | |
258 | - <p> | |
259 | -Returns an Array containing the <tt>n</tt>-grams (words) from the current | |
260 | -<a href="Document.html">Document</a>. | |
261 | -</p> | |
262 | -<pre> | |
263 | - ngrams(2) #=> ["the free", "free encyclopedia", "encyclopedia var", "var skin", ...] | |
264 | -</pre> | |
265 | - | |
266 | - </div> | |
267 | - </div> | |
268 | - | |
269 | - | |
270 | - <div id="method-M000026" class="method-detail"> | |
271 | - <a name="M000026"></a> | |
272 | - | |
273 | - <div class="method-heading"> | |
274 | - | |
275 | - <a href="Document.src/M000026.html" target="Code" class="method-signature" | |
276 | - onclick="popupCode('Document.src/M000026.html');return false;"> | |
277 | - | |
278 | - <span class="method-name">tf</span><span class="method-args">(s)</span> | |
279 | - | |
280 | - </a> | |
281 | - | |
282 | - </div> | |
283 | - | |
284 | - <div class="method-description"> | |
285 | - | |
286 | - <p> | |
287 | -Computes the term frequency of a given <b>word</b> <tt>s</tt>. | |
288 | -</p> | |
289 | -<pre> | |
290 | - tf("guitar") #=> 0.000380372765310004 | |
291 | -</pre> | |
292 | - | |
293 | - </div> | |
294 | - </div> | |
295 | - | |
296 | - | |
297 | - <h3 class="section-bar">Protected Instance methods</h3> | |
298 | - | |
299 | - | |
300 | - <div id="method-M000022" class="method-detail"> | |
301 | - <a name="M000022"></a> | |
302 | - | |
303 | - <div class="method-heading"> | |
304 | - | |
305 | - <a href="Document.src/M000022.html" target="Code" class="method-signature" | |
306 | - onclick="popupCode('Document.src/M000022.html');return false;"> | |
307 | - | |
308 | - <span class="method-name">format_words</span><span class="method-args">()</span> | |
309 | - | |
310 | - </a> | |
311 | - | |
312 | - </div> | |
313 | - | |
314 | - <div class="method-description"> | |
315 | - | |
316 | - <p> | |
317 | -Any non-word characters are removed from the words (see <a | |
318 | -href="http://perldoc.perl.org/perlre.html">perldoc.perl.org/perlre.html</a> | |
319 | -and the W special escape). | |
320 | -</p> | |
321 | -<p> | |
322 | -Protected function, only meant to by called at the initialization. | |
323 | -</p> | |
324 | - | |
325 | - </div> | |
326 | - </div> | |
327 | - | |
328 | - | |
329 | - | |
330 | - </div> | |
331 | - | |
332 | - | |
333 | - | |
334 | - | |
335 | - </div> | |
336 | - | |
337 | -<div id="validator-badges"> | |
338 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | |
339 | -</div> | |
340 | - | |
341 | -</body> | |
342 | -</html> |
doc/classes/RIR/Document.src/M000022.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>format_words (RIR::Document)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/document.rb, line 34</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format_words</span> | |
12 | - <span class="ruby-identifier">wo</span> = [] | |
13 | - | |
14 | - <span class="ruby-ivar">@doc_content</span>.<span class="ruby-identifier">split</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> | |
15 | - <span class="ruby-identifier">w</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\W/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sw</span><span class="ruby-operator">|</span> | |
16 | - <span class="ruby-identifier">wo</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">sw</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sw</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[a-zA-Z]/</span> | |
17 | - <span class="ruby-keyword kw">end</span> | |
18 | - <span class="ruby-keyword kw">end</span> | |
19 | - | |
20 | - <span class="ruby-identifier">wo</span> | |
21 | - <span class="ruby-keyword kw">end</span></pre> | |
22 | -</body> | |
23 | -</html> |
doc/classes/RIR/Document.src/M000023.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>ngrams (RIR::Document)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/document.rb, line 49</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ngrams</span>(<span class="ruby-identifier">n</span>) | |
12 | - <span class="ruby-identifier">window</span> = [] | |
13 | - <span class="ruby-identifier">ngrams_array</span> = [] | |
14 | - | |
15 | - <span class="ruby-ivar">@words</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> | |
16 | - <span class="ruby-identifier">window</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">w</span>) | |
17 | - <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">window</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">n</span> | |
18 | - <span class="ruby-identifier">ngrams_array</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">window</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">" "</span>) | |
19 | - <span class="ruby-identifier">window</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-value">0</span>) | |
20 | - <span class="ruby-keyword kw">end</span> | |
21 | - <span class="ruby-keyword kw">end</span> | |
22 | - | |
23 | - <span class="ruby-identifier">ngrams_array</span>.<span class="ruby-identifier">uniq</span> | |
24 | - <span class="ruby-keyword kw">end</span></pre> | |
25 | -</body> | |
26 | -</html> |
doc/classes/RIR/Document.src/M000024.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>count_words (RIR::Document)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/document.rb, line 67</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">count_words</span> | |
12 | - <span class="ruby-identifier">counts</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-value">0</span> } | |
13 | - <span class="ruby-ivar">@words</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">counts</span>[<span class="ruby-identifier">w</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> } | |
14 | - | |
15 | - <span class="ruby-identifier">counts</span> | |
16 | - <span class="ruby-keyword kw">end</span></pre> | |
17 | -</body> | |
18 | -</html> |
doc/classes/RIR/Document.src/M000025.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>entropy (RIR::Document)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/document.rb, line 81</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entropy</span>(<span class="ruby-identifier">s</span>) | |
12 | - <span class="ruby-identifier">en</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span> | |
13 | - <span class="ruby-identifier">counts</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">count_words</span> | |
14 | - | |
15 | - <span class="ruby-identifier">s</span>.<span class="ruby-identifier">split</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> | |
16 | - <span class="ruby-identifier">p_wi</span> = <span class="ruby-identifier">counts</span>[<span class="ruby-identifier">w</span>].<span class="ruby-identifier">to_f</span><span class="ruby-operator">/</span><span class="ruby-ivar">@words</span>.<span class="ruby-identifier">count</span>.<span class="ruby-identifier">to_f</span> | |
17 | - <span class="ruby-identifier">en</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">p_wi</span><span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">log2</span>(<span class="ruby-identifier">p_wi</span>) | |
18 | - <span class="ruby-keyword kw">end</span> | |
19 | - | |
20 | - <span class="ruby-identifier">en</span> <span class="ruby-operator">*=</span> <span class="ruby-value">-1</span> | |
21 | - <span class="ruby-identifier">en</span> | |
22 | - <span class="ruby-keyword kw">end</span></pre> | |
23 | -</body> | |
24 | -</html> |
doc/classes/RIR/Document.src/M000026.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>tf (RIR::Document)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/document.rb, line 97</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tf</span>(<span class="ruby-identifier">s</span>) | |
12 | - <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">count_words</span>[<span class="ruby-identifier">s</span>].<span class="ruby-identifier">to_f</span><span class="ruby-operator">/</span><span class="ruby-ivar">@words</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_f</span> | |
13 | - <span class="ruby-keyword kw">end</span></pre> | |
14 | -</body> | |
15 | -</html> |
doc/classes/RIR/Document.src/M000027.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>new (RIR::Document)</title> | |
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" /> | |
8 | -</head> | |
9 | -<body class="standalone-code"> | |
10 | - <pre><span class="ruby-comment cmt"># File lib/rir/document.rb, line 102</span> | |
11 | - <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">content</span>) | |
12 | - <span class="ruby-ivar">@doc_content</span> = <span class="ruby-identifier">content</span> | |
13 | - <span class="ruby-ivar">@words</span> = <span class="ruby-identifier">format_words</span> | |
14 | - <span class="ruby-keyword kw">end</span></pre> | |
15 | -</body> | |
16 | -</html> |
doc/classes/RIR/Indri.html
1 | -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
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"> | |
4 | -<head> | |
5 | - <title>Module: RIR::Indri [RDoc Documentation]</title> | |
6 | - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
7 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
8 | - <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> | |
9 | - <script type="text/javascript"> | |
10 | - // <![CDATA[ | |
11 | - | |
12 | - function popupCode( url ) { | |
13 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | |
14 | - } | |
15 | - | |
16 | - function toggleCode( id ) { | |
17 | - if ( document.getElementById ) | |
18 | - elem = document.getElementById( id ); | |
19 | - else if ( document.all ) | |
20 | - elem = eval( "document.all." + id ); | |
21 | - else | |
22 | - return false; | |
23 | - | |
24 | - elemStyle = elem.style; | |
25 | - | |
26 | - if ( elemStyle.display != "block" ) { | |
27 | - elemStyle.display = "block" | |
28 | - } else { | |
29 | - elemStyle.display = "none" | |
30 | - } | |
31 | - | |
32 | - return true; | |
33 | - } | |
34 | - | |
35 | - // Make codeblocks hidden by default | |
36 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" ) | |
37 | - | |
38 | - // ]]> | |
39 | - </script> | |
40 | - | |
41 | -</head> | |
42 | -<body> | |
43 | - | |
44 | - | |
45 | - <div id="classHeader"> | |
46 | - <table class="header-table"> | |
47 | - <tr class="top-aligned-row"> | |
48 | - <td><strong>Module</strong></td> | |
49 | - <td class="class-name-in-header">RIR::Indri</td> | |
50 | - </tr> | |
51 | - <tr class="top-aligned-row"> | |
52 | - <td><strong>In:</strong></td> | |
53 | - <td> | |
54 | - | |
55 | - | |
56 | - <a href="../../files/lib/rir/query_rb.html"> | |
57 | - | |
58 | - lib/rir/query.rb | |