treat 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. data/LICENSE +4 -4
  2. data/TODO +21 -54
  3. data/lib/economist/half_cocked_basel.txt +16 -0
  4. data/lib/economist/hose_and_dry.doc +0 -0
  5. data/lib/economist/hungarys_troubles.abw +70 -0
  6. data/lib/economist/republican_nomination.pdf +0 -0
  7. data/lib/economist/saving_the_euro.odt +0 -0
  8. data/lib/economist/to_infinity_and_beyond.txt +15 -0
  9. data/lib/economist/zero_sum.html +91 -0
  10. data/lib/treat.rb +58 -72
  11. data/lib/treat/buildable.rb +59 -15
  12. data/lib/treat/categories.rb +26 -14
  13. data/lib/treat/category.rb +2 -2
  14. data/lib/treat/delegatable.rb +65 -48
  15. data/lib/treat/doable.rb +44 -0
  16. data/lib/treat/entities.rb +34 -14
  17. data/lib/treat/entities/collection.rb +2 -0
  18. data/lib/treat/entities/document.rb +3 -2
  19. data/lib/treat/entities/entity.rb +105 -90
  20. data/lib/treat/entities/phrases.rb +17 -0
  21. data/lib/treat/entities/tokens.rb +28 -13
  22. data/lib/treat/entities/zones.rb +20 -0
  23. data/lib/treat/extractors.rb +49 -11
  24. data/lib/treat/extractors/coreferences/stanford.rb +68 -0
  25. data/lib/treat/extractors/date/chronic.rb +32 -0
  26. data/lib/treat/extractors/date/ruby.rb +25 -0
  27. data/lib/treat/extractors/keywords/tf_idf.rb +26 -0
  28. data/lib/treat/extractors/keywords/{topics_frequency.rb → topics_tf_idf.rb} +15 -7
  29. data/lib/treat/{detectors/language/language_detector.rb → extractors/language/language_extractor.rb} +5 -2
  30. data/lib/treat/extractors/language/what_language.rb +49 -0
  31. data/lib/treat/extractors/named_entity_tag/stanford.rb +53 -0
  32. data/lib/treat/extractors/roles/naive.rb +73 -0
  33. data/lib/treat/extractors/statistics/frequency_in.rb +6 -13
  34. data/lib/treat/extractors/statistics/{position_in_parent.rb → position_in.rb} +1 -1
  35. data/lib/treat/extractors/statistics/tf_idf.rb +89 -21
  36. data/lib/treat/extractors/statistics/transition_matrix.rb +11 -11
  37. data/lib/treat/extractors/statistics/transition_probability.rb +4 -4
  38. data/lib/treat/extractors/time/nickel.rb +30 -12
  39. data/lib/treat/extractors/topic_words/lda.rb +9 -9
  40. data/lib/treat/extractors/topics/reuters.rb +14 -15
  41. data/lib/treat/extractors/topics/reuters/region.xml +1 -0
  42. data/lib/treat/features.rb +7 -0
  43. data/lib/treat/formatters/readers/abw.rb +6 -1
  44. data/lib/treat/formatters/readers/autoselect.rb +5 -6
  45. data/lib/treat/formatters/readers/doc.rb +3 -1
  46. data/lib/treat/formatters/readers/html.rb +1 -1
  47. data/lib/treat/formatters/readers/image.rb +43 -0
  48. data/lib/treat/formatters/readers/odt.rb +1 -2
  49. data/lib/treat/formatters/readers/pdf.rb +9 -1
  50. data/lib/treat/formatters/readers/xml.rb +40 -0
  51. data/lib/treat/formatters/serializers/xml.rb +50 -14
  52. data/lib/treat/formatters/serializers/yaml.rb +7 -2
  53. data/lib/treat/formatters/unserializers/xml.rb +33 -7
  54. data/lib/treat/formatters/visualizers/dot.rb +90 -20
  55. data/lib/treat/formatters/visualizers/short_value.rb +2 -2
  56. data/lib/treat/formatters/visualizers/standoff.rb +2 -2
  57. data/lib/treat/formatters/visualizers/tree.rb +1 -1
  58. data/lib/treat/formatters/visualizers/txt.rb +13 -4
  59. data/lib/treat/group.rb +16 -10
  60. data/lib/treat/helpers/linguistics_loader.rb +18 -0
  61. data/lib/treat/inflectors.rb +10 -0
  62. data/lib/treat/inflectors/cardinal_words/linguistics.rb +3 -3
  63. data/lib/treat/inflectors/conjugations/linguistics.rb +5 -12
  64. data/lib/treat/inflectors/declensions/english.rb +319 -0
  65. data/lib/treat/inflectors/declensions/linguistics.rb +12 -11
  66. data/lib/treat/inflectors/ordinal_words/linguistics.rb +3 -3
  67. data/lib/treat/install.rb +59 -0
  68. data/lib/treat/kernel.rb +18 -8
  69. data/lib/treat/languages.rb +18 -11
  70. data/lib/treat/languages/arabic.rb +4 -2
  71. data/lib/treat/languages/chinese.rb +6 -2
  72. data/lib/treat/languages/dutch.rb +16 -0
  73. data/lib/treat/languages/english.rb +47 -19
  74. data/lib/treat/languages/french.rb +8 -5
  75. data/lib/treat/languages/german.rb +9 -6
  76. data/lib/treat/languages/greek.rb +16 -0
  77. data/lib/treat/languages/italian.rb +6 -3
  78. data/lib/treat/languages/polish.rb +16 -0
  79. data/lib/treat/languages/portuguese.rb +16 -0
  80. data/lib/treat/languages/russian.rb +16 -0
  81. data/lib/treat/languages/spanish.rb +16 -0
  82. data/lib/treat/languages/swedish.rb +16 -0
  83. data/lib/treat/languages/tags.rb +377 -0
  84. data/lib/treat/lexicalizers.rb +34 -23
  85. data/lib/treat/lexicalizers/category/from_tag.rb +17 -10
  86. data/lib/treat/lexicalizers/linkages/naive.rb +51 -51
  87. data/lib/treat/lexicalizers/synsets/wordnet.rb +5 -1
  88. data/lib/treat/lexicalizers/tag/brill.rb +35 -40
  89. data/lib/treat/lexicalizers/tag/lingua.rb +19 -14
  90. data/lib/treat/lexicalizers/tag/stanford.rb +59 -68
  91. data/lib/treat/lexicalizers/tag/tagger.rb +29 -0
  92. data/lib/treat/processors.rb +8 -8
  93. data/lib/treat/processors/chunkers/txt.rb +4 -4
  94. data/lib/treat/processors/parsers/enju.rb +114 -99
  95. data/lib/treat/processors/parsers/stanford.rb +109 -41
  96. data/lib/treat/processors/segmenters/punkt.rb +17 -18
  97. data/lib/treat/processors/segmenters/punkt/dutch.yaml +9716 -0
  98. data/lib/treat/processors/segmenters/punkt/english.yaml +10340 -0
  99. data/lib/treat/processors/segmenters/punkt/french.yaml +43159 -0
  100. data/lib/treat/processors/segmenters/punkt/german.yaml +9572 -0
  101. data/lib/treat/processors/segmenters/punkt/greek.yaml +6050 -0
  102. data/lib/treat/processors/segmenters/punkt/italian.yaml +14748 -0
  103. data/lib/treat/processors/segmenters/punkt/polish.yaml +9751 -0
  104. data/lib/treat/processors/segmenters/punkt/portuguese.yaml +13662 -0
  105. data/lib/treat/processors/segmenters/punkt/russian.yaml +4237 -0
  106. data/lib/treat/processors/segmenters/punkt/spanish.yaml +24034 -0
  107. data/lib/treat/processors/segmenters/punkt/swedish.yaml +10001 -0
  108. data/lib/treat/processors/segmenters/stanford.rb +38 -37
  109. data/lib/treat/processors/segmenters/tactful.rb +5 -4
  110. data/lib/treat/processors/tokenizers/macintyre.rb +7 -6
  111. data/lib/treat/processors/tokenizers/multilingual.rb +2 -3
  112. data/lib/treat/processors/tokenizers/perl.rb +2 -2
  113. data/lib/treat/processors/tokenizers/punkt.rb +6 -2
  114. data/lib/treat/processors/tokenizers/stanford.rb +25 -24
  115. data/lib/treat/processors/tokenizers/tactful.rb +1 -2
  116. data/lib/treat/proxies.rb +2 -35
  117. data/lib/treat/registrable.rb +17 -22
  118. data/lib/treat/sugar.rb +11 -11
  119. data/lib/treat/tree.rb +27 -17
  120. data/lib/treat/viewable.rb +29 -0
  121. data/lib/treat/visitable.rb +1 -1
  122. data/test/tc_entity.rb +56 -49
  123. data/test/tc_extractors.rb +41 -18
  124. data/test/tc_formatters.rb +7 -8
  125. data/test/tc_inflectors.rb +19 -24
  126. data/test/tc_lexicalizers.rb +12 -19
  127. data/test/tc_processors.rb +26 -12
  128. data/test/tc_resources.rb +2 -7
  129. data/test/tc_treat.rb +20 -22
  130. data/test/tc_tree.rb +4 -4
  131. data/test/tests.rb +3 -5
  132. data/test/texts.rb +13 -14
  133. data/tmp/INFO +1 -0
  134. metadata +78 -158
  135. data/bin/INFO +0 -1
  136. data/examples/benchmark.rb +0 -81
  137. data/examples/keywords.rb +0 -148
  138. data/lib/treat/detectors.rb +0 -31
  139. data/lib/treat/detectors/encoding/r_chardet19.rb +0 -27
  140. data/lib/treat/detectors/format/file.rb +0 -36
  141. data/lib/treat/detectors/language/what_language.rb +0 -29
  142. data/lib/treat/entities/constituents.rb +0 -15
  143. data/lib/treat/entities/sentence.rb +0 -8
  144. data/lib/treat/extractors/named_entity/abner.rb +0 -20
  145. data/lib/treat/extractors/named_entity/stanford.rb +0 -174
  146. data/lib/treat/extractors/statistics/frequency_of.rb +0 -15
  147. data/lib/treat/extractors/time/chronic.rb +0 -20
  148. data/lib/treat/extractors/time/native.rb +0 -18
  149. data/lib/treat/formatters/readers/gocr.rb +0 -26
  150. data/lib/treat/formatters/readers/ocropus.rb +0 -31
  151. data/lib/treat/formatters/visualizers/html.rb +0 -13
  152. data/lib/treat/formatters/visualizers/inspect.rb +0 -20
  153. data/lib/treat/inflectors/declensions/en.rb +0 -18
  154. data/lib/treat/languages/categories.rb +0 -5
  155. data/lib/treat/languages/english/categories.rb +0 -23
  156. data/lib/treat/languages/english/tags.rb +0 -352
  157. data/lib/treat/languages/xinhua.rb +0 -12
  158. data/lib/treat/lexicalizers/synsets/rita_wn.rb +0 -23
  159. data/lib/treat/string.rb +0 -5
  160. data/test/tc_detectors.rb +0 -26
data/LICENSE CHANGED
@@ -15,8 +15,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  Author: Louis-Antoine Mullie (louis.mullie@gmail.com). Copyright 2012.
17
17
 
18
- Non-trivial amount of code has been incorporated and modified from
19
- other libraries, specifically for the following files:
18
+ Non-trivial amount of code has been incorporated and modified from other libraries:
20
19
 
21
20
  - formatters/readers/odt.rb - Mark Watson (GPL license)
22
21
  - processors/tokenizers/macintyre.rb - Utiyama Masao (Ruby License)
@@ -24,5 +23,6 @@ other libraries, specifically for the following files:
24
23
  - processors/tokenizers/perl.rb - Todd A. Fisher (MIT License)
25
24
  - processors/tokenizers/punkt.rb - Steven Bird Edward Loper and Joel Nothman (Apache 2.0 license)
26
25
  - extractors/topics/reuters.rb - Mark Watson (GPL license)
27
- - inflectors/stemmers/porter.rb - Ray Pereda (No license information)
28
- - tree.rb - Partly based on work by Anupam Sengupta (Creative Commons Attribution-ShareAlike Unported v. 3.0)
26
+ - inflectors/declensions/english.rb - Thomas Sawyer (MIT license)
27
+ - inflectors/stem/porter.rb - Ray Pereda (No license information)
28
+ - tree.rb - Partly based on work by Anupam Sengupta (Creative Commons Attribution-ShareAlike Unported v. 3.0 License)
data/TODO CHANGED
@@ -1,58 +1,25 @@
1
- ## Urgent
1
+ ## Todo
2
2
 
3
- - Linkers + documentation
4
- - Check taggers for context
3
+ - Chronic, ruby date
4
+ - Stanford/Enju phrase in phrase
5
+ - Date, time, roles structs
6
+ - test wiki
7
+ - Fix tag set for Stanford Parser.
8
+ - Make sure that Core NLP reloads appropriately.
9
+ - XML unserializer
10
+ - Tag opt
5
11
  - Stanford dependencies parse
6
- - Ocropus => use better function
7
- - Optimize magic methods... is_token? type methods, phrase categories.
8
- - Move statistics
9
- - Synset class move
10
- - general procedure for options, check that user doesn't want to change options...
11
- - Ferret, Spider
12
- - Loading multiple JARs
13
- - Linguistics loader, stanford loader
14
- - Tokenized sentences are not parsed
15
- - Dot colors
16
- - Fix encoders
17
- - Fix Punkt segmenter training text.
18
- - Mark Watson's text extractor
19
- - Statistics position in
20
- - Fix documentation antiword, Graphviz, # encoding: utf-8
21
- - Shortcut methods.. pre/postprocessors
22
- - Only Phrase..
23
- - Frequency in
12
+ - Annotator dependencies
13
+ - Meronyms
14
+ - Add XML stripper from the Stanford tools
15
+ - Try new encodings
16
+ - Add Stanford and Wordnet lemmatizers
17
+ - Improve linkers
18
+ - Sentiment analysis
19
+ - Enju as a server
20
+ - More information with categories
21
+ - Gist languages convert
24
22
 
25
- ## Eventually
23
+ ## Personal
26
24
 
27
- - English inflector
28
- - RDF output
29
- - Apache OpenNLP
30
- - Ariel
31
- - Text2rdf
32
- - AI libraries
33
- - JAWS
34
- - NLTK
35
- - ghmm
36
- - Root
37
- - OpenCyc
38
- - Tapas Kanungo
39
- - Mark Watson Text Extractor & other Java tools
40
- - Citar
41
- - PLDA
42
- - AI4R
43
- - Math
44
- - Abner
45
- - ACOPOST
46
- - Linkage integration
47
- - Lemmatizer
48
- - Claws tagger
49
- - YAWNI
50
- - Const missing instead of autoload
51
- - Probabilistic features: rchardet19, what_language
52
- - Enju multithreading ?
53
- - String type detector for other languages
54
- - Automatic benchmark
55
- - Raspell spell checker
56
- - Multithreading
57
- - Mark Watson's Java NLP utility to identify proper nouns (human names and places) in text
58
- - FastTag a Java fast part of speech tagger.
25
+ - Check treat.rb, tests.rb, kernel.rb.
@@ -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.
@@ -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>
@@ -0,0 +1,15 @@
1
+ To Infinity and Beyond
2
+
3
+ THE annual Consumer Electronics Show (CES) feels right at home amid the blazing neon excess of Las Vegas. For four days each January, thousands of companies gather to showcase their flashiest technologies at America's biggest trade show. This year over 20,000 brand new gadgets competed for attendees' attention. Each has its own power cord or battery, and almost every one is either bigger or faster—and thus more power-hungry—than last year's model.
4
+
5
+ The International Energy Agency expects consumer electronics' appetite for electricity to double over the next decade, from 15% to 30% of residential consumption worldwide. Even supposedly energy-saving innovations, such as the organic-LED (OLED) screen in the massive 55-inch television proudly displayed by South Korea's LG, consume oodles of power, just by dint of being so big.
6
+
7
+ But this year's show also sees a welcome counter-trend. Several companies launched products labelled as having "infinite power". Such devices are meant to generate at least as much power as they consume. Buy one of these gizmos, the theory goes, and you need never connect it to a wall socket.
8
+
9
+ Eton Corporation announced Rukus, a portable boom box that can stream music from Bluetooth devices such as smartphones and tablets. For every hour that the Rukus is in full sunlight, it can play an hour of music, harvesting solar energy from 40 square inches (260 square centimetres) of photovoltaic panels. It has an internal battery which stores sunshine for cloudy picnics and can also be tapped to recharge other mobile gadgets.
10
+
11
+ Similarly impressive is a high-tech cover for Amazon's Kindle ebook reader by Solar Focus (see picture). A solar panel on the outer face gives 90 minutes of reading time for every hour of sunlight. Surplus energy is stored in a small lithium-ion battery and allows an LED reading lamp to run for up to 50 hours without drawing on the Kindle's own battery.
12
+
13
+ Both the Kindle and the Rukus have frugal monochrome E Ink displays that consume a fraction of the power of the colourful LCD screens found on most gadgets. Even the best solar-panel case for Apple's iPhone, for instance, can do no more than slow the rate at which the smartphone runs down. You might think, then, that something as large as a practical solar-powered electric car would be utterly impossible. Not so, says Ford. At CES, the carmaker showed a domestic solar panel kit it claims will offset all the electricity used over the lifetime of its new Focus Electric plug-in vehicle. The 150 square-foot (14 square-metre) array, to be installed on owners' houses, should feed enough power to the grid as the car draws to recharge its battery. to account for every mile a typical motorist drives. Panels on roofs in rainy Seattle might allow 12,000 miles (19,300km) of driving each year; denizens of sunny Tucson may squeeze out 15,000 miles or more.
14
+
15
+ The solar kit will set a Ford owner back around $10,000 (the price would be higher were it not for American federal incentives). It comes with a 25-year guarantee—22 years more than the warranty on the car. This is still some way from the dream of a self-contained solar runabout, but it is a start. The increasingly power-hungry electronics industry might will no doubt need to steer itself in a similar direction.
@@ -0,0 +1,91 @@
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</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><!-- /#header-links -->
33
+
34
+ <div id="header-timestamp" class="clearfix">
35
+ Wednesday January 25th 2012 </div><!-- /#header-timestamp -->
36
+
37
+ <div id="header-title-search" class="clearfix">
38
+
39
+
40
+ <div id="header-search" class="clearfix">
41
+ <form action="/blogs/freeexchange/2012/01/trade" accept-charset="UTF-8" method="post" id="search-theme-form">
42
+ <div><div id="search" class="container-inline">
43
+ <div class="form-item clearfix" id="edit-search-theme-form-1-wrapper">
44
+ <label for="edit-search-theme-form-1">Search this site:</label>
45
+ <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" />
46
+ </div>
47
+ <input type="submit" name="op" id="edit-submit-1" value="Search" class="form-submit" />
48
+ <input type="hidden" name="form_build_id" id="form-95221799fc500ba9ac651bab969c1a14" value="form-95221799fc500ba9ac651bab969c1a14" />
49
+ <input type="hidden" name="form_id" id="edit-search-theme-form" value="search_theme_form" />
50
+ </div>
51
+
52
+ </div></form>
53
+ </div><!-- /#header-search -->
54
+
55
+ </div><!-- /#header-title-search -->
56
+
57
+ </div><!-- /#header-main -->
58
+ </div><!-- /#header-topstripe -->
59
+
60
+ </div> <!-- /#header -->
61
+
62
+
63
+ <div id="columns" class="clearfix">
64
+ <div id="column-content" class="grid-10 grid-first clearfix">
65
+ <!-- Create left column on search pages -->
66
+ <div class="node-blog-tpl" class="clearfix">
67
+ <div class="blog-title freeexchange">
68
+ <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">
69
+ <h2>Economics</h4>
70
+ <span><a href="/blogs/freeexchange">Free exchange</a></span>
71
+ </div>
72
+ </div>
73
+ <h1 class="ec-blog-fly-title">Trade</h1>
74
+ <h3 class="ec-blog-headline">
75
+ The zero-sum president </h3>
76
+ <p class="ec-blog-info">
77
+ Jan 25th 2012, 9:31 by R.A. | LONDON </p>
78
+ <div id="block-ec_components-share_inline_header" class="block block-ec_components">
79
+ <div class="content clearfix">
80
+ <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>
81
+ <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>
82
+ </ul></div> </div>
83
+ </div>
84
+ <div class="ec-blog-body">
85
+ <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>
86
+
87
+ </div> <!-- /#columns -->
88
+
89
+ </div> <!-- /#page -->
90
+ </body>
91
+ </html>
@@ -1,95 +1,72 @@
1
+ # encoding: utf-8
1
2
  # Main namespace for Treat modules.
2
3
  #
3
4
  # === Entities
4
5
  #
5
- # Entities are Tree structures that represent any textual
6
- # entity (from a collection of texts down to an individual
7
- # word) with a value, features, children and edges linking
8
- # it to other textual entities. Sugar provides syntactic sugar
9
- # for Entities and can be enabled by running Treat.edulcorate.
10
- #
6
+ # Entities are Tree structures that represent textual entities
7
+ # (from a collection of texts down to an individual word), with
8
+ # a value, features, children and dependencies linking it to other
9
+ # textual entities.
10
+ #
11
11
  # Here are some example of how to create entities:
12
12
  #
13
13
  # c = Collection 'folder_with_documents'
14
- # d = Document 'filename.txt' # (or PDF, html, xml, png, jpg, gif).
14
+ # d = Document 'filename.txt' # (or pdf, html, xml, doc, abw, odt, png, jpg, jpeg, gif).
15
15
  # p = Paragraph 'A short story. The end.'
16
16
  # s = Sentence 'That is not a sentence.'
17
17
  # w = Word 'fox'
18
- #
19
- # Here's a full list of entities (subtypes in parentheses):
20
- # Collection, Document, Zone (Section, Title, Paragraph or List),
21
- # Sentence, Constituent (Phrase or Clause), Token (Word, Number,
22
- # Symbol or Punctuation).
23
- #
24
- # === Proxies
25
- #
26
- # Proxies allow the Treat functions to be called on the core
27
- # Ruby classes String, Numeric and Array. They build the entity
28
- # corresponding to the supplied raw text and send the requested
29
- # function to it.
30
- #
31
- # For example,
32
18
  #
33
- # 'fox'.tag
19
+ # Here is a list of entities and their description:
34
20
  #
35
- # Is equivalent to:
21
+ # - A Collection represents a folder with different textual documents.
22
+ # - A Document represents a file with a textual content.
23
+ # - A Section represents a logical subdivision of a document.
24
+ # - A Zone can be a Title, a Paragraph or a List and represents an intra-section division of content.
25
+ # - A Sentence represents just that.
26
+ # - A Constituent can be a Phrase or a Clause and represents a syntactical unit.
27
+ # - A Token can be a Word, a Number, a Punctuation or a Symbol (non-punctuation, non-alphanumeric characters).
36
28
  #
37
- # w = Word 'fox'
38
- # w.tag
39
- #
40
29
  # === Functions
41
30
  #
42
- # A class is defined for each implemented algorithm performing a given
43
- # task. These classes are clustered into groups of algorithms performing
44
- # the same given task (Group), and the groups are clustered into Categories
45
- # of groups performing related tasks.
31
+ # A worker class is defined for each implemented algorithm performing a given
32
+ # task. These classes are clustered into workers performing the same given task
33
+ # differently (Group), and the groups are clustered into Categories
34
+ # of groups of workers that perform related tasks.
35
+ #
36
+ # Here are the different Categories and their description:
37
+ #
38
+ # - Processors perform the building of tree of entities representing texts (chunking, segmenting, tokenizing, parsing).
39
+ # - Lexicalizers give lexical information about words (synsets, semantic relationships, tag, word category).
40
+ # - Extractors extract semantic information about an entity (topic, date, time, named entity).
41
+ # - Inflectors allow to retrieve the different inflections of a word (declensors, conjugators, stemmers, lemmatizers).
42
+ # - Formatters handle the conversion of entities to and from different formats (readers, serializers, unserializers, visualizers).
46
43
  #
47
- # Here are the different Categories:
48
- #
49
- # - Detectors - Category for language, encoding, and format
50
- # detectors.
51
- # - Extractors - Category for algorithms that extract information
52
- # from entities.
53
- # - Formatters - Category for algorithms that handle conversion
54
- # to and from different formats.
55
- # - Inflectors - Category for algorithms that supply the base
56
- # form, inflections and declensions of a word.
57
- # - Lexicalizers - Category for algorithms that supply lexical
58
- # information about a word (part of speech, synsets, word categories).
59
- # - Processors - Namespace for algorithms that process collections and
60
- # documents into trees.
44
+ # === Linguistic Resources
61
45
  #
62
- # === Linguistic resources
63
- #
64
- # The Languages module contains linguistic information about
65
- # languages (full ISO-639-1 and 2 language list, tag alignments
46
+ # The Languages module contains linguistic information about
47
+ # languages (full ISO-639-1 and 2 language list, tag alignments
66
48
  # for three treebanks, word categories, etc.)
67
- #
68
- # === Mixins for entities.
69
- #
70
- # Buildable, Delegatable, Visitable and Registrable are
71
- # or extended by Entity and provide it with the ability to be built,
72
- # to delegate function calls, to accept visitors and to maintain a
73
- # token registry, respectively.
74
49
  #
75
- # === Exception class.
76
- #
77
- # Exception defines a custom exception class for the Treat module.
78
- #
50
+ # === Exception Class.
51
+ #
52
+ # Treat::Exception defines a custom exception class for the Treat module.
53
+ #
79
54
  module Treat
80
55
 
81
56
  # Make sure that we are running on Ruby 1.9 or higher.
82
57
  if RUBY_VERSION <= '1.9'
83
58
  raise 'Treat requires Ruby 1.9 or higher.'
84
59
  end
85
-
60
+
86
61
  # The current version of Treat.
87
- VERSION = "0.1.4"
62
+ VERSION = "0.2.0"
63
+
64
+ # $LOAD_PATH << '/ruby/gems/treat/lib/' # Remove for release
88
65
 
89
- # $LOAD_PATH << '/ruby/treat/lib/' # Remove for release
90
-
91
66
  # Create class variables for the Treat module.
92
67
  class << self
68
+ # Boolean - output debug information.
69
+ attr_accessor :debug
93
70
  # Symbol - default language to use when detect_language is false.
94
71
  attr_accessor :default_language
95
72
  # Symbol - default encoding to use.
@@ -99,14 +76,14 @@ module Treat
99
76
  # Symbol - the ideal entity level to detect language at
100
77
  # (e.g., :entity, :sentence, :zone, :section, :document)
101
78
  attr_accessor :language_detection_level
102
- # String - main folder for executable files.
103
- attr_accessor :bin
104
79
  # String - folder of this file.
105
80
  attr_accessor :lib
106
81
  # String - folder for tests.
107
82
  attr_accessor :test
108
83
  end
109
84
 
85
+ # Turn off debug by default.
86
+ self.debug = false
110
87
  # Set the default language to english.
111
88
  self.default_language = :eng
112
89
  # Set the default encoding to utf-8.
@@ -114,19 +91,18 @@ module Treat
114
91
  # Turn language detection off by default.
115
92
  self.detect_language = false
116
93
  # Detect the language once per text by default.
117
- self.language_detection_level = :section
94
+ self.language_detection_level = :zone
118
95
  # Set the lib path to that of this file.
119
96
  self.lib = File.dirname(__FILE__)
120
- # Set the paths to the bin folder.
121
- self.bin = self.lib + '/../bin'
122
97
  # Set the paths to the test folder.
123
98
  self.test = self.lib + '/../test'
124
99
 
100
+ # Require inline C
101
+ # require 'inline'
102
+
125
103
  # Require modified core classes.
126
104
  require 'treat/object'
127
105
  require 'treat/kernel'
128
- require 'treat/string'
129
-
130
106
  # Require all files for the Treat library.
131
107
  require 'treat/exception'
132
108
  require 'treat/languages'
@@ -134,7 +110,17 @@ module Treat
134
110
  require 'treat/categories'
135
111
  require 'treat/proxies'
136
112
  require 'treat/sugar'
137
-
113
+
138
114
  # Make sugar available when needed.
139
- extend Sugar
115
+ extend Treat::Sugar
116
+
117
+ # Install packages for a given language.
118
+ def self.install(language = :english)
119
+ require 'treat/install'
120
+ Treat::Installer.install(language)
121
+ end
122
+
123
+ # Turn on detect language.
124
+ def self.detect!; self.detect_language = true; end
125
+
140
126
  end