Skip to content

Commit

Permalink
Fix name of add_affix method to add_with_affix to agree with hunspell…
Browse files Browse the repository at this point in the history
… lib
  • Loading branch information
cdchapman committed Nov 17, 2016
1 parent 4b25f5f commit d818366
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ffi/hunspell/dictionary.rb
Expand Up @@ -116,8 +116,8 @@ def add(word)
Hunspell.Hunspell_add(self,word.to_s)
end

def add_affix(word,example)
Hunspell.Hunspell_add_affix(self,word.to_s,example.to_s)
def add_with_affix(word,example)
Hunspell.Hunspell_add_with_affix(self,word.to_s,example.to_s)
end

alias << add
Expand Down
14 changes: 14 additions & 0 deletions spec/dictionary_spec.rb
Expand Up @@ -57,6 +57,20 @@
expect(subject.valid?('dxg')).to be false
end

describe "#add" do
it "should add a word" do
expect(subject.add('cat')).to be 0
end
end

describe "#add_with_affix" do
it "should add a word with an example word" do
expect(subject.add_with_affix('cat', 'agree')).to be 0
expect(subject.valid?('disagreeable')).to be true
expect(subject.valid?('discatable')).to be true
end
end

describe "#stem" do
it "should find the stems of a word" do
expect(subject.stem('fishing')).to be == %w[fishing fish]
Expand Down

0 comments on commit d818366

Please sign in to comment.