hunspell-ffi 0.1.3.alpha → 0.1.3.alpha2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ .bundle
2
+ *.gem
data/CHANGES ADDED
@@ -0,0 +1,10 @@
1
+ = 0.1.3 (Work in progress)
2
+ * Update ffi version (~>1.0.7)
3
+ * New alias: Hunspell#check? for Hunspell#check
4
+ * New methods: #add(word), #remove(word), #add_with_affix(word, example) to
5
+ add/remove words from the run-time dictionary.
6
+ * Show a warning when we cannot find aff/dic files.
7
+
8
+ = 0.1.2 / 2010-08-07
9
+ * First release that works on OSX and Debian
10
+
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'http://rubygems.org'
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,18 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ hunspell-ffi (0.1.3.alpha2)
5
+ ffi (~> 1.0.7)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ ffi (1.0.7)
11
+ rake (>= 0.8.7)
12
+ rake (0.8.7)
13
+
14
+ PLATFORMS
15
+ ruby
16
+
17
+ DEPENDENCIES
18
+ hunspell-ffi!
data/README.rdoc CHANGED
@@ -1,29 +1,53 @@
1
1
  = hunspell-ffi
2
2
 
3
- A Ruby FFI interface to the Hunspell spelling checker
3
+ A Ruby FFI interface to the Hunspell spelling checker.
4
+
5
+ "Hunspell is the spell checker of OpenOffice.org and Mozilla Firefox 3 & Thunderbird, Google Chrome, and it is also used by proprietary softwares, like Mac OS X, memoQ, Opera and SDL Trados."
6
+ - http://hunspell.sourceforge.net/
4
7
 
5
8
  It should work wherever Ruby FFI works (tested on Ruby 1.9.2, 1.8.7, JRuby 1.5.1).
6
9
 
10
+ This should be a drop-in replacement for rhunspell (https://github.com/tiendung/rhunspell), but using ffi.
11
+
7
12
  == Installation
8
- 1. Install hunspell (OSX: 'brew install hunspell' Debian: 'apt-get install hunspell')
9
- 2. gem install hunspell-ffi
13
+ === Install Hunspell
14
+ On Mac OS X: Hunspell (libhunspell) is already installed on OSX 10.6.
15
+
16
+ On Debian:
17
+ apt-get install hunspell
18
+
19
+ === Install the Gem
20
+ gem install hunspell-ffi
10
21
 
11
22
  == Usage
12
23
  require 'hunspell-ffi'
13
24
  dict = Hunspell.new("path/to/cakes.aff", "path/to/cakes.dic")
14
- dict.spell("Baumkuchen") # => true same as #check
25
+ dict.spell("Baumkuchen") # => true same as #check, #check?
15
26
  dict.spell("Bomcuken") # => false
27
+ dict.check?("Bomcuken") # => false
16
28
  dict.suggest("Baumgurken") # => ["Baumkuchen"]
17
29
  dict.suggest("qwss43easd") # => []
30
+
31
+ # Modify the run-time dictionary:
32
+ dict.add("Geburtstagskuchen")
33
+ dict.remove("Fichte")
18
34
 
19
- == Author
20
- Andreas Haller
21
- andreashaller@gmail.com
35
+ == Authors
36
+ Andreas Haller (https://github.com/ahaller) and contributors.
37
+ Full list of contributors: https://github.com/ahaller/hunspell-ffi/contributors
22
38
 
23
39
  == License
24
- Hereby placed under public domain, do what you want, just do not hold me accountable...
40
+ Hereby placed under public domain, do what you want, just do not hold me accountable.
41
+
42
+ == Help wanted
43
+ I hear Hunspell has some superpowers like stemming and some that i never even heard of.
44
+ Maybe you want to help out to bring something of that power into the ruby world.
45
+ Or maybe we can think of a nice way to find to locate .dict files on a system or something.
46
+ Anyways, feel free to fork and send pull requests. kthxbye. Andreas.
47
+
48
+ The source is on GitHub: https://github.com/ahaller/hunspell-ffi
25
49
 
26
- == TODO
27
- Add other hunspell methods (add, remove, analyze, stem ...)
50
+ === TODOs
51
+ Figure out how to use and add hunspell analyzing methods (analyze, stem ...)
28
52
 
29
53
  Test on Windows
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+ Gem::Specification.new do |s|
3
+ s.name = 'hunspell-ffi'
4
+ s.version = '0.1.3.alpha2'
5
+ s.date = '2011-03-23'
6
+ s.authors = ["Andreas Haller"]
7
+ s.email = ["andreashaller@gmail.com"]
8
+ s.homepage = "http://github.com/ahaller/hunspell-ffi"
9
+ s.summary = "A Ruby FFI interface to the Hunspell spelling checker"
10
+
11
+ s.add_dependency 'ffi', '~> 1.0.7'
12
+ s.required_rubygems_version = ">= 1.3.6"
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.require_path = 'lib'
17
+ end
data/lib/hunspell-ffi.rb CHANGED
@@ -22,7 +22,8 @@ class Hunspell
22
22
  def spell(word)
23
23
  C.Hunspell_spell(@handler, word)
24
24
  end
25
- alias_method :check, :spell
25
+ alias_method :check, :spell
26
+ alias_method :check?, :check
26
27
 
27
28
  # Returns an array with suggested words or returns and empty array.
28
29
  def suggest(word)
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 1
8
8
  - 3
9
- - alpha
10
- version: 0.1.3.alpha
9
+ - alpha2
10
+ version: 0.1.3.alpha2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andreas Haller
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-06 00:00:00 +02:00
18
+ date: 2011-03-23 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,13 +24,13 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  segments:
30
+ - 1
30
31
  - 0
31
- - 6
32
- - 3
33
- version: 0.6.3
32
+ - 7
33
+ version: 1.0.7
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  description:
@@ -43,12 +43,17 @@ extensions: []
43
43
  extra_rdoc_files: []
44
44
 
45
45
  files:
46
+ - .gitignore
47
+ - CHANGES
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - README.rdoc
51
+ - Rakefile
52
+ - hunspell-ffi.gemspec
53
+ - lib/hunspell-ffi.rb
46
54
  - test/cakes.aff
47
55
  - test/cakes.dic
48
56
  - test/test_hunspell.rb
49
- - lib/hunspell-ffi.rb
50
- - Rakefile
51
- - README.rdoc
52
57
  has_rdoc: true
53
58
  homepage: http://github.com/ahaller/hunspell-ffi
54
59
  licenses: []
@@ -84,4 +89,6 @@ signing_key:
84
89
  specification_version: 3
85
90
  summary: A Ruby FFI interface to the Hunspell spelling checker
86
91
  test_files:
92
+ - test/cakes.aff
93
+ - test/cakes.dic
87
94
  - test/test_hunspell.rb