regexp_trie 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/CI.yml +31 -0
- data/README.md +1 -1
- data/lib/regexp_trie/version.rb +1 -1
- data/lib/regexp_trie.rb +3 -1
- data/regexp_trie.gemspec +7 -2
- metadata +8 -11
- data/.travis.yml +0 -7
- data/example/benchmark.rb +0 -90
- data/example/hatena-keyword-list.csv +0 -454722
- data/example/synopsis.rb +0 -13
data/example/synopsis.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'regexp_trie'
|
3
|
-
|
4
|
-
# like Regexp.union()
|
5
|
-
p RegexpTrie.union(%w(foobar fooxar foozap fooza)) # /foo(?:bar|xar|zap?)/
|
6
|
-
p RegexpTrie.union(%w(foobar fooxar foozap fooza), option: Regexp::IGNORECASE) # /foo(?:bar|xar|zap?)/i
|
7
|
-
|
8
|
-
# or object-oriented interface
|
9
|
-
rt = RegexpTrie.new
|
10
|
-
%w(foobar fooxar foozap fooza).each do |word|
|
11
|
-
rt.add(word)
|
12
|
-
end
|
13
|
-
p rt.to_regexp # /foo(?:bar|xar|zap?)/
|