cassiopee 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Changelog +1 -0
  2. data/lib/cassiopee.rb +1 -1
  3. data/tests/test-suite.rb +15 -0
  4. metadata +4 -4
data/Changelog CHANGED
@@ -1,3 +1,4 @@
1
+ v0.1.12: fix match not found when match includes last character
1
2
  v0.1.11: fix match to text 1.2
2
3
  v0.1.9: move demos to bin, to be dir compliant
3
4
  v0.1.8: remove rubygems dependency in code.
data/lib/cassiopee.rb CHANGED
@@ -765,7 +765,7 @@ module Cassiopee
765
765
  prev_progress = -1
766
766
  (minpos..(maxpos)).each do |j|
767
767
  # if position+length longer than sequence length, skip it
768
- if(j+i>=@sequence.length)
768
+ if(j+i>@sequence.length)
769
769
  next
770
770
  end
771
771
  @suffix = s[j,i]
data/tests/test-suite.rb CHANGED
@@ -20,6 +20,21 @@ class TestCrawler < Test::Unit::TestCase
20
20
  #assert_equal(2,match[2].length-1)
21
21
  end
22
22
 
23
+ def test_exactsearch2
24
+ crawler = Cassiopee::Crawler.new
25
+ crawler.setLogLevel(Logger::DEBUG)
26
+ crawler.indexString('my sample example')
27
+ matches = crawler.searchExact('xample')
28
+ assert_equal(1,matches.length)
29
+ # Minus 1, because first element is len of match
30
+ match = crawler.next()
31
+ puts "## "+match.to_s
32
+ #assert_equal(2,match[2].length-1)
33
+ crawler.setLogLevel(Logger::ERROR)
34
+
35
+ end
36
+
37
+
23
38
  def test_ambiguous
24
39
  crawler = Cassiopee::Crawler.new
25
40
  crawler.loadAmbiguityFile(File.join(File.dirname(__FILE__), 'amb.map'))
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassiopee
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 11
10
- version: 0.1.11
9
+ - 12
10
+ version: 0.1.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Olivier Sallou
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-10-04 00:00:00 Z
18
+ date: 2013-10-17 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: text