Sha256: a85186f7469c04614e4106b1f7f57ee7c31c9115499ad874ed5d4af367833940
Contents?: true
Size: 1.09 KB
Versions: 1
Compression:
Stored size: 1.09 KB
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Tokenizers class TimeTokenizer < TwitterCldr::Tokenizers::DateTimeTokenizer def initialize(options = {}) super(options) @token_splitter_regex = /(\'[\w\s-]+\'|a{1}|h{1,2}|H{1,2}|K{1,2}|k{1,2}|m{1,2}|s{1,2}|S+|z{1,4}|Z{1,4})/ @token_type_regexes = [{ :type => :pattern, :regex => /^a{1}|h{1,2}|H{1,2}|K{1,2}|k{1,2}|m{1,2}|s{1,2}|S+|z{1,4}|Z{1,4}/ }, { :type => :plaintext, :regex => // }] @paths = { :default => "calendars.gregorian.formats.time.default", :full => "calendars.gregorian.formats.time.full", :long => "calendars.gregorian.formats.time.long", :medium => "calendars.gregorian.formats.time.medium", :short => "calendars.gregorian.formats.time.short" } end protected # must override this because DateTimeTokenizer will set them otherwise def init_placeholders @placeholders = {} end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
twitter_cldr-1.1.0 | lib/tokenizers/calendars/time_tokenizer.rb |