Sha256: 0bae18b7149ae03350ff159b4c3c75a8d3ebaac94d1da049ac3d64625363b4fa
Contents?: true
Size: 659 Bytes
Versions: 65
Compression:
Stored size: 659 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Tokenizers class TimespanTokenizer attr_reader :data_reader def initialize(data_reader) @data_reader = data_reader end def tokenize(pattern) PatternTokenizer.new(data_reader, tokenizer).tokenize(pattern) end protected def tokenizer @tokenizer ||= Tokenizer.new([ TokenRecognizer.new(:pattern, /\{?[0?#,\.]+\}?/), TokenRecognizer.new(:plaintext, //) ], /([^0*#,\.\{\}]*)(\{?[0#,\.]+\}?)([^0*#,\.\{\}]*)$/) end end end end
Version data entries
65 entries across 65 versions & 3 rubygems