compound_splitter 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,6 @@ require "compound_splitter/dictionary"
4
4
 
5
5
  module CompoundSplitter
6
6
  def self.split(compound)
7
- Splitter.viterbi_split(compound)
7
+ Splitter.split(compound)
8
8
  end
9
9
  end
@@ -6,7 +6,7 @@ module CompoundSplitter
6
6
  @dictionary = dictionary || Dictionary.new
7
7
  end
8
8
 
9
- def viterbi_split(compound)
9
+ def split(compound)
10
10
  return [] if compound.empty?
11
11
 
12
12
  probs, lasts = [1.0], [0]
@@ -1,3 +1,3 @@
1
1
  module CompoundSplitter
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -3,21 +3,21 @@ require "spec_helper"
3
3
  describe CompoundSplitter::Splitter do
4
4
  subject { CompoundSplitter::Splitter.new }
5
5
 
6
- describe "viterbi_split" do
6
+ describe "split" do
7
7
  it "should return rainy day for rainyday" do
8
- subject.viterbi_split('rainyday').should == %w[rainy day]
8
+ subject.split('rainyday').should == %w[rainy day]
9
9
  end
10
10
 
11
11
  it "should return w for w" do
12
- subject.viterbi_split('w').should == %w[w]
12
+ subject.split('w').should == %w[w]
13
13
  end
14
14
 
15
15
  it "should return pen island for penisland" do
16
- subject.viterbi_split('penisland').should == %w[penis land]
16
+ subject.split('penisland').should == %w[penis land]
17
17
  end
18
18
 
19
19
  it "should do something with ''" do
20
- subject.viterbi_split('').should == []
20
+ subject.split('').should == []
21
21
  end
22
22
  end
23
23
  end
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe CompoundSplitter do
4
4
  it "should delegate to splitter" do
5
5
  compound = 'wickedweather'
6
- CompoundSplitter::Splitter.should_receive(:viterbi_split)
6
+ CompoundSplitter::Splitter.should_receive(:split)
7
7
  .with(compound)
8
8
  CompoundSplitter.split(compound)
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compound_splitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70221998391920 !ruby/object:Gem::Requirement
16
+ requirement: &70108651520780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70221998391920
24
+ version_requirements: *70108651520780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70221998391360 !ruby/object:Gem::Requirement
27
+ requirement: &70108651520280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70221998391360
35
+ version_requirements: *70108651520280
36
36
  description: Split concatenated words
37
37
  email:
38
38
  - dtuite@gmail.com