treat 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -0
- data/lib/treat.rb +7 -9
- data/lib/treat/detectors.rb +3 -3
- data/lib/treat/detectors/encoding/r_chardet19.rb +10 -6
- data/lib/treat/extractors/topic_words/lda.rb +1 -1
- data/lib/treat/formatters/readers/abw.rb +7 -11
- data/lib/treat/formatters/readers/odt.rb +19 -9
- data/lib/treat/formatters/serializers/xml.rb +2 -2
- data/lib/treat/formatters/unserializers/xml.rb +18 -16
- data/lib/treat/kernel.rb +7 -3
- data/lib/treat/string.rb +5 -0
- data/lib/treat/sugar.rb +2 -0
- data/test/tc_detectors.rb +0 -1
- data/test/tc_entity.rb +1 -1
- data/test/tc_treat.rb +0 -1
- data/test/tests.rb +3 -3
- data/test/texts/english/half_cocked_basel.txt +16 -0
- data/test/texts/english/hose_and_dry.doc +0 -0
- data/test/texts/english/hungarys_troubles.abw +70 -0
- data/test/texts/english/republican_nomination.pdf +0 -0
- data/test/texts/english/saving_the_euro.odt +0 -0
- data/test/texts/english/zero_sum.html +111 -0
- metadata +49 -43
- data/lib/treat/detectors/encoding/native.rb +0 -17
data/LICENSE
CHANGED
@@ -18,6 +18,7 @@ Author: Louis-Antoine Mullie (louis.mullie@gmail.com). Copyright 2012.
|
|
18
18
|
Non-trivial amount of code has been incorporated and modified from
|
19
19
|
other libraries, specifically for the following files:
|
20
20
|
|
21
|
+
- formatters/readers/odt.rb - Mark Watson (GPL license)
|
21
22
|
- processors/tokenizers/macintyre.rb - Utiyama Masao (Ruby License)
|
22
23
|
- processors/tokenizers/tactful.rb - Matthew Bunday (GPL license)
|
23
24
|
- processors/tokenizers/perl.rb - Todd A. Fisher (MIT License)
|
data/lib/treat.rb
CHANGED
@@ -84,7 +84,7 @@ module Treat
|
|
84
84
|
end
|
85
85
|
|
86
86
|
# The current version of Treat.
|
87
|
-
VERSION = "0.1.
|
87
|
+
VERSION = "0.1.4"
|
88
88
|
|
89
89
|
# $LOAD_PATH << '/ruby/treat/lib/' # Remove for release
|
90
90
|
|
@@ -105,10 +105,8 @@ module Treat
|
|
105
105
|
attr_accessor :lib
|
106
106
|
# String - folder for tests.
|
107
107
|
attr_accessor :test
|
108
|
-
# String - folder for temp files.
|
109
|
-
attr_accessor :tmp
|
110
108
|
end
|
111
|
-
|
109
|
+
|
112
110
|
# Set the default language to english.
|
113
111
|
self.default_language = :eng
|
114
112
|
# Set the default encoding to utf-8.
|
@@ -119,15 +117,16 @@ module Treat
|
|
119
117
|
self.language_detection_level = :section
|
120
118
|
# Set the lib path to that of this file.
|
121
119
|
self.lib = File.dirname(__FILE__)
|
122
|
-
# Set the paths to the bin
|
120
|
+
# Set the paths to the bin folder.
|
123
121
|
self.bin = self.lib + '/../bin'
|
122
|
+
# Set the paths to the test folder.
|
124
123
|
self.test = self.lib + '/../test'
|
125
|
-
|
126
|
-
|
124
|
+
|
127
125
|
# Require modified core classes.
|
128
126
|
require 'treat/object'
|
129
127
|
require 'treat/kernel'
|
130
|
-
|
128
|
+
require 'treat/string'
|
129
|
+
|
131
130
|
# Require all files for the Treat library.
|
132
131
|
require 'treat/exception'
|
133
132
|
require 'treat/languages'
|
@@ -138,5 +137,4 @@ module Treat
|
|
138
137
|
|
139
138
|
# Make sugar available when needed.
|
140
139
|
extend Sugar
|
141
|
-
|
142
140
|
end
|
data/lib/treat/detectors.rb
CHANGED
@@ -9,14 +9,14 @@ module Treat
|
|
9
9
|
module Encoding
|
10
10
|
extend Group
|
11
11
|
self.type = :annotator
|
12
|
-
self.targets = [:
|
13
|
-
self.default = :
|
12
|
+
self.targets = [:document]
|
13
|
+
self.default = :r_chardet19
|
14
14
|
end
|
15
15
|
# Group for algorithms that support format detection.
|
16
16
|
module Format
|
17
17
|
extend Group
|
18
18
|
self.type = :annotator
|
19
|
-
self.targets = [:
|
19
|
+
self.targets = [:document]
|
20
20
|
self.default = :file
|
21
21
|
end
|
22
22
|
# Group for algorithms that do language detection.
|
@@ -6,16 +6,20 @@ module Treat
|
|
6
6
|
# A wrapper for the 'rchardet19' gem, which
|
7
7
|
# detects the encoding of a file.
|
8
8
|
class RChardet19
|
9
|
-
# Returns the encoding of the
|
9
|
+
# Returns the encoding of the document according
|
10
10
|
# to the 'rchardet19' gem.
|
11
11
|
#
|
12
12
|
# Options: none.
|
13
|
-
def self.encoding(
|
14
|
-
r = CharDet.detect(
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
def self.encoding(document, options={})
|
14
|
+
r = CharDet.detect(document.file)
|
15
|
+
if r.encoding
|
16
|
+
Treat::Feature.new({
|
17
|
+
r.encoding.
|
18
|
+
gsub('-', '_').downcase.intern =>
|
18
19
|
r.confidence}).best
|
20
|
+
else
|
21
|
+
:unknown
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|
@@ -38,7 +38,7 @@ module Treat
|
|
38
38
|
options = DefaultOptions.merge(options)
|
39
39
|
# Create a corpus with the collection
|
40
40
|
sections = collection.sections.collect do |t|
|
41
|
-
t.to_s.
|
41
|
+
t.to_s.encode_compliant('UTF-8') # fix
|
42
42
|
end
|
43
43
|
corpus = Lda::TextCorpus.new(sections)
|
44
44
|
|
@@ -5,9 +5,9 @@ module Treat
|
|
5
5
|
require 'rexml/document'
|
6
6
|
require 'rexml/streamlistener'
|
7
7
|
def self.read(document, options = {})
|
8
|
-
xml_h = AbiWordXmlHandler.new
|
9
|
-
REXML::Document.parse_stream(
|
10
|
-
document << xml_h.plain_text
|
8
|
+
xml_h = AbiWordXmlHandler.new
|
9
|
+
REXML::Document.parse_stream(IO.read(document.file), xml_h)
|
10
|
+
document << Treat::Entities::Entity.from_string(xml_h.plain_text)
|
11
11
|
document
|
12
12
|
end
|
13
13
|
class AbiWordXmlHandler
|
@@ -16,14 +16,10 @@ module Treat
|
|
16
16
|
def initialize
|
17
17
|
@plain_text = ""
|
18
18
|
end
|
19
|
-
def text
|
20
|
-
|
21
|
-
s
|
22
|
-
|
23
|
-
@plain_text << s
|
24
|
-
@plain_text << "\n"
|
25
|
-
end
|
26
|
-
end if s != 'AbiWord' && s != 'application/x-abiword'
|
19
|
+
def text(s)
|
20
|
+
if s != 'AbiWord' && s != 'application/x-abiword'
|
21
|
+
@plain_text << s if s.strip.length > 0
|
22
|
+
end
|
27
23
|
end
|
28
24
|
end
|
29
25
|
end
|
@@ -1,18 +1,27 @@
|
|
1
1
|
module Treat
|
2
2
|
module Formatters
|
3
3
|
module Readers
|
4
|
+
# A reader for the ODT (Open Office) document format.
|
5
|
+
#
|
6
|
+
# Based on work by Mark Watson, licensed under the GPL.
|
7
|
+
# Original project website: http://www.markwatson.com/opensource/
|
4
8
|
class Odt
|
5
|
-
#
|
9
|
+
# Require the 'zip' gem to unarchive the ODT files
|
10
|
+
silence_warnings { require 'zip' }
|
11
|
+
# Build an entity from an ODT file.
|
6
12
|
def self.read(document, options = {})
|
7
|
-
f =
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
f = nil
|
14
|
+
Zip::ZipFile.open(document.file, Zip::ZipFile::CREATE) do |zipfile|
|
15
|
+
f = zipfile.read('content.xml')
|
16
|
+
end
|
17
|
+
raise "Couldn't unzip dot file #{document.file}!" unless f
|
18
|
+
xml_h = OOXmlHandler.new
|
19
|
+
REXML::Document.parse_stream(f, xml_h)
|
20
|
+
puts xml_h.plain_text
|
21
|
+
document << Treat::Entities::Entity.from_string(xml_h.plain_text)
|
13
22
|
document
|
14
23
|
end
|
15
|
-
|
24
|
+
# Xml listener for the parsing of the ODT file.
|
16
25
|
class OOXmlHandler
|
17
26
|
require 'rexml/document'
|
18
27
|
require 'rexml/streamlistener'
|
@@ -20,6 +29,7 @@ module Treat
|
|
20
29
|
attr_reader :plain_text
|
21
30
|
def initialize
|
22
31
|
@plain_text = ""
|
32
|
+
@last_name = ""
|
23
33
|
end
|
24
34
|
def tag_start(name, attrs)
|
25
35
|
@last_name = name
|
@@ -35,7 +45,7 @@ module Treat
|
|
35
45
|
end
|
36
46
|
end
|
37
47
|
end
|
38
|
-
|
48
|
+
|
39
49
|
end
|
40
50
|
end
|
41
51
|
end
|
@@ -9,8 +9,8 @@ module Treat
|
|
9
9
|
def self.serialize(entity, options = {})
|
10
10
|
options = {:indent => 0} if options[:indent].nil?
|
11
11
|
if options[:indent] == 0
|
12
|
-
enc = entity.encoding(:r_chardet19).to_s.gsub('_', '-').upcase
|
13
|
-
string = "<?xml version=\"1.0\" encoding=\"
|
12
|
+
# enc = entity.encoding(:r_chardet19).to_s.gsub('_', '-').upcase
|
13
|
+
string = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\" ?>" # Fix
|
14
14
|
else
|
15
15
|
string = ''
|
16
16
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Treat
|
2
2
|
module Formatters
|
3
3
|
module Unserializers
|
4
|
-
# Recreates the entity tree corresponding to
|
4
|
+
# Recreates the entity tree corresponding to
|
5
5
|
# a serialized XML file.
|
6
6
|
class XML
|
7
7
|
require 'nokogiri'
|
8
8
|
# Unserialize an entity stored in XML format.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# Options: none.
|
11
11
|
def self.unserialize(document, options = {})
|
12
12
|
# Read in the XML file.
|
@@ -14,7 +14,7 @@ module Treat
|
|
14
14
|
xml_reader = Nokogiri::XML::Reader.from_memory(xml)
|
15
15
|
current_element = nil
|
16
16
|
previous_depth = 0
|
17
|
-
|
17
|
+
|
18
18
|
# Read the XML file entity by entity.
|
19
19
|
while xml_reader.read
|
20
20
|
# The depth in the XML tree.
|
@@ -31,18 +31,20 @@ module Treat
|
|
31
31
|
previous_depth = current_depth
|
32
32
|
next
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
id = nil; value = ''
|
36
36
|
attributes = {}; edges = {}
|
37
|
-
xml_reader.attributes.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
37
|
+
unless xml_reader.attributes.empty?
|
38
|
+
xml_reader.attributes.each_pair do |k,v|
|
39
|
+
if k == 'id'
|
40
|
+
id = v
|
41
|
+
elsif k == 'edges'
|
42
|
+
edges = v
|
43
|
+
elsif k == 'value'
|
44
|
+
value = v
|
45
|
+
else
|
46
|
+
attributes[k.intern] = v
|
47
|
+
end
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
@@ -66,18 +68,18 @@ module Treat
|
|
66
68
|
current_element.register_token(current_element)
|
67
69
|
end
|
68
70
|
end
|
69
|
-
|
71
|
+
|
70
72
|
previous_depth = current_depth
|
71
73
|
end
|
72
74
|
document << current_element
|
73
75
|
document
|
74
76
|
end
|
75
|
-
|
77
|
+
|
76
78
|
def self.revive(type, value, id)
|
77
79
|
klass = Treat::Entities.const_get(cc(type))
|
78
80
|
klass.new(value, id)
|
79
81
|
end
|
80
|
-
|
82
|
+
|
81
83
|
end
|
82
84
|
end
|
83
85
|
end
|
data/lib/treat/kernel.rb
CHANGED
@@ -32,9 +32,13 @@ module Kernel
|
|
32
32
|
# Create a temporary file which is deleted
|
33
33
|
# after execution of the block.
|
34
34
|
def create_temp_file(ext, value = nil, &block)
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
fname = "../tmp/#{Random.rand(10000000).to_s}.#{ext}"
|
36
|
+
File.open(fname, 'w') do |f|
|
37
|
+
f.write(value) if value
|
38
|
+
block.call(f.path)
|
39
|
+
end
|
40
|
+
ensure
|
41
|
+
File.delete(fname)
|
38
42
|
end
|
39
43
|
# Convert un_camel_case to CamelCase.
|
40
44
|
def camel_case(o_phrase)
|
data/lib/treat/string.rb
ADDED
data/lib/treat/sugar.rb
CHANGED
@@ -18,6 +18,7 @@ module Treat
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
|
+
alias :sweeten :edulcorate
|
21
22
|
# Uninstalls syntactic sugar.
|
22
23
|
def unedulcorate
|
23
24
|
return unless @@edulcorated
|
@@ -30,6 +31,7 @@ module Treat
|
|
30
31
|
end
|
31
32
|
end
|
32
33
|
end
|
34
|
+
alias :unsweeten :unedulcorate
|
33
35
|
# Boolean - whether syntactic sugar is
|
34
36
|
# enabled or not.
|
35
37
|
def edulcorated?; @@edulcorated; end
|
data/test/tc_detectors.rb
CHANGED
data/test/tc_entity.rb
CHANGED
data/test/tc_treat.rb
CHANGED
data/test/tests.rb
CHANGED
@@ -2,13 +2,13 @@ require 'test/unit'
|
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
4
4
|
|
5
|
-
# $LOAD_PATH << '/ruby/treat/test'
|
6
|
-
|
7
5
|
require 'treat'
|
8
|
-
require 'texts'
|
9
6
|
|
7
|
+
# $LOAD_PATH << '/ruby/treat/test' # Remove for release
|
10
8
|
# Treat.bin = '/ruby/nat/bin' # Remove for release
|
11
9
|
|
10
|
+
require 'texts'
|
11
|
+
|
12
12
|
require 'tc_treat'
|
13
13
|
require 'tc_tree'
|
14
14
|
require 'tc_entity'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Half-cocked Basel
|
2
|
+
Stop-gap rules on banks’ trading books may add perilous complexity
|
3
|
+
|
4
|
+
THE NEW-YEAR hangover throbbed agonisingly for investment bankers this year. Blame Basel 2.5, a new set of international rules which charges banks higher capital for the risks they run in their trading books (as opposed to their banking books, where they keep assets that they intend to hold to maturity). Those charges were too low before. And heaping higher costs on banks should please politicians and Joe Public. But they add another layer of complexity to banks’ risk management.
|
5
|
+
|
6
|
+
Basel 2.5 came into force on December 31st in most European and major world financial jurisdictions. Switzerland applied the rules a year early, and the costs are substantial. Third-quarter figures for Credit Suisse show a 28% increase in risk-weighted assets, and hence capital charges, for its investment-banking activities purely because of Basel 2.5.
|
7
|
+
|
8
|
+
The most notable laggard is America. US financial regulators do not oppose Basel 2.5, but it clashes with the Dodd-Frank act, America’s big wet blanket of a financial reform. Basel 2.5 uses credit ratings from recognised agencies such as Moody’s and Standard & Poor’s to calibrate capital charges. Dodd-Frank expressly forbids the use of such ratings agencies, whose poor judgments are held partly responsible for the crisis. Instead American regulators are working on their own cocktail of credit-risk calibrations for Basel 2.5, using market data and country-risk ratings from the OECD. Their solution is still months away from application (though not as distant as implementation by the Russians or Argentines).
|
9
|
+
|
10
|
+
Basel 2.5 for the first time charges banks extra capital for the credit risk of what they hold in their trading portfolio (because the crisis showed that markets are not always liquid enough to be able to offload assets). That includes a charge for the risk that a counterparty goes bust. It also imposes heavy charges on securitised bundles of assets unless the credit risk of each piece of the bundle has an identifiable market price. Banks that have portfolios of trading positions which they reckon offset each other have to convince regulators that their risk models work or face being charged at a cruder, standardised rate.
|
11
|
+
|
12
|
+
The problem with Basel 2.5, recognised by regulators and bankers alike, is its complexity. The risk of a trading portfolio must now be broken down into five “buckets”—value at risk (VaR), a measure of how much could be lost in an average trading day; stressed VaR (how much could be lost in extreme conditions); plus three types of credit risk ranging from the risk of single credits to those of securitised loans. Traders are understandably confused. For some banks, developing risk models and getting them approved is just too expensive: more complex businesses will be shut down. That will please those who want banks to be more boring.
|
13
|
+
|
14
|
+
But unintended consequences will doubtless follow. Useful products may become less tradable. Trading of riskier products could migrate to unregulated entities. Banks may be tempted into new forms of regulatory arbitrage, by juggling assets between their trading book and their banking book. Worst of all, perhaps, is the increased risk of back-office bungling because of the extra complexity.
|
15
|
+
|
16
|
+
Regulators recognise this risk. The Basel Committee on Banking Supervision, which drew up the rules and is also responsible for the full Basel 3 regime that will come into force in 2019, is still conducting what it calls a “fundamental review” of capital rules for banks’ trading books. Publication is not expected before March. Those sore heads will not soon clear.
|
Binary file
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE abiword PUBLIC "-//ABISOURCE//DTD AWML 1.0 Strict//EN" "http://www.abisource.com/awml.dtd">
|
3
|
+
<abiword template="false" styles="unlocked" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:math="http://www.w3.org/1998/Math/MathML" xid-max="47" xmlns:dc="http://purl.org/dc/elements/1.1/" fileformat="1.0" xmlns:svg="http://www.w3.org/2000/svg" xmlns:awml="http://www.abisource.com/awml.dtd" xmlns="http://www.abisource.com/awml.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" version="0.99.2" xml:space="preserve" props="dom-dir:ltr; document-footnote-restart-section:0; document-endnote-type:numeric; document-endnote-place-enddoc:1; document-endnote-initial:1; lang:en-US; document-endnote-restart-section:0; document-footnote-restart-page:0; document-footnote-type:numeric; document-footnote-initial:1; document-endnote-place-endsection:0">
|
4
|
+
<!-- ======================================================================== -->
|
5
|
+
<!-- This file is an AbiWord document. -->
|
6
|
+
<!-- AbiWord is a free, Open Source word processor. -->
|
7
|
+
<!-- More information about AbiWord is available at http://www.abisource.com/ -->
|
8
|
+
<!-- You should not edit this file by hand. -->
|
9
|
+
<!-- ======================================================================== -->
|
10
|
+
|
11
|
+
<metadata>
|
12
|
+
<m key="dc.format">application/x-abiword</m>
|
13
|
+
<m key="abiword.generator">AbiWord</m>
|
14
|
+
</metadata>
|
15
|
+
<history version="1" edit-time="49" last-saved="1327547309" uid="e83e3112-47ca-11e1-8326-faa5dd588a80">
|
16
|
+
<version id="1" started="1327547309" uid="0575e6ee-47cb-11e1-8326-faa5dd588a80" auto="0" top-xid="47"/>
|
17
|
+
</history>
|
18
|
+
<styles>
|
19
|
+
<s type="P" name="Normal" followedby="Current Settings" props="font-family:Times New Roman; margin-top:0pt; color:000000; margin-left:0pt; text-position:normal; widows:2; font-style:normal; text-indent:0in; font-variant:normal; margin-right:0pt; lang:en-US; line-height:1.0; font-size:12pt; text-decoration:none; margin-bottom:0pt; font-weight:normal; bgcolor:transparent; text-align:left; font-stretch:normal"/>
|
20
|
+
</styles>
|
21
|
+
<pagesize pagetype="Letter" orientation="portrait" width="8.500000" height="11.000000" units="in" page-scale="1.000000"/>
|
22
|
+
<section xid="46" props="page-margin-footer:0.5in; page-margin-header:0.5in">
|
23
|
+
<p style="Normal" xid="47" props="text-align:left; dom-dir:ltr">Hungary's troubles</p>
|
24
|
+
<p style="Normal" xid="1" props="text-align:left; dom-dir:ltr">Not just a rap on the knuckles</p>
|
25
|
+
<p style="Normal" xid="2" props="text-align:left; dom-dir:ltr"></p>
|
26
|
+
<p style="Normal" xid="3" props="text-align:left; dom-dir:ltr">THE pressure is piling up on the beleaguered Hungarian government. Today the European Commission threatened it with legal action over several new "cardinal" laws that would require a two-thirds majority in parliament to overturn.</p>
|
27
|
+
<p style="Normal" xid="4" props="text-align:left; dom-dir:ltr"></p>
|
28
|
+
<p style="Normal" xid="5" props="text-align:left; dom-dir:ltr">The commission is still considering the laws, but today it highlighted concerns over three issues:</p>
|
29
|
+
<p style="Normal" xid="6" props="text-align:left; dom-dir:ltr"></p>
|
30
|
+
<p style="Normal" xid="7" props="text-align:left; dom-dir:ltr"> - The independence of the central bank. Late last year the Hungarian parliament passed a law which expands the monetary council and takes the power to nominate deputies away from the governor and hands it to the prime minister. A separate law opens the door to a merger between the bank and the financial regulator.</p>
|
31
|
+
<p style="Normal" xid="8" props="text-align:left; dom-dir:ltr"></p>
|
32
|
+
<p style="Normal" xid="9" props="text-align:left; dom-dir:ltr"> - The judiciary. More than 200 judges over the age of 62 have been forced into retirement and hundreds more face the sack. The new National Judicial Authority is headed by Tünde Handó, a friend of the family of Viktor Orban, the prime minister.</p>
|
33
|
+
<p style="Normal" xid="10" props="text-align:left; dom-dir:ltr"></p>
|
34
|
+
<p style="Normal" xid="11" props="text-align:left; dom-dir:ltr"> - The independence of the national data authority.</p>
|
35
|
+
<p style="Normal" xid="12" props="text-align:left; dom-dir:ltr"></p>
|
36
|
+
<p style="Normal" xid="13" props="text-align:left; dom-dir:ltr">That wasn't all the commission had to say today. Hungary also received a ticking-off from Olli Rehn (pictured), the economic-affairs commissioner, for not doing enough to tackle its budget deficit. It may now lose access to EU funds.</p>
|
37
|
+
<p style="Normal" xid="14" props="text-align:left; dom-dir:ltr"></p>
|
38
|
+
<p style="Normal" xid="15" props="text-align:left; dom-dir:ltr">Slammed in Brussels, the Hungarian government is also under pressure at home. Earlier this week Gordon Bajnai, who served as Socialist prime minister from 2009-10, fired off a broadside that sent shockwaves through the political and media establishments.</p>
|
39
|
+
<p style="Normal" xid="16" props="text-align:left; dom-dir:ltr"></p>
|
40
|
+
<p style="Normal" xid="17" props="text-align:left; dom-dir:ltr">After a year and a half of government by the right-wing Fidesz party, wrote Mr Bajnai in a lengthy article on the website of the Patriotism and Progress Public Policy Foundation, democracy has been destroyed in Hungary. The country, he warned, is scarred by division and is drifting towards bankruptcy and away from Europe.</p>
|
41
|
+
<p style="Normal" xid="18" props="text-align:left; dom-dir:ltr"></p>
|
42
|
+
<p style="Normal" xid="19" props="text-align:left; dom-dir:ltr">Mr Bajnai called for a radical change of government and a complete political re-orientation. “A new government must have a programme readily at hand that can be applied without delay: a programme that promotes the republic, reconciliation, and recovery.” </p>
|
43
|
+
<p style="Normal" xid="20" props="text-align:left; dom-dir:ltr"></p>
|
44
|
+
<p style="Normal" xid="21" props="text-align:left; dom-dir:ltr">Fidesz is rattled by Mr Bajnai, who since leaving office has been teaching at Columbia University in New York. Understandably so. He headed a technocratic administration which stabilised the economy. Unlike his Socialist predecessor, Ferenc Gyurcsany, he was neither part of the old Communist elite nor connected to it by marriage, and so cannot be smeared as a "Komcsi". He is modern in outlook and well regarded internationally.</p>
|
45
|
+
<p style="Normal" xid="22" props="text-align:left; dom-dir:ltr"></p>
|
46
|
+
<p style="Normal" xid="23" props="text-align:left; dom-dir:ltr">Moreover, say those how know him, Mr Bajnai has little patience for the narcissistic exceptionalism that shapes Fidesz’s worldview. Exhibit A: the plaintive cry of Janos Martonyi, the foreign minister, who lamented recently: “The world will never understand our pains and spiritual wounds.” Such self-pity is unlikely to endear the Hungarian government to Brussels or Washington DC (to where it has sent an envoy this week to negotiate with the IMF).</p>
|
47
|
+
<p style="Normal" xid="24" props="text-align:left; dom-dir:ltr"></p>
|
48
|
+
<p style="Normal" xid="25" props="text-align:left; dom-dir:ltr">Fidesz won a two-thirds majority in 2010. But its support is evaporating, and analysts say there is a gap in the political market for a centrist pro-business party committed to democratic norms. Mr Bajnai, who has not ruled out a return to politics, would be an obvious candidate to lead it.</p>
|
49
|
+
<p style="Normal" xid="26" props="text-align:left; dom-dir:ltr"></p>
|
50
|
+
<p style="Normal" xid="27" props="text-align:left; dom-dir:ltr">Meanwhile, as Hungarians watch the value of their assets vaporise, in large part thanks to the government’s increasingly erratic policies, Mr Orban smirks his way through press conferences. Here he is dodging questions from a reporter from HVG, an economics weekly, about his responsibility for the crisis and trying to shift the blame to his old enemy Andras Simor, president of the central bank. The interview ran as follows:</p>
|
51
|
+
<p style="Normal" xid="28" props="text-align:left; dom-dir:ltr"></p>
|
52
|
+
<p style="Normal" xid="29" props="text-align:left; dom-dir:ltr">hvg.hu: Do you feel responsible for the falling/weakening forint?</p>
|
53
|
+
<p style="Normal" xid="30" props="text-align:left; dom-dir:ltr"></p>
|
54
|
+
<p style="Normal" xid="31" props="text-align:left; dom-dir:ltr">Mr Orban: You mean the president of the central bank? He did not comment on it.</p>
|
55
|
+
<p style="Normal" xid="32" props="text-align:left; dom-dir:ltr"></p>
|
56
|
+
<p style="Normal" xid="33" props="text-align:left; dom-dir:ltr">hvg.hu: No, you, Mr prime minister!</p>
|
57
|
+
<p style="Normal" xid="34" props="text-align:left; dom-dir:ltr"></p>
|
58
|
+
<p style="Normal" xid="35" props="text-align:left; dom-dir:ltr">Mr Orban: The personal responsibility of the president of the central bank was not discussed over the meeting.</p>
|
59
|
+
<p style="Normal" xid="36" props="text-align:left; dom-dir:ltr"></p>
|
60
|
+
<p style="Normal" xid="37" props="text-align:left; dom-dir:ltr">hvg.hu: You, your personal…!</p>
|
61
|
+
<p style="Normal" xid="38" props="text-align:left; dom-dir:ltr"></p>
|
62
|
+
<p style="Normal" xid="39" props="text-align:left; dom-dir:ltr">Mr Orban: That neither.</p>
|
63
|
+
<p style="Normal" xid="40" props="text-align:left; dom-dir:ltr"></p>
|
64
|
+
<p style="Normal" xid="41" props="text-align:left; dom-dir:ltr">Surrounded by yes-men and grinning flunkies, Mr Orban seems increasingly out of touch. His future will likely be decided not in the gilded corridors of the Hungarian parliament, but in Brussels and Washington DC.</p>
|
65
|
+
<p style="Normal" xid="42" props="text-align:left; dom-dir:ltr"></p>
|
66
|
+
<p style="Normal" xid="43" props="text-align:left; dom-dir:ltr">What happens next? If his hand is forced Mr Orban can probably endure policy reversals on the independence of the central bank and the data ombudsman. Sorry, he would say to his loyal followers: national crisis, what can you do.</p>
|
67
|
+
<p style="Normal" xid="44" props="text-align:left; dom-dir:ltr"></p>
|
68
|
+
<p style="Normal" xid="45" props="text-align:left; dom-dir:ltr">The dismantling of the judiciary would be another matter. If outsiders keep up the pressure and the judicial changes are judged to be in breach of the EU treaty, Mr Orban would be in a tricky spot. It’s hard to see how he could declare the 200-plus judges his government has forced into retirement ready for office after all, and still sit in his own.</p>
|
69
|
+
</section>
|
70
|
+
</abiword>
|
Binary file
|
Binary file
|
@@ -0,0 +1,111 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class="no-flash" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" xmlns:fb="http://www.facebook.com/2008/fbml">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<title>Trade: The zero-sum president | The Economist</title>
|
6
|
+
</head>
|
7
|
+
|
8
|
+
<body class="not-front not-logged-in page-node node-type-mtblog one-sidebar sidebar-right world-menu business-menu economics-menu printedition-menu science-technology-menu culture-menu">
|
9
|
+
<div id="fb-root"></div>
|
10
|
+
<div id="page" class="container">
|
11
|
+
<a name="top" id="navigation-top"></a>
|
12
|
+
|
13
|
+
<div id="leaderboard" class="clearfix">
|
14
|
+
<div id="block-ec_ads-leaderboard_ad" class="block block-ec_ads">
|
15
|
+
<div class="content clearfix">
|
16
|
+
<div id="leaderboard-ad"><!-- Site: Commerce. Zone: Opinion | Blogs/Free Exchange | --> <script language="JavaScript" type="text/javascript">document.write('<script language="JavaScript" src="//ad.doubleclick.net/adj/teg.lasn/blo6;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90;tile=1;ord=' + random_ad_nr + '?" type="text/javascript"><\/script>')</script><noscript><a href="//ad.doubleclick.net/jump/teg.lasn/blo6;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90;tile=1;ord=595534706?"><img src="//ad.doubleclick.net/ad/teg.lasn/blo6;subs=n;wsub=n;sdn=n;dcopt=ist;pos=ldr_top;sz=728x90;tile=1;ord=595534706?" width="728" height="90" border="0" alt=""></a></noscript></div> </div>
|
17
|
+
</div><div id="block-ec_ads-subscription_ad" class="block block-ec_ads">
|
18
|
+
<div class="content clearfix">
|
19
|
+
<div id="subslug-ad"><!-- Site: Commerce. Zone: Opinion | Blogs/Free Exchange | --> <script language="JavaScript" type="text/javascript">document.write('<a href="//ad.doubleclick.net/jump/teg.lasn/blo6;subs=n;wsub=n;sdn=n;pos=sub_top;sz=223x90;tile=2;ord=' + random_ad_nr + '?" target="_self"><img src="//ad.doubleclick.net/ad/teg.lasn/blo6;subs=n;wsub=n;sdn=n;pos=sub_top;sz=223x90;tile=2;ord=' + random_ad_nr + '?"><\/a>')</script><noscript><a href="//ad.doubleclick.net/jump/teg.lasn/blo6;subs=n;wsub=n;sdn=n;pos=sub_top;sz=223x90;tile=2;ord=595534706?"><img src="//ad.doubleclick.net/ad/teg.lasn/blo6;subs=n;wsub=n;sdn=n;pos=sub_top;sz=223x90;tile=2;ord=595534706?" width="223" height="90" border="0" alt=""></a></noscript></div> </div>
|
20
|
+
</div> </div>
|
21
|
+
|
22
|
+
|
23
|
+
<div id="header" class="clearfix">
|
24
|
+
|
25
|
+
<div id="header-topstripe" class="clearfix">
|
26
|
+
<div id="header-logo">
|
27
|
+
<h2><a href="/"><img src="//media.economist.com/sites/all/themes/econfinal/images/the-economist-logo.gif" alt="The Economist" /></a></h2>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div id="header-main">
|
31
|
+
|
32
|
+
<div id="header-links" class="clearfix">
|
33
|
+
<div id="header-links-user">
|
34
|
+
<div id="header-login">
|
35
|
+
<div class="item-list"><ul><li class="first"><a href="/user/login?destination=node%2F21543439" class="show-login" data-ec-omniture="masthead|act_prod|login">Log in</a></li>
|
36
|
+
<li class="even"><a href="/user/register?destination=node%2F21543439&rp=masthead" data-ec-omniture="masthead|act_prod|register">Register</a></li>
|
37
|
+
<li><a href="/user" data-ec-omniture="masthead|act_prod|my_account">My account</a></li>
|
38
|
+
<li class="even last"><a href="/products/subscribe" data-ec-omniture="masthead|act_prod|subscribe">Subscribe</a></li>
|
39
|
+
</ul></div></div> <!-- /#header-login -->
|
40
|
+
</div><!-- /#header-links-user -->
|
41
|
+
|
42
|
+
<div id="header-links-general">
|
43
|
+
<ul>
|
44
|
+
<li><a data-ec-omniture="masthead|act_prod|digital_mobile" href="/digital" title="Digital & mobile">Digital & mobile</a></li>
|
45
|
+
<li class="pipe"><a data-ec-omniture="masthead|act_prod|events" href="/events" title="Events">Events</a></li>
|
46
|
+
<li class="pipe"><a data-ec-omniture="masthead|act_prod|newsletters" href="/newsletters" title="Newsletters">Newsletters</a></li>
|
47
|
+
<li class="pipe"><a data-ec-omniture="masthead|act_prod|rss" class="rss-link" href="/rss" title="RSS">RSS</a></li>
|
48
|
+
<li class="pipe"><a data-ec-omniture="masthead|act_prod|jobs" href="http://jobs.economist.com" title="Jobs">Jobs</a></li>
|
49
|
+
<li class="pipe last"><a data-ec-omniture="masthead|act_prod|help" href="/help" title="Help">Help</a></li>
|
50
|
+
</ul>
|
51
|
+
</div><!-- /#header-links-general -->
|
52
|
+
</div><!-- /#header-links -->
|
53
|
+
|
54
|
+
<div id="header-timestamp" class="clearfix">
|
55
|
+
Wednesday January 25th 2012 </div><!-- /#header-timestamp -->
|
56
|
+
|
57
|
+
<div id="header-title-search" class="clearfix">
|
58
|
+
|
59
|
+
|
60
|
+
<div id="header-search" class="clearfix">
|
61
|
+
<form action="/blogs/freeexchange/2012/01/trade" accept-charset="UTF-8" method="post" id="search-theme-form">
|
62
|
+
<div><div id="search" class="container-inline">
|
63
|
+
<div class="form-item clearfix" id="edit-search-theme-form-1-wrapper">
|
64
|
+
<label for="edit-search-theme-form-1">Search this site:</label>
|
65
|
+
<input type="text" maxlength="128" name="search_theme_form" id="edit-search-theme-form-1" size="15" value="" title="Enter the terms you wish to search for." class="form-text search-field" placeholder="Search" />
|
66
|
+
</div>
|
67
|
+
<input type="submit" name="op" id="edit-submit-1" value="Search" class="form-submit" />
|
68
|
+
<input type="hidden" name="form_build_id" id="form-95221799fc500ba9ac651bab969c1a14" value="form-95221799fc500ba9ac651bab969c1a14" />
|
69
|
+
<input type="hidden" name="form_id" id="edit-search-theme-form" value="search_theme_form" />
|
70
|
+
</div>
|
71
|
+
|
72
|
+
</div></form>
|
73
|
+
</div><!-- /#header-search -->
|
74
|
+
|
75
|
+
</div><!-- /#header-title-search -->
|
76
|
+
|
77
|
+
</div><!-- /#header-main -->
|
78
|
+
</div><!-- /#header-topstripe -->
|
79
|
+
|
80
|
+
</div> <!-- /#header -->
|
81
|
+
|
82
|
+
|
83
|
+
<div id="columns" class="clearfix">
|
84
|
+
<div id="column-content" class="grid-10 grid-first clearfix">
|
85
|
+
<!-- Create left column on search pages -->
|
86
|
+
<div class="node-blog-tpl" class="clearfix">
|
87
|
+
<div class="blog-title freeexchange">
|
88
|
+
<img class="imagefield imagefield-field_blog_logo" width="50" height="50" alt="" src="http://media.economist.com/sites/default/files/BlogFreeEx.jpg?1274391686" /> <div class="blog-post-header">
|
89
|
+
<h2>Economics</h4>
|
90
|
+
<span><a href="/blogs/freeexchange">Free exchange</a></span>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<h1 class="ec-blog-fly-title">Trade</h1>
|
94
|
+
<h3 class="ec-blog-headline">
|
95
|
+
The zero-sum president </h3>
|
96
|
+
<p class="ec-blog-info">
|
97
|
+
Jan 25th 2012, 9:31 by R.A. | LONDON </p>
|
98
|
+
<div id="block-ec_components-share_inline_header" class="block block-ec_components">
|
99
|
+
<div class="content clearfix">
|
100
|
+
<div class="share_inline_header"><ul class="clearfix"><li class="share-inline-header-facebook first" data-ec-omniture-frame="top_fb"><fb:like href="http://www.economist.com/blogs/freeexchange/2012/01/trade" send="false" layout="button_count" show_faces="false" font=""></fb:like></li>
|
101
|
+
<li class="share-inline-header-twitter even last" data-ec-omniture-frame="top_twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-related="theeconomist" data-url="http://econ.st/AC5wZo" data-counturl="http://www.economist.com/blogs/freeexchange/2012/01/trade">Tweet</a></li>
|
102
|
+
</ul></div> </div>
|
103
|
+
</div>
|
104
|
+
<div class="ec-blog-body">
|
105
|
+
<p>STATE of the Union addresses tend to be long, winding affairs, filled with a grab bag of policy ideas that will altenatively appeal to and irk people across the political spectrum. Barack Obama's <a href="http://www.telegraph.co.uk/news/worldnews/barackobama/9037296/State-of-the-Union-speech-2012-speech-in-full.html">latest address</a> had plenty of sensible ideas in it: tax reform, including reductions in corporate rates; more spending and accountability on education and infrastructure investment; streamlining of the regulatory environment; and so on. He led off, however, with a call for a reshoring of manufacturing jobs seemingly calculated to cost him <em>The Economist</em>'s endorsement. Granted, annoying <em>The Economist</em> is, almost definitionally, good politics. For a president whose hallmark has been soaring orations promising hope, however, Mr Obama's take on the global economy is strikingly bleak and depressing.</p><p>The president was not so unreasonable as to suggest that the American economy could recapture all of its lost manufacturing jobs. Nor was he wrong to point out that countries like China have used direct subsidies, financial shenanigans and currency manipulation to give their exporters a leg up. Yet at no point did he attempt to justify the unstated assumption that what America ought really to do is develop an economy like China's—a place, recall, scarcely one-sixth as rich as America, riddled with potentially debilitating economic imbalances, and governed by an unaccountable monopoly of a communist party. Perhaps more distressing, he implied in several places that the reason to become more like China was that only by doing so could America <em>defeat</em> China, and others, at economics. Consider the line:</p><blockquote><p>Our workers are the most productive on Earth, and if the playing field is level, I promise you – America will always win.</p></blockquote><p>Leaving others, one is forced to conclude, to lose—not once, not occasionally, but <em>always</em>. And what is likely to be the outcome of unending defeat? Destitution? Are we to hope that other countries are left with no gainful employment opportunities at all? If that means dreadful poverty, then Mr Obama ought to be dragged before an international tribunal. But maybe it's not so bad, in which case we have to wonder why it's so damned important to "win" whatever contest it is we're having. Is the implication that it's possible to get by all right, to not be poor, without having lots of demanding manufacturing jobs? That doesn't sound so bad, actually; are we sure America doesn't want to sign up for that? Of course, if this is the nature of economic activity, and if America is determined to defeat other countries, it's worth asking whether it wouldn't make sense to deliberately <em>sabotage</em> other places, or bomb them; after all, it's hard to lose to a country whose people are dead. On the other hand, if victory is so important, we might expect other countries to retaliate, or preemptively attack. Maybe it would be better if the world divided itself into two competing but fairly isolated factions locked in a sort of "cold war".</p><p>Later, the president added:</p><blockquote><p>Don’t let other countries win the race for the future.</p></blockquote><p>The context, innocuously enough, was in calling for greater support for American research and development efforts. But the language of this statement is either daft or ghastly, depending on how charitably one is willing to read it. Is Mr Obama so dense as to miss that when America invents things other countries benefit, and vice versa? If a German discovers a cure for cancer, shouldn't we be ecstatic about that, rather than angry? Indeed, shouldn't we be quite happy and interested in ensuring that Germans and Britons and Indians have the capability and opportunity to develop fantastic new technologies? In the more nefarious reading, Mr Obama seems to accept that only relative standing really matters. A sick, poor world in which America always triumphs is preferable in all cases to one in which America maybe doesn't "win" the race to discover every last little thing that's out there to be discovered. And hell, one has to ask again whether the easiest way to prevent other countries from winning the race for the future isn't simply to blow up their labs.</p><p>Look, I understand the forgiving interpretation of these remarks. Americans are motivated by competition and patriotism, and if that's the only way to rally the country behind fundamentally sound policies like subsidies for basic research, then that's the card you play. And, in practice, Mr Obama's reforms will probably not do much more than offset the crummy, mercantilist choices made by other governments elsewhere. No one is talking about going back to the early 19th century, or to the days of communist containment.</p><p>I don't see that that's an acceptable excuse. People who live outside of America are people just like Americans, and we should all rejoice in their rising prosperity, the more so when it occurs through additions to the stock of human knowledge that will benefit people everywhere. If an American president can't communicate that simple idea to his citizenry, out of fear that he'll be drummed out of office on a wave of nationalistic outrage, then he doesn't deserve to be president and his country doesn't deserve to win a damned thing, least of all the right to call itself "exceptional", a beacon of hope and freedom. A zero-sum world is a world <em>without</em> hope, and if Mr Obama is convinced that's what we're in then I don't see much need for him to stick around.</p> </div>
|
106
|
+
|
107
|
+
</div> <!-- /#columns -->
|
108
|
+
|
109
|
+
</div> <!-- /#page -->
|
110
|
+
</body>
|
111
|
+
</html>
|
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: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rjb
|
16
|
-
requirement: &
|
16
|
+
requirement: &70243259830940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70243259830940
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &70243259829420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70243259829420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: chronic
|
38
|
-
requirement: &
|
38
|
+
requirement: &70243259828180 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70243259828180
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: hpricot
|
49
|
-
requirement: &
|
49
|
+
requirement: &70243259826580 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70243259826580
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: psych
|
60
|
-
requirement: &
|
60
|
+
requirement: &70243259824560 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70243259824560
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rchardet19
|
71
|
-
requirement: &
|
71
|
+
requirement: &70243259839300 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70243259839300
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: whatlanguage
|
82
|
-
requirement: &
|
82
|
+
requirement: &70243259837640 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70243259837640
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: wordnet
|
93
|
-
requirement: &
|
93
|
+
requirement: &70243259835240 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70243259835240
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rbtagger
|
104
|
-
requirement: &
|
104
|
+
requirement: &70243259832320 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70243259832320
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: engtagger
|
115
|
-
requirement: &
|
115
|
+
requirement: &70243259839180 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70243259839180
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: punkt-segmenter
|
126
|
-
requirement: &
|
126
|
+
requirement: &70243259836880 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70243259836880
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: tokenizer
|
137
|
-
requirement: &
|
137
|
+
requirement: &70243259834100 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *70243259834100
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: tactful_tokenizer
|
148
|
-
requirement: &
|
148
|
+
requirement: &70243259830340 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,10 +153,10 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :runtime
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *70243259830340
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: english
|
159
|
-
requirement: &
|
159
|
+
requirement: &70243259828860 !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|
162
162
|
- - ! '>='
|
@@ -164,10 +164,10 @@ dependencies:
|
|
164
164
|
version: '0'
|
165
165
|
type: :runtime
|
166
166
|
prerelease: false
|
167
|
-
version_requirements: *
|
167
|
+
version_requirements: *70243259828860
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: linguistics
|
170
|
-
requirement: &
|
170
|
+
requirement: &70243259827140 !ruby/object:Gem::Requirement
|
171
171
|
none: false
|
172
172
|
requirements:
|
173
173
|
- - ! '>='
|
@@ -175,10 +175,10 @@ dependencies:
|
|
175
175
|
version: '0'
|
176
176
|
type: :runtime
|
177
177
|
prerelease: false
|
178
|
-
version_requirements: *
|
178
|
+
version_requirements: *70243259827140
|
179
179
|
- !ruby/object:Gem::Dependency
|
180
180
|
name: ruby-stemmer
|
181
|
-
requirement: &
|
181
|
+
requirement: &70243259824840 !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|
184
184
|
- - ! '>='
|
@@ -186,10 +186,10 @@ dependencies:
|
|
186
186
|
version: '0'
|
187
187
|
type: :runtime
|
188
188
|
prerelease: false
|
189
|
-
version_requirements: *
|
189
|
+
version_requirements: *70243259824840
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: uea-stemmer
|
192
|
-
requirement: &
|
192
|
+
requirement: &70243259812140 !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
195
195
|
- - ! '>='
|
@@ -197,10 +197,10 @@ dependencies:
|
|
197
197
|
version: '0'
|
198
198
|
type: :runtime
|
199
199
|
prerelease: false
|
200
|
-
version_requirements: *
|
200
|
+
version_requirements: *70243259812140
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: lda-ruby
|
203
|
-
requirement: &
|
203
|
+
requirement: &70243259810000 !ruby/object:Gem::Requirement
|
204
204
|
none: false
|
205
205
|
requirements:
|
206
206
|
- - ! '>='
|
@@ -208,10 +208,10 @@ dependencies:
|
|
208
208
|
version: '0'
|
209
209
|
type: :runtime
|
210
210
|
prerelease: false
|
211
|
-
version_requirements: *
|
211
|
+
version_requirements: *70243259810000
|
212
212
|
- !ruby/object:Gem::Dependency
|
213
213
|
name: nickel
|
214
|
-
requirement: &
|
214
|
+
requirement: &70243259808300 !ruby/object:Gem::Requirement
|
215
215
|
none: false
|
216
216
|
requirements:
|
217
217
|
- - ! '>='
|
@@ -219,10 +219,10 @@ dependencies:
|
|
219
219
|
version: '0'
|
220
220
|
type: :runtime
|
221
221
|
prerelease: false
|
222
|
-
version_requirements: *
|
222
|
+
version_requirements: *70243259808300
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: unprof
|
225
|
-
requirement: &
|
225
|
+
requirement: &70243259805800 !ruby/object:Gem::Requirement
|
226
226
|
none: false
|
227
227
|
requirements:
|
228
228
|
- - ! '>='
|
@@ -230,7 +230,7 @@ dependencies:
|
|
230
230
|
version: '0'
|
231
231
|
type: :development
|
232
232
|
prerelease: false
|
233
|
-
version_requirements: *
|
233
|
+
version_requirements: *70243259805800
|
234
234
|
description: ! ' Treat is a toolkit for text retrieval, information extraction and
|
235
235
|
natural language processing. '
|
236
236
|
email:
|
@@ -243,7 +243,6 @@ files:
|
|
243
243
|
- lib/treat/categories.rb
|
244
244
|
- lib/treat/category.rb
|
245
245
|
- lib/treat/delegatable.rb
|
246
|
-
- lib/treat/detectors/encoding/native.rb
|
247
246
|
- lib/treat/detectors/encoding/r_chardet19.rb
|
248
247
|
- lib/treat/detectors/format/file.rb
|
249
248
|
- lib/treat/detectors/language/language_detector.rb
|
@@ -348,6 +347,7 @@ files:
|
|
348
347
|
- lib/treat/processors.rb
|
349
348
|
- lib/treat/proxies.rb
|
350
349
|
- lib/treat/registrable.rb
|
350
|
+
- lib/treat/string.rb
|
351
351
|
- lib/treat/sugar.rb
|
352
352
|
- lib/treat/tree.rb
|
353
353
|
- lib/treat/visitable.rb
|
@@ -364,10 +364,16 @@ files:
|
|
364
364
|
- test/tc_treat.rb
|
365
365
|
- test/tc_tree.rb
|
366
366
|
- test/tests.rb
|
367
|
+
- test/texts/english/half_cocked_basel.txt
|
368
|
+
- test/texts/english/hose_and_dry.doc
|
369
|
+
- test/texts/english/hungarys_troubles.abw
|
367
370
|
- test/texts/english/long.html
|
368
371
|
- test/texts/english/long.txt
|
369
372
|
- test/texts/english/medium.txt
|
373
|
+
- test/texts/english/republican_nomination.pdf
|
374
|
+
- test/texts/english/saving_the_euro.odt
|
370
375
|
- test/texts/english/short.txt
|
376
|
+
- test/texts/english/zero_sum.html
|
371
377
|
- test/texts.rb
|
372
378
|
- examples/benchmark.rb
|
373
379
|
- examples/keywords.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Treat
|
2
|
-
module Detectors
|
3
|
-
module Encoding
|
4
|
-
# A wrapper class for Ruby's native encoding detector.
|
5
|
-
class Native
|
6
|
-
# Return the encoding of the entity according
|
7
|
-
# to the Ruby interpreter.
|
8
|
-
#
|
9
|
-
# Options: none.
|
10
|
-
def self.encoding(entity, options={})
|
11
|
-
entity.value.encoding.name.
|
12
|
-
gsub('-', '_').downcase.intern
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|