treat 2.0.7 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/files/privacy.html +329 -0
- data/lib/treat/entities/entity/buildable.rb +23 -22
- data/lib/treat/entities/entity/stringable.rb +5 -7
- data/lib/treat/loaders/open_nlp.rb +1 -1
- data/lib/treat/loaders/stanford.rb +1 -1
- data/lib/treat/version.rb +1 -1
- data/lib/treat/workers/extractors/language/what_language.rb +4 -4
- data/lib/treat/workers/extractors/time/chronic.rb +41 -6
- data/lib/treat/workers/extractors/time/nickel.rb +15 -0
- data/lib/treat/workers/extractors/time/ruby.rb +33 -2
- data/lib/treat/workers/lexicalizers/sensers/wordnet.rb +1 -2
- data/lib/treat/workers/processors/chunkers/autoselect.rb +2 -4
- data/lib/treat/workers/processors/chunkers/txt.rb +3 -6
- data/lib/treat/workers/processors/tokenizers/punkt.rb +3 -6
- data/spec/entities/collection.rb +5 -5
- data/spec/entities/entity.rb +41 -18
- data/spec/sandbox.rb +12 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Build Status](https://secure.travis-ci.org/louismullie/treat.png)](http://travis-ci.org/#!/louismullie/treat)
|
2
|
-
[![Code Climate](https://codeclimate.com/
|
2
|
+
[![Code Climate](https://codeclimate.com/github/louismullie/treat.png)](https://codeclimate.com/github/louismullie/treat)
|
3
3
|
|
4
4
|
![Treat Logo](http://www.louismullie.com/treat/treat-logo.jpg)
|
5
5
|
|
@@ -40,4 +40,4 @@ Contributors:
|
|
40
40
|
|
41
41
|
**License**
|
42
42
|
|
43
|
-
This software is released under the [GPL License](https://github.com/louismullie/treat/wiki/License-Information) and includes software released under the GPL, Ruby, Apache 2.0 and MIT licenses.
|
43
|
+
This software is released under the [GPL License](https://github.com/louismullie/treat/wiki/License-Information) and includes software released under the GPL, Ruby, Apache 2.0 and MIT licenses.
|
data/files/privacy.html
ADDED
@@ -0,0 +1,329 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<meta http-equiv="content-language" content="en" />
|
6
|
+
<title>Privacy Policy - Rovio Entertainment Ltd</title>
|
7
|
+
|
8
|
+
<meta name="Author" content="Opus - www.opus.ee" />
|
9
|
+
<meta name="Keywords" content="Rovio,Angry Birds,Angry Birds Seasons ,Angry Birds Rio,Rovio Entertainment,Rovio Mobile,rovio info,angry birds info,about rovio,about angry birds,angry birds company,angry birds studio ,rovio, angry birds, angry, birds, rio, angry birds rio, mobile, games, Angry Birds Seasons, rovio entertainment, rovio mobile, " />
|
10
|
+
<meta name="Description" content="Rovio's privacy policy" />
|
11
|
+
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
|
12
|
+
<meta name="google-site-verification" content="gVYGYuABAJ6hDLyCbXnB4oW2lA6oORdmCn7PLWLYhjQ" />
|
13
|
+
<!-- <meta property="og:title" content="Privacy Policy" />
|
14
|
+
<meta property="og:description" content="Rovio's privacy policy" /> -->
|
15
|
+
|
16
|
+
<link rel="stylesheet" type="text/css" href="/img/styles.css" media="all" />
|
17
|
+
<link rel="stylesheet" type="text/css" href="/img/styles_screen.css" media="screen, projection" title="Rovio Entertainment Ltd" />
|
18
|
+
<link rel="stylesheet" type="text/css" href="/img/styles_print.css" media="print" />
|
19
|
+
<meta name="viewport" content="width=1100, user-scalable=yes" />
|
20
|
+
<meta http-equiv="imagetoolbar" content="false" />
|
21
|
+
<meta http-equiv="X-UA-Compatible" content="IE=8,9" />
|
22
|
+
<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
|
23
|
+
|
24
|
+
<!--
|
25
|
+
<meta property="fb:app_id" content="276164005751643"/>
|
26
|
+
<meta content="http://www.rovio.com/img/rovio_logo_fb.gif" property="og:image" />
|
27
|
+
<meta property="fb:page_id" content="314467614927" />
|
28
|
+
-->
|
29
|
+
<link href="http://www.rovio.com/img/rovio_logo_fb.gif" type="image/jpeg" rel="image_src" />
|
30
|
+
|
31
|
+
<!-- kiosked widget -->
|
32
|
+
<script language="javascript" type="text/javascript" async="async" src="http://widgets.kiosked.com/widget/image/co/1091/id/2366160.js"></script>
|
33
|
+
<script language="javascript" type="text/javascript" async="async" src="http://widgets.kiosked.com/widget/image/co/1091/id/2366161.js"></script>
|
34
|
+
|
35
|
+
<script type="text/javascript">
|
36
|
+
js_site_url = "/";
|
37
|
+
js_next_txt = "Next";
|
38
|
+
js_previous_txt = "Previous";
|
39
|
+
js_image_txt = "Image";
|
40
|
+
thickbox_close_caption = "Close";
|
41
|
+
</script>
|
42
|
+
|
43
|
+
<script type="text/javascript" src="/includes/js/Sitespec/jquery.js"></script>
|
44
|
+
<script type="text/javascript" src="/includes/js/Sitespec/common.js"></script>
|
45
|
+
<script type="text/javascript" src="/includes/js/Sitespec/jquery.thickbox.js"></script>
|
46
|
+
<script type="text/javascript" src="/includes/js/General/swfobject/swfobject.js"></script>
|
47
|
+
|
48
|
+
|
49
|
+
<script type='text/javascript'>if(typeof _var == "undefined"){var _var = {};}
|
50
|
+
</script>
|
51
|
+
|
52
|
+
<script type="text/javascript">
|
53
|
+
|
54
|
+
var _gaq = _gaq || [];
|
55
|
+
_gaq.push(['_setAccount', 'UA-3126593-1']);
|
56
|
+
_gaq.push(['_trackPageview']);
|
57
|
+
|
58
|
+
(function() {
|
59
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
60
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
61
|
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
62
|
+
})();
|
63
|
+
|
64
|
+
</script>
|
65
|
+
</head>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<body class="sub">
|
77
|
+
|
78
|
+
|
79
|
+
<div id="fb-root"></div>
|
80
|
+
<script type="text/javascript">/* <![CDATA[ */(function(d, s, id) {
|
81
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
82
|
+
if (d.getElementById(id)) {return;}
|
83
|
+
js = d.createElement(s); js.id = id;
|
84
|
+
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
|
85
|
+
fjs.parentNode.insertBefore(js, fjs);
|
86
|
+
}(document, 'script', 'facebook-jssdk'));/* ]]> */</script>
|
87
|
+
|
88
|
+
|
89
|
+
<ul id="languages" class="hidden">
|
90
|
+
<li><a href="/zh" class="zh">Chinese</a></li>
|
91
|
+
<li><a href="/ja" class="ja">Japanese</a></li>
|
92
|
+
</ul>
|
93
|
+
|
94
|
+
|
95
|
+
<div class="header01">
|
96
|
+
<div class="a">
|
97
|
+
<div class="mw">
|
98
|
+
<p class="logo01"><a href="/en"><img src="/img/logo_rovio.png" alt="Rovio logo" /></a></p>
|
99
|
+
|
100
|
+
<div id="langselect" class="">
|
101
|
+
<div id="currentlang"><div class="en"> English
|
102
|
+
</div></div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<ul id="menu1" class="menu01">
|
106
|
+
<li class="item01">
|
107
|
+
<a href="/en/about-us"><span>About us</span></a>
|
108
|
+
</li>
|
109
|
+
<li class="item02">
|
110
|
+
<a href="/en/our-work"><span>Products</span></a>
|
111
|
+
</li>
|
112
|
+
<li class="item03">
|
113
|
+
<a href="/en/news"><span>News</span></a>
|
114
|
+
</li>
|
115
|
+
<li class="item04">
|
116
|
+
<a href="/en/careers"><span>Careers</span></a>
|
117
|
+
</li>
|
118
|
+
<li class="item05">
|
119
|
+
<a href="/en/support"><span>Support</span></a>
|
120
|
+
</li>
|
121
|
+
<li class="item06">
|
122
|
+
<a href="/en/advertise"><span>Advertise</span></a>
|
123
|
+
</li>
|
124
|
+
<li class="item07">
|
125
|
+
<a href="/en/developers"><span>Developers</span></a>
|
126
|
+
</li>
|
127
|
+
</ul>
|
128
|
+
|
129
|
+
<ul class="cosites01">
|
130
|
+
<li><a target="_blank" href="http://www.facebook.com/angrybirds" class="fb"><span>Rovio on Facebook</span></a></li>
|
131
|
+
<li><a target="_blank" href="http://twitter.com/#!/angrybirds" class="tw"><span>Rovio in Twitter</span></a></li>
|
132
|
+
<li><a target="_blank" href="http://www.youtube.com/user/RovioMobile" class="yt"><span>Rovio on Youtube</span></a></li>
|
133
|
+
</ul>
|
134
|
+
|
135
|
+
<form action="/en/search" name="search" id="search" method="get">
|
136
|
+
<div class="search01">
|
137
|
+
<div class="clear">
|
138
|
+
<input type="text" class="field" name="search-string" id="search-string"/>
|
139
|
+
<input type="submit" title="Search" alt="Search" class="submit" id="search-submit" value="" />
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</form>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
<div class="b">
|
146
|
+
</div>
|
147
|
+
|
148
|
+
</div>
|
149
|
+
|
150
|
+
<div class="posrel sub00">
|
151
|
+
<span class="shadow01"></span>
|
152
|
+
<div class="box02">
|
153
|
+
<div class="mw">
|
154
|
+
<div class="subheader" id="subheader">
|
155
|
+
<span class="a"></span>
|
156
|
+
<p class="title"><span> Privacy Policy
|
157
|
+
</span></p>
|
158
|
+
<span class="slide " style="background: #fff url('/UserFiles/Image/BnImages/Rovio_subpagebanner_6.jpg') no-repeat;"></span>
|
159
|
+
|
160
|
+
<script type="text/javascript" src="http://www.rovio.com/includes/js/Sitespec/Banners/subpage_slider.js"></script>
|
161
|
+
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="sub02 clear">
|
166
|
+
<div class="pad01 block01 pad legal"><br /><a href="http://www.rovio.com/Privacy-french">en français</a><br /><a href="http://www.rovio.com/Privacy-finnish">suomeksi</a><br /><a href="http://www.rovio.com/Privacy-swedish">på svenska</a><br /><a href="http://www.rovio.com/Privacy-usa">USA</a><br /><p class="title1">Last updated: October 2013</p>
|
167
|
+
<p><strong>Rovio Entertainment Ltd Privacy Policy</strong></p>
|
168
|
+
<p>Rovio Entertainment Ltd, including its affiliates (<strong>“Rovio”</strong>), collects, stores, and uses your personal information as a data controller in connection with and in order to provide and develop Rovio’s products, mobile applications, services and websites (together <strong>“Services”</strong>) according to this privacy policy (<strong>“Privacy Policy”</strong>).</p>
|
169
|
+
<p>For questions and information about Privacy Policy and data subject's rights, please contact us at privacy[at]rovio.com or alternatively at Rovio Entertainment Ltd, Legal Department, Keilaranta 17 C, 02150 Espoo, Finland.</p>
|
170
|
+
<p>For information about our privacy practices related to data from children, please see “Special Note About Children’s Privacy” below.</p>
|
171
|
+
<p><strong>All Rovio Services are governed by this Privacy Policy and by using or accessing a Service You give consent to the processing, use and disclosure of your data. Please do not install or use the Services if you do not agree to this Privacy Policy.</strong></p>
|
172
|
+
<p>Rovio reserves the right to modify this Privacy Policy. Your continued use of Services will signify your acceptance of the changes to this Privacy Policy.</p>
|
173
|
+
<p><strong>1. How We Collect Your data</strong></p>
|
174
|
+
<p>Likely situations when you make personal data available to Rovio include, but are not limited to: (i) by using Rovio’s mobile apps or visiting our websites, (ii) registration for Services, contests and special events; (iii) accessing Services using a third party ID, such as social networking sites or gaming services; (iv) subscribing to newsletters; (v) purchasing a product or services through Rovio’s online stores or within the app (or "in-app purchase"); (vi) using “tell a friend,” "email this page," or other similar features; (vii) requesting technical support; and (viii) otherwise through use of Rovio Services where personal data is required for use and/or participation.</p>
|
175
|
+
<p>The data we process on you may include, but is not limited to: email address, device ID, IP-address, user names and passwords.</p>
|
176
|
+
<p>Rovio may supplement your data with data received from third parties in connection with demographic, advertisement, market and other analytics surveys or services.</p>
|
177
|
+
<p><strong>2. Ad Serving Technology</strong></p>
|
178
|
+
<p>Rovio reserves the right to use and disclose the collected, non-personal data for purposes of advertising by Rovio or Rovio’s partners and contractors.</p>
|
179
|
+
<p>Rovio may employ third party ad serving technologies that use certain methods to collect information as a result of ad serving through Services.</p>
|
180
|
+
<p>Rovio or third parties operating the ad serving technology may use demographic and geo-location information (for more information regarding use of Location Data see below Section 3) as well as information logged from your hardware or device to ensure that relevant advertising is presented within the Service. Rovio or third parties may collect and use data, for such purposes, including but not limited to, data such as IP address, Device ID, MAC address, installed software, application usage data, hardware type, Operating System information, browser information, unique identifiers in browser cookies, Flash cookies, and HTML5 local storage, Internet and on-line usage information and in-game information.</p>
|
181
|
+
<p>The foregoing data may be used and disclosed in accordance with this Privacy Policy and the privacy policy of the company providing the ad serving technology.</p>
|
182
|
+
<p>Rovio may display to you behaviorally targeted advertising. If you wish to "opt out" of certain targeted advertising, please visit <a target="_blank" title="Your AdChoices" href="http://www.youradchoices.com">http://www.youradchoices.com</a> and/or <a target="_blank" title="Network Advertising" href="http://www.networkadvertising.org">www.networkadvertising.org</a>. Please note that the links above may not reach all Rovio’s advertising partners and certain behaviorally targeted advertising may still be displayed to you. If you want to be certain that no behaviorally targeted advertisements are displayed to you, please do not use or access the Services.</p>
|
183
|
+
<p>Some services may include the use of in-game advertisements or brand placement. Such ads or sponsorships will be noted as such within the services.</p>
|
184
|
+
<p>Additionally please note that if you “opt out” it does not mean that you will no longer receive advertising. It just means that the advertising you see displayed will not be customized to you and your interests and may be less relevant to you.</p>
|
185
|
+
<p><strong>3. Location Data</strong></p>
|
186
|
+
<p>To the extent Rovio makes location enabled Services available and you use such Services, Rovio may collect and process your location data to provide location related Services and advertisements. For example, some add-ons or offers may be available at dedicated locations. The location data is processed and stored only for the duration that is required for the provision of the location related Services.</p>
|
187
|
+
<p>Rovio may use, depending on the service (1)IP-based location based on the IP address presented by the end-user, (2) fine geo-location data based on coordinates obtained from a mobile device’s GPS radio, or (3) coarse, network-based geo-location data based on proximity of network towers or the location of WiFi networks.</p>
|
188
|
+
<p>Your fine, GPS-based geo-location is not accessed without your consent. Notwithstanding Rovio’s partners who are providing location related parts of the Service, Rovio will not share your GPS geo-location with third parties without your consent. To the extent Rovio makes available GPS geo-location to third parties in accordance with this Privacy Policy, it will be provided anonymously.</p>
|
189
|
+
<p><strong>4. Analytics</strong></p>
|
190
|
+
<p>Rovio uses your information to perform its own analytics and to enable analytics provided by third parties. We use analytical information for supporting business analysis and operations, business intelligence, product development, improving products and services, personalizing content, providing advertising, and making recommendations. Rovio may also use third-parties, such as a Flurry in order to develop and analyze use of the Services. For more information about Flurry and its services please see <a target="_blank" title="Flurry" href="http://www.flurry.com/">http://www.flurry.com/</a>.</p>
|
191
|
+
<p><strong>5. Friends</strong></p>
|
192
|
+
<p>If you choose to use Rovio’s "tell a friend" or a similar service about Rovio Services or order a gift certificate for your friend, Rovio may store your friend's name and contact details that you provide to Rovio.</p>
|
193
|
+
<p>Please note that certain features of the Services may be able to connect to your social networking sites to obtain additional information about you. In such cases, Rovio may be able to collect certain information from your social networking profile when your social networking site permits it, and when you consent to allow your social networking site to make that information available to Rovio. This information may include, but is not limited to, your name, profile picture, gender, user ID, email address, your country, your language, your time zone, the organizations and links on your profile page, the names and profile pictures of your social networking site “friends” and other information you have included in your social networking site profile. Rovio may associate and/or combine as well as use information collected by Rovio and/or obtained through such social networking sites.</p>
|
194
|
+
<p><strong>6. Disclosure and Transfer of Personal Data</strong></p>
|
195
|
+
<p>Personal data may be disclosed to third parties including third parties located outside the European Union or the European Economic Area in accordance with applicable legislation and this Privacy Policy.</p>
|
196
|
+
<p>Rovio may use third parties to collect and process personal data on Rovio’s behalf and in according to Rovio’s instructions. Rovio is not liable for the acts and omissions of these third parties, except as provided by mandatory law.</p>
|
197
|
+
<p><strong>7. Data Retention and Correctness</strong></p>
|
198
|
+
<p>Rovio retains the collected data for the period necessary to fulfill the purposes outlined in this Privacy Policy unless a longer retention period is required or permitted by law. Thereafter Rovio deletes all aforementioned data in its possession within a reasonable timeframe. Rovio does not verify the correctness of personal data.</p>
|
199
|
+
<p>Please note that some data may be further retained if necessary to resolve disputes, enforce Rovio user agreements, and comply with technical and legal requirements and constraints related to the security, integrity and operation of Services.</p>
|
200
|
+
<p><strong>8. Cookies, beacons and tracking</strong></p>
|
201
|
+
<p>The Services may use “cookies” and other technologies such as pixel tags, local shared objects, hardware-based device identifiers, Operating System-based identifiers, clear GIFs and web beacons. Rovio treats information collected by cookies and similar technologies as non-personal data.</p>
|
202
|
+
<p>Cookies: A “cookie” is a small file stored by your browser when told to do so by a website. Typically websites place a number of different cookies on an end-user’s machine. Some of the cookies are “1st Party,” from the website itself, and others are “3rd party,” belonging to advertising and analytics entities or social networks. Rovio’s cookies do not include personal data and are typically used to quickly identify your device and to “remember” your browser during subsequent visits for purposes of functionality, preferences, and website performance. You can disable cookies or set your browser to alert you when cookies are being sent to your device; however, disabling cookies may affect your ability to use the Services.</p>
|
203
|
+
<p>Flash cookies & HTML5: Rovio may also use Flash cookies (local shared objects) and HTML5 local storage. Flash cookies are small files similar to browser cookies, but which are not stored in the browser and can also be used to remember your settings, to personalize the look and feel of the Services, or for advertising and analytics. You may prevent Flash cookies from being stored by following the instructions provided by Adobe at <a target="_blank" title="Adobe Flash Player" href="http://helpx.adobe.com/flash-player/kb/disable-local-shared-objects-flash.html">http://helpx.adobe.com/flash-player/kb/disable-local-shared-objects-flash.html</a>.</p>
|
204
|
+
<p>Web Beacons and pixel tags: A “web beacon” or a “pixel tag” is an electronic image (often not visible to the end-user) that allows Rovio to count users who have visited certain pages or viewed certain advertisements. Additionally, e-mails and other electronic communications Rovio sends to you may contain pixel tags that enable Rovio to track your usage of the communication, including whether the communication was opened and/or what links were followed, if any.</p>
|
205
|
+
<p><strong>9. Third Party Terms and Conditions</strong></p>
|
206
|
+
<p>Please note that your access to and use of the Services may be subject to certain third party terms and conditions and Rovio is not liable for any such third parties’ use of your personal data.</p>
|
207
|
+
<p>Certain Services that Rovio may offer, such as multiplayer gaming, social networking and gaming console services, may use third party services to provide authentication for the Services with a gaming console ID, social networking ID, or gaming network account. In connection with such use, certain personally identifiable user and/or membership data may be transferred automatically to and from Rovio.</p>
|
208
|
+
<p>Rovio may disclose your personal data to third parties in connection with a corporate merger, consolidation, restructuring, the sale of substantially all of Rovio’s stock and/or assets or other corporate change, including, without limitation, during the course of any due diligence process provided, however, that this Privacy Policy shall continue to govern such personal data.</p>
|
209
|
+
<p><strong>10. Safeguards</strong></p>
|
210
|
+
<p>Rovio follows generally accepted industry standards and maintains reasonable safeguards to attempt to ensure the security, integrity and privacy of the information in Rovio’s possession.</p>
|
211
|
+
<p><strong>11. Other</strong></p>
|
212
|
+
<p>You may choose to disclose data about yourself in the course of contributing user generated content to the Services.</p>
|
213
|
+
<p>Any data that you disclose in any of these forums, blogs, chats or the like will become <strong>public information</strong>, and there is no expectation of privacy or confidentiality with respect to that data.</p>
|
214
|
+
<p>Rovio may store and/or transfer your personal data to its affiliates and partners in and outside of EU/EEA member states and the United States in accordance with mandatory legislation and this Privacy Policy.</p>
|
215
|
+
<p><strong>12. Special Note about Children’s Privacy</strong></p>
|
216
|
+
<p>Rovio does not knowingly collect personal information from children under 13 years of age. If Rovio learns that Rovio has inadvertently gathered personal data from children under 13 years of age, Rovio will take reasonable measures to promptly delete such personal data from Rovio’s records.</p>
|
217
|
+
<p>Rovio understands the need to provide extra privacy protections to users who are children. To that end, features and services such as social networking plug-ins, behaviorally targeted advertising, and collection of data for the purpose of building user profiles are not available to users under 13. Rovio also does not allow our third party partners who engage in such practices to access personally identifiable data from users under 13.</p>
|
218
|
+
<p>Rovio and its partners do collect non-personally identifiable data from children. This includes, for example, collection of IP-based geolocation data to ensure that the product, service or features served comply with applicable laws of that nation.</p>
|
219
|
+
<p>Rovio and its partners also collect data to assess general information about the use of products, such as the number of visitors to our sites and services and which sections of a site or service are popular. Rovio also uses this data to provide contextually-relevant advertising to users, to prevent users from seeing the same ad repeatedly, and to allow users to personalize their experience on the site or service (for example, to save a high score in a game). Rovio and its partners may also use cookies, pixels, hardware-based identifiers, Operating System-based identifiers, and software-set identifiers, to manage and measure the performance of advertising.</p>
|
220
|
+
<p>Please note that Rovio’s partners may have their own policies related to tracking technologies for analytics and ad-serving purposes. While Rovio requires that companies comply with Rovio’s privacy policy before Rovio allows those companies to access our sites and services, Rovio does not actually control third-party data collection and use. Rovio encourages parents to review the list of operators below and to become familiar with those parties policies and practices.</p>
|
221
|
+
<p>If you have additional questions about Rovio’s Privacy Practices related to children under the age of 13, please contact us at <a href="mailto:privacy@rovio.com">privacy@rovio.com</a>, or alternatively at Rovio Entertainment Ltd., Legal Department, Keilaranta 17 C, 02150 Espoo, Finland.</p>
|
222
|
+
<p><strong>13. Further information</strong></p>
|
223
|
+
<p>This Privacy Policy is governed by Finnish law excluding its choice of law provisions.</p>
|
224
|
+
<p>Rovio makes good faith efforts to enable you to review, update or correct your personal data in Rovio’s possession.</p>
|
225
|
+
<p>Rovio will need sufficient information from you to establish your identity and to verify your access request, and also to assist us in handling your request.</p>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
<div class="footer01">
|
230
|
+
<div class="a clear">
|
231
|
+
|
232
|
+
<div class="col">
|
233
|
+
<h2>Rovio Entertainment ltd.</h2>
|
234
|
+
<p>Keilaranta 17,<br />FI-02150 ESPOO<br />FINLAND<br />Tel: +358 207 888 300 <br />fax: +358 207 888 333</p>
|
235
|
+
<div class="mt20">
|
236
|
+
<iframe src="http://www.facebook.com/plugins/like.php?app_id=201293179930017&href=http://www.rovio.com/en&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light&font=arial&height=20"
|
237
|
+
scrolling="no" frameborder="0"
|
238
|
+
style="border:none; overflow:hidden; width:185px; height:21px;" ></iframe>
|
239
|
+
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="col ">
|
244
|
+
|
245
|
+
<h2><a href="/en/about-us">About us</a></h2>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<ul>
|
250
|
+
<li><a href="/en/about-us/Company"><span>Company</span></a></li>
|
251
|
+
<li><a href="/en/about-us/management"><span>Management </span></a></li>
|
252
|
+
<li><a href="/en/about-us/contact"><span>Contact</span></a></li>
|
253
|
+
</ul>
|
254
|
+
|
255
|
+
|
256
|
+
<h2><a href="/en/our-work">Products</a></h2>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<ul>
|
261
|
+
<li><a href="/en/our-work/games"><span>Games</span></a></li>
|
262
|
+
<li><a href="/en/our-work/animation"><span>Animation</span></a></li>
|
263
|
+
<li><a href="/en/our-work/books"><span>Books</span></a></li>
|
264
|
+
<li><a href="/en/our-work/learning"><span>Learning</span></a></li>
|
265
|
+
<li><a href="/en/our-work/attractions"><span>Attractions</span></a></li>
|
266
|
+
</ul>
|
267
|
+
|
268
|
+
</div>
|
269
|
+
<div class="col ">
|
270
|
+
|
271
|
+
<h2><a href="/en/news">News</a></h2>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
<ul>
|
276
|
+
<li><a href="/en/news/blog"><span>Blog</span></a></li>
|
277
|
+
<li><a href="/en/news/press-releases"><span>Press releases</span></a></li>
|
278
|
+
<li><a href="/en/news/press-kits"><span>Press Kits</span></a></li>
|
279
|
+
<li><a href="/en/news/newsletter-subscription"><span>Newsletter subscription</span></a></li>
|
280
|
+
</ul>
|
281
|
+
|
282
|
+
|
283
|
+
<h2><a href="/en/careers">Careers</a></h2>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<ul>
|
288
|
+
<li><a href="/en/careers/Open-positions"><span>Open positions</span></a></li>
|
289
|
+
<li><a href="/en/careers/open-application"><span>Apply now</span></a></li>
|
290
|
+
<li><a href="/en/careers/for-students"><span>For students</span></a></li>
|
291
|
+
<li><a href="/en/careers/Employee-stories"><span>Employee stories</span></a></li>
|
292
|
+
<li><a href="/en/careers/rovio-stockholm"><span>Rovio Stockholm</span></a></li>
|
293
|
+
</ul>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
<div class="col nomargin">
|
297
|
+
|
298
|
+
<h2><a href="/en/support">Support</a></h2>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
<h2><a href="/en/advertise">Advertise</a></h2>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
<h2><a href="/en/developers">Developers</a></h2>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
<ul>
|
315
|
+
<li><a href="/en/developers/about"><span>About</span></a></li>
|
316
|
+
<li><a href="/en/developers/apply"><span>Apply</span></a></li>
|
317
|
+
</ul>
|
318
|
+
|
319
|
+
</div>
|
320
|
+
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
<p class="footer02">© 2013 Rovio Entertainment Ltd. Angry Birds. <a href="/Privacy">Privacy Policy</a>. <a href="/eula">EULA</a>. <a href="http://www.rovio.com/en/news/blog/235/analytics-and-data-usage-in-rovio-games">Analytics & data usage</a>.</p>
|
325
|
+
</div>
|
326
|
+
</div>
|
327
|
+
</div>
|
328
|
+
</body>
|
329
|
+
</html>
|
@@ -17,6 +17,9 @@ module Treat::Entities::Entity::Buildable
|
|
17
17
|
EmailRegexp = /.+\@.+\..+/
|
18
18
|
Enclitics = %w['ll 'm 're 's 't 've 'nt]
|
19
19
|
|
20
|
+
# Accepted formats of serialized files
|
21
|
+
AcceptedFormats = ['.xml', '.yml', '.yaml', '.mongo']
|
22
|
+
|
20
23
|
# Reserved folder names
|
21
24
|
Reserved = ['.index']
|
22
25
|
|
@@ -24,7 +27,7 @@ module Treat::Entities::Entity::Buildable
|
|
24
27
|
# a string, numeric,folder, or file name
|
25
28
|
# representing a raw or serialized file).
|
26
29
|
def build(*args)
|
27
|
-
|
30
|
+
|
28
31
|
# This probably needs some doc.
|
29
32
|
if args.size == 0
|
30
33
|
file_or_value = ''
|
@@ -46,9 +49,7 @@ module Treat::Entities::Entity::Buildable
|
|
46
49
|
from_array(file_or_value)
|
47
50
|
elsif file_or_value.is_a?(Hash)
|
48
51
|
from_db(file_or_value)
|
49
|
-
elsif self == Treat::Entities::Document ||
|
50
|
-
(fv.index('.yml') || fv.index('.yaml') ||
|
51
|
-
fv.index('.xml'))
|
52
|
+
elsif self == Treat::Entities::Document || (is_serialized_file?(fv))
|
52
53
|
if fv =~ UriRegexp
|
53
54
|
from_url(fv)
|
54
55
|
else
|
@@ -94,7 +95,7 @@ module Treat::Entities::Entity::Buildable
|
|
94
95
|
end
|
95
96
|
e
|
96
97
|
end
|
97
|
-
|
98
|
+
|
98
99
|
# Build a document from an array
|
99
100
|
# of builders.
|
100
101
|
def from_array(array)
|
@@ -118,7 +119,7 @@ module Treat::Entities::Entity::Buildable
|
|
118
119
|
begin
|
119
120
|
folder = Treat.paths.files
|
120
121
|
if folder[-1] == '/'
|
121
|
-
folder = folder[0..-2]
|
122
|
+
folder = folder[0..-2]
|
122
123
|
end
|
123
124
|
f = Schiphol.download(url,
|
124
125
|
download_folder: folder,
|
@@ -178,15 +179,15 @@ module Treat::Entities::Entity::Buildable
|
|
178
179
|
|
179
180
|
c = Treat::Entities::Collection.new(folder)
|
180
181
|
folder += '/' unless folder[-1] == '/'
|
181
|
-
|
182
|
+
|
182
183
|
if !FileTest.directory?(folder)
|
183
184
|
FileUtils.mkdir(folder)
|
184
185
|
end
|
185
|
-
|
186
|
+
|
186
187
|
c.set :folder, folder
|
187
188
|
i = folder + '/.index'
|
188
189
|
c.set :index, i if FileTest.directory?(i)
|
189
|
-
|
190
|
+
|
190
191
|
Dir[folder + '*'].each do |f|
|
191
192
|
if FileTest.directory?(f)
|
192
193
|
c2 = Treat::Entities::Collection.
|
@@ -197,7 +198,7 @@ module Treat::Entities::Entity::Buildable
|
|
197
198
|
from_file(f), false)
|
198
199
|
end
|
199
200
|
end
|
200
|
-
|
201
|
+
|
201
202
|
return c
|
202
203
|
|
203
204
|
end
|
@@ -205,13 +206,10 @@ module Treat::Entities::Entity::Buildable
|
|
205
206
|
# Build a document from a raw or serialized file.
|
206
207
|
def from_file(file,def_fmt=nil)
|
207
208
|
|
208
|
-
if file
|
209
|
-
file.index('.yaml') ||
|
210
|
-
file.index('.xml')
|
209
|
+
if is_serialized_file?(file)
|
211
210
|
from_serialized_file(file)
|
212
211
|
else
|
213
|
-
fmt = Treat::Workers::Formatters::
|
214
|
-
Readers::Autoselect.detect_format(file,def_fmt)
|
212
|
+
fmt = Treat::Workers::Formatters::Readers::Autoselect.detect_format(file,def_fmt)
|
215
213
|
from_raw_file(file, fmt)
|
216
214
|
end
|
217
215
|
|
@@ -241,7 +239,7 @@ module Treat::Entities::Entity::Buildable
|
|
241
239
|
|
242
240
|
# Build an entity from a serialized file.
|
243
241
|
def from_serialized_file(file)
|
244
|
-
|
242
|
+
|
245
243
|
unless File.readable?(file)
|
246
244
|
raise Treat::Exception,
|
247
245
|
"Path '#{file}' does not "+
|
@@ -250,11 +248,11 @@ module Treat::Entities::Entity::Buildable
|
|
250
248
|
doc = Treat::Entities::Document.new
|
251
249
|
doc.set :file, file
|
252
250
|
format = nil
|
253
|
-
if
|
254
|
-
|
251
|
+
if File.extname(file) == '.yml' ||
|
252
|
+
File.extname(file) == '.yaml'
|
255
253
|
format = :yaml
|
256
|
-
elsif
|
257
|
-
|
254
|
+
elsif File.extname(file) == '.xml'
|
255
|
+
format = :xml
|
258
256
|
else
|
259
257
|
raise Treat::Exception,
|
260
258
|
"Unreadable serialized format for #{file}."
|
@@ -262,7 +260,10 @@ module Treat::Entities::Entity::Buildable
|
|
262
260
|
doc.unserialize(format)
|
263
261
|
doc.children[0].set_as_root! # Fix this
|
264
262
|
doc.children[0]
|
263
|
+
end
|
265
264
|
|
265
|
+
def is_serialized_file?(path_to_check)
|
266
|
+
(AcceptedFormats.include? File.extname(path_to_check)) && (File.file?(path_to_check))
|
266
267
|
end
|
267
268
|
|
268
269
|
def from_db(hash)
|
@@ -286,7 +287,7 @@ module Treat::Entities::Entity::Buildable
|
|
286
287
|
if folder[-1] == '/'
|
287
288
|
folder = folder[0..-2]
|
288
289
|
end
|
289
|
-
|
290
|
+
|
290
291
|
now = Time.now.to_f
|
291
292
|
doc_file = folder+ "/#{now}.txt"
|
292
293
|
string.force_encoding('UTF-8')
|
@@ -384,7 +385,7 @@ module Treat::Entities::Entity::Buildable
|
|
384
385
|
end
|
385
386
|
|
386
387
|
end
|
387
|
-
|
388
|
+
|
388
389
|
def create_collection(fv)
|
389
390
|
FileUtils.mkdir(fv)
|
390
391
|
Treat::Entities::Collection.new(fv)
|
@@ -58,16 +58,14 @@ module Treat::Entities::Entity::Stringable
|
|
58
58
|
end
|
59
59
|
|
60
60
|
# Helper method to implode the string value of the subtree.
|
61
|
-
def implode
|
61
|
+
def implode(value = "")
|
62
62
|
|
63
63
|
return @value.dup if !has_children?
|
64
64
|
|
65
|
-
value = ''
|
66
|
-
|
67
65
|
each do |child|
|
68
66
|
|
69
67
|
if child.is_a?(Treat::Entities::Section)
|
70
|
-
value
|
68
|
+
value << "\n\n"
|
71
69
|
end
|
72
70
|
|
73
71
|
if child.is_a?(Treat::Entities::Token) || child.value != ''
|
@@ -75,14 +73,14 @@ module Treat::Entities::Entity::Stringable
|
|
75
73
|
child.is_a?(Treat::Entities::Enclitic)
|
76
74
|
value.strip!
|
77
75
|
end
|
78
|
-
value
|
76
|
+
value << child.to_s + ' '
|
79
77
|
else
|
80
|
-
|
78
|
+
child.implode(value)
|
81
79
|
end
|
82
80
|
|
83
81
|
if child.is_a?(Treat::Entities::Title) ||
|
84
82
|
child.is_a?(Treat::Entities::Paragraph)
|
85
|
-
value
|
83
|
+
value << "\n\n"
|
86
84
|
end
|
87
85
|
|
88
86
|
end
|
data/lib/treat/version.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Language detection using a probabilistic algorithm
|
2
|
-
# that checks for the presence of words with Bloom
|
2
|
+
# that checks for the presence of words with Bloom
|
3
3
|
# filters built from dictionaries for each language.
|
4
4
|
#
|
5
|
-
# Original paper: Grothoff. 2007. A Quick Introduction to
|
6
|
-
# Bloom Filters. Department of Computer Sciences, Purdue
|
5
|
+
# Original paper: Grothoff. 2007. A Quick Introduction to
|
6
|
+
# Bloom Filters. Department of Computer Sciences, Purdue
|
7
7
|
# University.
|
8
8
|
class Treat::Workers::Extractors::Language::WhatLanguage
|
9
9
|
|
@@ -35,7 +35,7 @@ class Treat::Workers::Extractors::Language::WhatLanguage
|
|
35
35
|
|
36
36
|
options = DefaultOptions.merge(options)
|
37
37
|
|
38
|
-
@@detector ||= ::WhatLanguage.new(:
|
38
|
+
@@detector ||= ::WhatLanguage.new(:all)
|
39
39
|
possibilities = @@detector.process_text(entity.to_s)
|
40
40
|
lang = {}
|
41
41
|
|
@@ -2,17 +2,52 @@
|
|
2
2
|
# Ruby natural language date parser.
|
3
3
|
class Treat::Workers::Extractors::Time::Chronic
|
4
4
|
|
5
|
-
|
5
|
+
# Require the 'chronic' gem.
|
6
|
+
silence_warnings { require 'chronic' }
|
7
|
+
|
8
|
+
# Require the Ruby DateTime module
|
6
9
|
require 'date'
|
7
|
-
|
8
|
-
DefaultOptions = {guess: true}
|
9
10
|
|
10
11
|
# Return the date information contained within
|
11
12
|
# the entity by parsing it with the 'chronic' gem.
|
13
|
+
#
|
14
|
+
# Options: none.
|
12
15
|
def self.time(entity, options = {})
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
|
17
|
+
s = entity.to_s
|
18
|
+
return if s =~ /^[0-9]+$/
|
19
|
+
time = nil
|
20
|
+
|
21
|
+
silence_warnings do
|
22
|
+
time = ::Chronic.parse(s, {:guess => true})
|
23
|
+
end
|
24
|
+
|
25
|
+
if entity.has_parent? && remove_time_from_ancestors(entity, time)
|
26
|
+
nil
|
27
|
+
else
|
28
|
+
time
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
# Keeps the lowest-level time annotations that do
|
34
|
+
# not conflict with a higher time annotation.
|
35
|
+
# Returns true if the entity conflicts with a
|
36
|
+
# higher-level time annotation.
|
37
|
+
def self.remove_time_from_ancestors(entity, time)
|
38
|
+
|
39
|
+
entity.ancestors_with_type(:phrase).each do |a|
|
40
|
+
|
41
|
+
next if !a.has?(:time)
|
42
|
+
unless a.get(:time) == time
|
43
|
+
return true
|
44
|
+
end
|
45
|
+
a.unset(:time)
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
false
|
50
|
+
|
16
51
|
end
|
17
52
|
|
18
53
|
end
|
@@ -47,6 +47,7 @@ class Treat::Workers::Extractors::Time::Nickel
|
|
47
47
|
occ.interval : :none
|
48
48
|
time_recurrence_interval = interval
|
49
49
|
|
50
|
+
|
50
51
|
s = [occ.start_date, occ.start_time]
|
51
52
|
ds = [s[0].year, s[0].month, s[0].day] if s[0]
|
52
53
|
ts = [s[1].hour, s[1].minute, s[1].second] if s[1]
|
@@ -76,4 +77,18 @@ class Treat::Workers::Extractors::Time::Nickel
|
|
76
77
|
|
77
78
|
end
|
78
79
|
|
80
|
+
# Keeps the lowest-level time annotations that do
|
81
|
+
# not conflict with a higher time annotation.
|
82
|
+
# Returns true if the entity conflicts with a
|
83
|
+
# higher-level time annotation.
|
84
|
+
def self.remove_time_from_ancestors(entity, time)
|
85
|
+
entity.ancestors_with_type(:phrase).each do |a|
|
86
|
+
next if !a.has?(:time)
|
87
|
+
return false unless a.get(:time).to_s == time.to_s
|
88
|
+
a.unset(:time, :time_recurrence,
|
89
|
+
:time_recurrence_interval, :end_time)
|
90
|
+
end
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
79
94
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# DateTime.parse() method.
|
3
3
|
class Treat::Workers::Extractors::Time::Ruby
|
4
4
|
|
5
|
-
|
5
|
+
# Require Ruby's date module.
|
6
6
|
require 'date'
|
7
7
|
|
8
8
|
# Return a DateTime object representing the date/time
|
@@ -13,11 +13,42 @@ class Treat::Workers::Extractors::Time::Ruby
|
|
13
13
|
#
|
14
14
|
# Options: none.
|
15
15
|
def self.time(entity, options = {})
|
16
|
+
s = entity.to_s
|
17
|
+
return if s =~ /^[0-9]+$/
|
16
18
|
begin
|
17
|
-
DateTime.parse(
|
19
|
+
time = ::DateTime.parse(s)
|
20
|
+
if entity.has_parent? &&
|
21
|
+
remove_time_from_ancestors(entity, time)
|
22
|
+
nil
|
23
|
+
else
|
24
|
+
time
|
25
|
+
end
|
18
26
|
rescue
|
19
27
|
nil
|
20
28
|
end
|
21
29
|
end
|
22
30
|
|
31
|
+
|
32
|
+
# Keeps the lowest-level time annotations that do
|
33
|
+
# not conflict with a higher time annotation.
|
34
|
+
# Returns true if the entity conflicts with a
|
35
|
+
# higher-level time annotation.
|
36
|
+
def self.remove_time_from_ancestors(entity, time)
|
37
|
+
|
38
|
+
entity.ancestors_with_type(:phrase).each do |a|
|
39
|
+
|
40
|
+
next if !a.has?(:time)
|
41
|
+
|
42
|
+
unless a.get(:time) == time
|
43
|
+
return true
|
44
|
+
end
|
45
|
+
|
46
|
+
a.unset(:time)
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
false
|
51
|
+
|
52
|
+
end
|
53
|
+
|
23
54
|
end
|
@@ -60,8 +60,7 @@ class Treat::Workers::Lexicalizers::Sensers::Wordnet
|
|
60
60
|
|
61
61
|
lemma.synsets.each do |synset|
|
62
62
|
synsets <<
|
63
|
-
Treat::Workers::Lexicalizers::
|
64
|
-
Sensers::Wordnet::Synset.new(synset)
|
63
|
+
Treat::Workers::Lexicalizers::Sensers::Wordnet::Synset.new(synset)
|
65
64
|
end
|
66
65
|
|
67
66
|
((synsets.collect do |ss|
|
@@ -5,12 +5,10 @@ class Treat::Workers::Processors::Chunkers::Autoselect
|
|
5
5
|
entity.set :format, 'txt'
|
6
6
|
end
|
7
7
|
begin
|
8
|
-
k = Treat::Workers::Processors::
|
9
|
-
Chunkers.const_get(entity.format.cc)
|
8
|
+
k = Treat::Workers::Processors::Chunkers.const_get(entity.format.cc)
|
10
9
|
k.chunk(entity, options)
|
11
10
|
rescue Treat::Exception
|
12
|
-
Treat::Workers::Processors::
|
13
|
-
Chunkers::TXT.chunk(entity, options)
|
11
|
+
Treat::Workers::Processors::Chunkers::TXT.chunk(entity, options)
|
14
12
|
end
|
15
13
|
|
16
14
|
end
|
@@ -12,16 +12,13 @@ class Treat::Workers::Processors::Chunkers::TXT
|
|
12
12
|
zones.each do |zone|
|
13
13
|
zone.strip!
|
14
14
|
next if zone == ''
|
15
|
-
c = Treat::Entities::
|
16
|
-
Zone.from_string(zone)
|
15
|
+
c = Treat::Entities::Zone.from_string(zone)
|
17
16
|
if c.type == :title
|
18
17
|
if current.type == :section
|
19
18
|
current = current.parent
|
20
|
-
current = entity << Treat::
|
21
|
-
Entities::Section.new
|
19
|
+
current = entity << Treat::Entities::Section.new
|
22
20
|
else
|
23
|
-
current = entity << Treat::
|
24
|
-
Entities::Section.new
|
21
|
+
current = entity << Treat::Entities::Section.new
|
25
22
|
end
|
26
23
|
end
|
27
24
|
current << c
|
@@ -28,13 +28,10 @@ class Treat::Workers::Processors::Tokenizers::Punkt
|
|
28
28
|
|
29
29
|
s.scan(ReWordTokenizer).each do |token|
|
30
30
|
if SentEndChars.include?(token[-1])
|
31
|
-
entity << Treat::Entities::
|
32
|
-
Token.from_string(token[
|
33
|
-
entity << Treat::Entities::
|
34
|
-
Token.from_string(token[-1..-1])
|
31
|
+
entity << Treat::Entities::Token.from_string(token[0..-2])
|
32
|
+
entity << Treat::Entities::Token.from_string(token[-1..-1])
|
35
33
|
else
|
36
|
-
entity << Treat::Entities::
|
37
|
-
Token.from_string(token)
|
34
|
+
entity << Treat::Entities::Token.from_string(token)
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
data/spec/entities/collection.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Treat::Specs::Entities
|
2
|
-
|
2
|
+
|
3
3
|
describe Treat::Entities::Collection do
|
4
4
|
|
5
5
|
before :all do
|
@@ -17,7 +17,7 @@ module Treat::Specs::Entities
|
|
17
17
|
it "recursively searches the folder for " +
|
18
18
|
"files and opens them into a collection of documents" do
|
19
19
|
collection = Treat::Entities::Collection.build(@file)
|
20
|
-
collection.size.should eql 5
|
20
|
+
collection.children.size.should eql 5
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
@@ -64,7 +64,7 @@ end
|
|
64
64
|
end
|
65
65
|
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
describe "#search" do
|
69
69
|
|
70
70
|
it "searches an indexed collection for a query " +
|
@@ -77,7 +77,7 @@ end
|
|
77
77
|
|
78
78
|
docs = collection.search :ferret, :q => 'Newton'
|
79
79
|
docs.size.should eql 3
|
80
|
-
|
80
|
+
|
81
81
|
docs.map { |d| d.chunk.title.to_s }.should
|
82
82
|
eql [
|
83
83
|
"Isaac (Sir) Newton (1642-1727)",
|
@@ -107,6 +107,6 @@ end
|
|
107
107
|
end
|
108
108
|
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
end
|
112
112
|
=end
|
data/spec/entities/entity.rb
CHANGED
@@ -33,6 +33,24 @@ module Treat::Specs::Entities
|
|
33
33
|
@adj_phrase << @adj
|
34
34
|
@verb_phrase << [@aux, @verb]
|
35
35
|
|
36
|
+
@enc_phrase = Treat::Entities::Phrase.new
|
37
|
+
@enc_noun_phrase = Treat::Entities::Phrase.new
|
38
|
+
@enc_noun_phrase.set :tag, 'NP'
|
39
|
+
@enc_verb_phrase = Treat::Entities::Phrase.new
|
40
|
+
@enc_verb_phrase.set :tag, 'VP'
|
41
|
+
@enc_pronoun = Treat::Entities::Word.new('It')
|
42
|
+
@enc_pronoun.set :category, 'pronoun'
|
43
|
+
@enc_pronoun.set :tag, 'PRP'
|
44
|
+
@enc_enclitic = Treat::Entities::Enclitic.new('\'s')
|
45
|
+
@enc_enclitic.set :category, 'verb'
|
46
|
+
@enc_enclitic.set :tag, 'VBZ'
|
47
|
+
@enc_adj = Treat::Entities::Word.new('hot')
|
48
|
+
@enc_adj.set :category, 'adjectival'
|
49
|
+
@enc_adj.set :tag, 'ADJP'
|
50
|
+
|
51
|
+
@enc_noun_phrase << @enc_pronoun
|
52
|
+
@enc_verb_phrase << [ @enc_enclitic, @enc_adj ]
|
53
|
+
@enc_phrase << [ @enc_noun_phrase, @enc_verb_phrase ]
|
36
54
|
end
|
37
55
|
|
38
56
|
|
@@ -67,7 +85,7 @@ module Treat::Specs::Entities
|
|
67
85
|
end
|
68
86
|
|
69
87
|
=begin
|
70
|
-
|
88
|
+
|
71
89
|
describe "#frequency" do
|
72
90
|
|
73
91
|
it "returns the frequency of the entity's value in the root" do
|
@@ -82,9 +100,9 @@ module Treat::Specs::Entities
|
|
82
100
|
it "returns the position of the entity's value "+
|
83
101
|
"in the supplied parent type, or root if nil" do
|
84
102
|
@noun_phrase.frequency_in(:sentence).should eql 1
|
85
|
-
|
103
|
+
|
86
104
|
end
|
87
|
-
|
105
|
+
|
88
106
|
end
|
89
107
|
|
90
108
|
=end
|
@@ -100,8 +118,8 @@ module Treat::Specs::Entities
|
|
100
118
|
|
101
119
|
Treat::Entities::Entity.call_worker(
|
102
120
|
'$'.to_entity, :tag, :lingua,
|
103
|
-
Treat::Workers::Lexicalizers::Taggers, {}).
|
104
|
-
eql '$'.tag(:lingua)
|
121
|
+
Treat::Workers::Lexicalizers::Taggers, {}).
|
122
|
+
should eql '$'.tag(:lingua)
|
105
123
|
|
106
124
|
end
|
107
125
|
|
@@ -284,25 +302,29 @@ module Treat::Specs::Entities
|
|
284
302
|
describe "#to_s" do
|
285
303
|
it "returns the string value of the " +
|
286
304
|
"entity or its full subtree" do
|
287
|
-
@paragraph.to_s.
|
288
|
-
eql 'The lazy fox is running.'
|
305
|
+
@paragraph.to_s.
|
306
|
+
should eql 'The lazy fox is running.'
|
289
307
|
@noun.to_s.should eql 'fox'
|
308
|
+
@enc_phrase.to_s.
|
309
|
+
should eql 'It\'s hot'
|
290
310
|
end
|
291
311
|
end
|
292
312
|
|
293
313
|
describe "#inspect" do
|
294
314
|
it "returns an informative string " +
|
295
315
|
"concerning the entity" do
|
296
|
-
@paragraph.inspect.
|
297
|
-
be_an_instance_of String
|
316
|
+
@paragraph.inspect.
|
317
|
+
should be_an_instance_of String
|
298
318
|
end
|
299
319
|
end
|
300
320
|
|
301
321
|
describe "#short_value" do
|
302
322
|
it "returns a shortened version of the " +
|
303
323
|
"entity's string value" do
|
304
|
-
@paragraph.short_value.
|
305
|
-
eql 'The lazy fox is running.'
|
324
|
+
@paragraph.short_value.
|
325
|
+
should eql 'The lazy fox is running.'
|
326
|
+
@enc_phrase.short_value.
|
327
|
+
should eql 'It\'s hot'
|
306
328
|
end
|
307
329
|
end
|
308
330
|
|
@@ -406,14 +428,15 @@ module Treat::Specs::Entities
|
|
406
428
|
it "guesses the language of the entity" do
|
407
429
|
|
408
430
|
Treat.core.language.detect = true
|
409
|
-
a = 'I want to know God\'s thoughts; the rest are details.
|
410
|
-
b = 'El mundo de hoy no tiene sentido, asi que por que deberia pintar cuadros que lo tuvieran?
|
411
|
-
c = 'Un bon Allemand ne peut souffrir les Francais, mais il boit volontiers les vins de France.
|
412
|
-
d = 'Wir haben die Kunst, damit wir nicht an der Wahrheit zugrunde gehen.
|
431
|
+
a = 'I want to know God\'s thoughts; the rest are details.' # Albert Einstein
|
432
|
+
b = 'El mundo de hoy no tiene sentido, asi que por que deberia pintar cuadros que lo tuvieran?' # Pablo Picasso
|
433
|
+
c = 'Un bon Allemand ne peut souffrir les Francais, mais il boit volontiers les vins de France.' # Goethe
|
434
|
+
d = 'Wir haben die Kunst, damit wir nicht an der Wahrheit zugrunde gehen.' # Friedrich Nietzsche
|
435
|
+
|
413
436
|
a.language.should eql :english
|
414
|
-
|
415
|
-
|
416
|
-
|
437
|
+
b.language.should eql :spanish
|
438
|
+
c.language.should eql :french
|
439
|
+
d.language.should eql :german
|
417
440
|
|
418
441
|
# Reset default
|
419
442
|
Treat.core.language.detect = false
|
data/spec/sandbox.rb
CHANGED
@@ -18,13 +18,24 @@ Treat.core.verbosity.silence = false
|
|
18
18
|
|
19
19
|
include Treat::Core::DSL
|
20
20
|
|
21
|
+
sent = "This is an English sentence, prove it to me!"
|
22
|
+
sent.apply(:tokenize, :parse).print_tree
|
23
|
+
|
24
|
+
=begin
|
25
|
+
Treat.core.verbosity.debug = true
|
26
|
+
|
27
|
+
rovio_privacy = document 'http://www.rovio.com/privacy'
|
28
|
+
rovio_privacy.apply :chunk, :segment, :tokenize, :parse
|
29
|
+
=end
|
30
|
+
|
31
|
+
=begin
|
21
32
|
Treat.core.language.default = 'german'
|
22
33
|
Treat.core.verbosity.debug
|
23
34
|
|
24
35
|
s = sentence 'Der wilde Kerl lebte in einem gelben Haus.'
|
25
36
|
s.do(:tokenize, :tag => :stanford, :parse => :stanford)
|
26
37
|
s.print_tree
|
27
|
-
|
38
|
+
=end
|
28
39
|
=begin
|
29
40
|
Treat::Builder.new do
|
30
41
|
p = phrase "26 Feb"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: treat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: schiphol
|
@@ -289,6 +289,7 @@ files:
|
|
289
289
|
- files/21552208.html
|
290
290
|
- files/MANIFEST
|
291
291
|
- files/nethttp-cheat-sheet-2940.html
|
292
|
+
- files/privacy.html
|
292
293
|
- README.md
|
293
294
|
- LICENSE
|
294
295
|
homepage: https://github.com/louismullie/treat
|