Giter Site home page Giter Site logo

hspellpy's Introduction

This is simple python wrapper to Hspell.

Hspell is free Hebrew spellchecker and morphology engine. This is just a python wrapping of Hspell.

You can get Hspell from: http://hspell.ivrix.org.il/

Hspell was written by Nadav Har'El and Dan Kenigsberg:

	nyh    @ math.technion.ac.il
	danken @   cs.technion.ac.il

Install

  1. Get Hspell:
  2. Download Hspell: http://hspell.ivrix.org.il/
  3. Configure: ./configure --enable-shared --enable-linginfo
  4. Build: make
  5. Install: make install
  6. python setup.py install

You can install HspellPy using pip:

pip install HspellPy

If you fail to import HspellPy with the following error:

>>> import HspellPy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libhspell.so.0: cannot open shared object file: No such file or directory

You should validate libhspell.so.0 is accessible in LD_LIBRARY_PATH.

Usage

Usage example (python 3)

>>> from __future__ import unicode_literals
>>> import HspellPy
>>> speller = HspellPy.Hspell(linguistics=True)
 
>>> speller.check_word('בית')       # check whether word exist in dictionary
True
>>> speller.check_word('הבית')      # words with prefix are also valid
True
>>> speller.check_word('בעעעע')     # invalid word
False
>>> 'בית' in speller                # syntactic sugar
True
>>> speller.try_correct('עדג')      # corrections (doesn't correct typo. see Hspell doc)
['הדג', 'עדה']
>>> speller.enum_splits('וילדותיה')   # list all splits of a word
>[WordEnumSplit(word='וילדותיה', baseword='ילדותיה', preflen=1, prefspec=60)]
>>> speller.linginfo('ילדה')        # morphology
[LinginfoWord(word='ילדה', linginfo='פ,נ,3,יחיד,עבר'), 
  LinginfoWord(word='ילדה', linginfo='ע,נ,יחיד'),
  LinginfoWord(word='ילדה', linginfo='ע,ז,יחיד,כינוי/נ,3,יחיד')]

hspellpy's People

Contributors

eranroz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.