Sha256: 341e4e6d960fdb4d7b1e405901dbd55b0d7b4f99e4820f2b85305effc61a6c6d
Contents?: true
Size: 718 Bytes
Versions: 36
Compression:
Stored size: 718 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Tokenizers class TimeTokenizer attr_reader :data_reader def initialize(data_reader) @data_reader = data_reader end def tokenize(pattern) PatternTokenizer.new(data_reader, tokenizer).tokenize(pattern) end def tokenizer @tokenizer ||= Tokenizer.new([ TokenRecognizer.new(:pattern, /^(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})/), TokenRecognizer.new(:plaintext, //) ], /(\'[\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})/) end end end end
Version data entries
36 entries across 36 versions & 3 rubygems