Skip to content

Commit

Permalink
Merge pull request #4 from MSeal/master
Browse files Browse the repository at this point in the history
Added several 1.2.0 improvements.
  • Loading branch information
MSeal authored May 20, 2017
2 parents 5d88b7e + 8c30749 commit 9994a3a
Show file tree
Hide file tree
Showing 19 changed files with 66,757 additions and 3,975 deletions.
74 changes: 56 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,56 @@
sudo: false
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"

install: "python setup.py install"
script: "python setup.py test"

notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
language: python

matrix:
include:
- os: linux
python: 2.7
- os: osx
python: 2.7
env: PY2=true
sudo: required
language: generic
- os: linux
python: 3.3
- os: osx
python: 3.3
env: PY2=false
sudo: required
language: generic
- os: linux
python: 3.4
- os: osx
python: 3.4
env: PY2=false
sudo: required
language: generic
- os: linux
python: 3.5
- os: osx
python: 3.5
env: PY2=false
sudo: required
language: generic
- os: linux
python: 3.6
- os: osx
python: 3.6
env: PY2=false
sudo: required
language: generic

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PY2" == "true" ]]; then brew upgrade python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PY2" == "true" ]]; then virtualenv venv -p python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PY2" == "false" ]]; then brew install python3; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PY2" == "false" ]]; then virtualenv venv -p python3; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source venv/bin/activate; fi
install: "python setup.py install"
script: "python setup.py test"

notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
6 changes: 5 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



Additionally see libs/license.hunspell for license details on using pre-built binaries provided in library.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ You can also request bulk actions against Hunspell. This will trigger a threaded
(without a gil) request to perform the action requested. Currently just 'suggest'
and 'stem' are bulk requestable.

h.bulk_action('suggest', ['correct', 'incorect'])
h.bulk_suggest(['correct', 'incorect'])
# {'incorect': (u'incorrect', u'correction', u'corrector', u'correct', u'injector'), 'correct': ['correct']}
h.bulk_action('stem', ['stems', 'currencies'])
h.bulk_stem(['stems', 'currencies'])
# {'currencies': [u'currency'], 'stems': [u'stem']}

By default it spawns number of CPUs threads to perform the operation. You can
Expand Down Expand Up @@ -112,7 +112,7 @@ distributions.

### Windows
The base library comes with MSVC built Hunspell libraries and will link
against those during runtime. These were tested on Windows 7 and 8 and
against those during runtime. These were tested on Windows 7, 8, 10 and
some on older systems. It's possible that a Python build with a newer
(or much older) version of MSVC will fail to load these pre-built libraries.

Expand All @@ -121,6 +121,9 @@ So far the library has been tested against 10.9 (Mavericks) and up. There
shoudn't be any reason it would fail to run on any particular version of
OSX.

## Building source libraries
See libs/README

## Navigating the Repo
### hunspell
Package wrapper for the repo.
Expand All @@ -135,6 +138,16 @@ All unit tests for the repo.
## TODO
* Convert cacheman dependency to be optional

## Known Issues
- Exact spelling suggestions on different OS's differs slightly with identical
inputs. This appears to be an issue with Hunspell 1.3 and not this library.
- Older versions of pip and setuptools will build with incorrect windows DLL bindings
and complain about "ImportError: DLL load failed: %1 is not a valid Win32 application."
- Sometimes windows machines won't find the build tools appropiately. You may need
to 'SET VS100COMNTOOLS=%VSxxxCOMNTOOLS%' before installing. Python 3 usually wants the
xxx as '140' and python 2 as '90'. There's not a lot the library can do to fix this,
though pip and setuptools upgrades oftentimes resolve the issue by being smarter.

## Author
Author(s): Tim Rodriguez and Matthew Seal

Expand Down
201 changes: 201 additions & 0 deletions dictionaries/test.aff
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
SET UTF-8
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'
NOSUGGEST !

# ordinal numbers
COMPOUNDMIN 1
# only in compounds: 1th, 2th, 3th
ONLYINCOMPOUND c
# compound rules:
# 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.)
# 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.)
COMPOUNDRULE 2
COMPOUNDRULE n*1t
COMPOUNDRULE n*mp
WORDCHARS 0123456789

PFX A Y 1
PFX A 0 re .

PFX I Y 1
PFX I 0 in .

PFX U Y 1
PFX U 0 un .

PFX C Y 1
PFX C 0 de .

PFX E Y 1
PFX E 0 dis .

PFX F Y 1
PFX F 0 con .

PFX K Y 1
PFX K 0 pro .

SFX V N 2
SFX V e ive e
SFX V 0 ive [^e]

SFX N Y 3
SFX N e ion e
SFX N y ication y
SFX N 0 en [^ey]

SFX X Y 3
SFX X e ions e
SFX X y ications y
SFX X 0 ens [^ey]

SFX H N 2
SFX H y ieth y
SFX H 0 th [^y]

SFX Y Y 1
SFX Y 0 ly .

SFX G Y 2
SFX G e ing e
SFX G 0 ing [^e]

SFX J Y 2
SFX J e ings e
SFX J 0 ings [^e]

SFX D Y 4
SFX D 0 d e
SFX D y ied [^aeiou]y
SFX D 0 ed [^ey]
SFX D 0 ed [aeiou]y

SFX T N 4
SFX T 0 st e
SFX T y iest [^aeiou]y
SFX T 0 est [aeiou]y
SFX T 0 est [^ey]

SFX R Y 4
SFX R 0 r e
SFX R y ier [^aeiou]y
SFX R 0 er [aeiou]y
SFX R 0 er [^ey]

SFX Z Y 4
SFX Z 0 rs e
SFX Z y iers [^aeiou]y
SFX Z 0 ers [aeiou]y
SFX Z 0 ers [^ey]

SFX S Y 4
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxzh]
SFX S 0 s [^sxzhy]

SFX P Y 3
SFX P y iness [^aeiou]y
SFX P 0 ness [aeiou]y
SFX P 0 ness [^y]

SFX M Y 1
SFX M 0 's .

SFX B Y 3
SFX B 0 able [^aeiou]
SFX B 0 able ee
SFX B e able [^aeiou]e

SFX L Y 1
SFX L 0 ment .

REP 88
REP a ei
REP ei a
REP a ey
REP ey a
REP ai ie
REP ie ai
REP are air
REP are ear
REP are eir
REP air are
REP air ere
REP ere air
REP ere ear
REP ere eir
REP ear are
REP ear air
REP ear ere
REP eir are
REP eir ere
REP ch te
REP te ch
REP ch ti
REP ti ch
REP ch tu
REP tu ch
REP ch s
REP s ch
REP ch k
REP k ch
REP f ph
REP ph f
REP gh f
REP f gh
REP i igh
REP igh i
REP i uy
REP uy i
REP i ee
REP ee i
REP j di
REP di j
REP j gg
REP gg j
REP j ge
REP ge j
REP s ti
REP ti s
REP s ci
REP ci s
REP k cc
REP cc k
REP k qu
REP qu k
REP kw qu
REP o eau
REP eau o
REP o ew
REP ew o
REP oo ew
REP ew oo
REP ew ui
REP ui ew
REP oo ui
REP ui oo
REP ew u
REP u ew
REP oo u
REP u oo
REP u oe
REP oe u
REP u ieu
REP ieu u
REP ue ew
REP ew ue
REP uff ough
REP oo ieu
REP ieu oo
REP ier ear
REP ear ier
REP ear air
REP air ear
REP w qu
REP qu w
REP z ss
REP ss z
REP shun tion
REP shun sion
REP shun cion
Loading

0 comments on commit 9994a3a

Please sign in to comment.