This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import strutils | |
| import tables | |
| import math | |
| import language_model | |
| import os | |
| import osproc | |
| import subexes | |
| type | |
| TKorpus = enum k1600_1650, k1650_1700, k1700_1750, k1750_1800, k1800_1850, k1850_1900, k1900_2010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Hash | |
| define_method '[]_with_try_on', do |*args| | |
| if args.size == 1 and respond_to?(args.first) | |
| send(:'[]_with_try_on', args.first) | |
| else | |
| args.inject(self.dup){|memo, e| memo.dup.delete(e) if memo.is_a?(Hash) } | |
| end | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class B12 < Thor | |
| desc "write", "write data into the index" | |
| method_option :methods, :desc => "The methods to call on each RawData", :type => :array | |
| def write(methods) | |
| end | |
| end | |
| # call: thor b12:write --methods=foo | |
| # result: "write" was called incorrectly. Call as "thor b12:write". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DT-GRAM GERMAN CONFIG (1.0) | |
| ROOTCAT CP. | |
| FILES . | |
| LEXENTRIES (DT-GRAM GERMAN). | |
| RULES (DT-GRAM GERMAN). | |
| TEMPLATES (DT-GRAM GERMAN). | |
| GOVERNABLERELATIONS SUBJ OBJ | |
| SEMANTICFUNCTIONS . | |
| NONDISTRIBUTIVES NUM PERS. | |
| EPSILON e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IO.popen('cat') do |io| | |
| io.puts("foobar") | |
| io.close_write | |
| puts io.gets | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bundler' | |
| require 'ostruct' | |
| Bundler.require | |
| # Load the "model". | |
| # | |
| require File.expand_path 'card', File.dirname(__FILE__) | |
| set :haml, { :format => :html5 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module FastChoice | |
| class Choice | |
| include Comparable | |
| INTERESSTING = 0.2 | |
| def initialize(element, action) | |
| @element, @action = element, action | |
| self.score = 0.0 | |
| end | |
| attr_reader :value, :action | |
| attr_accessor :score |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| suite "Plain Ruby", :use => :basic_verifications do | |
| setup do | |
| @a = 1 | |
| @b = 2 | |
| @result = 3 | |
| @type = Integer | |
| end | |
| exercise "Adding 1 and 2" do | |
| @a + @b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Concurrency Level: 10 | |
| Complete requests: 10000 | |
| Total transferred: 530000 bytes | |
| HTML transferred: 130000 bytes | |
| Requests per second: 3599.29 [#/sec] (mean) | |
| Time per request: 2.778 [ms] (mean) | |
| Time per request: 0.278 [ms] (mean, across all concurrent requests) | |
| Transfer rate: 186.29 [Kbytes/sec] received | |
| Connection Times (ms) |