push
travis-ci
60 of 60 new or added lines in 7 files covered. (100.0%)
6092 of 9505 relevant lines covered (64.09%)
65743.95 hits per line
1 |
# encoding: UTF-8
|
|
2 |
|
|
3 |
# Copyright 2012 Twitter, Inc
|
|
4 |
# http://www.apache.org/licenses/LICENSE-2.0
|
|
5 |
|
|
6 |
module TwitterCldr |
3✔ |
7 |
module Segmentation |
3✔ |
8 |
class Cursor |
3✔ |
9 |
attr_reader :text, :position, :match_cache |
3✔ |
10 |
|
|
11 |
def initialize(text) |
3✔ |
12 |
@text = text
|
9✔ |
13 |
reset |
9✔ |
14 |
end
|
|
15 |
|
|
16 |
def advance(amount = 1) |
3✔ |
17 |
@position += amount
|
228✔ |
18 |
end
|
|
19 |
|
|
20 |
def reset |
3✔ |
21 |
@position = 0 |
9✔ |
22 |
@match_cache = {}
|
9✔ |
23 |
end
|
|
24 |
|
|
25 |
def eof? |
3✔ |
26 |
position >= text.size |
237✔ |
27 |
end
|
|
28 |
|
|
29 |
def eos? |
3✔ |
30 |
position >= text.size - 1
|
× |
31 |
end
|
|
32 |
end
|
|
33 |
end
|
|
34 |
end
|