Programming Freaks  | دورات ومقالات برمجيه

Please login or register.

Login with username, password and session length
Advanced search  

News:

Programming-Fr34ks.net
Up and running

Author Topic: pyenchant للتدقيق الإملائى  (Read 375 times)

Striky

  • Helping Freak
  • Administrator
  • Posting Freak
  • *****
  • Posts: 252
    • View Profile
    • WWW
    • Email
pyenchant للتدقيق الإملائى
« on: October 02, 2009, 08:46:36 PM »
هى باكيج بتسمحلنا بإستخدام enchant فى بايثون
http://www.abisource.com/projects/enchant/

الإستخدام مباشر
Code: [Select]
>>> import enchant as  e

>>> e
<module 'enchant' from '/usr/lib/python2.6/site-packages/enchant/__init__.pyc'>
Code: [Select]
>>> endict=e.Dict("en_US")

هنا نشوف هل الكلمة موجودة فى القاموس او لأ ؟
Code: [Select]
>>> endict.check("hello")

True

>>> endict.check("helo")

False
هنا بنشوف الإقتراحات للكلمة الخاطئة
Code: [Select]
>>> endict.suggest("helo")

['hole', 'help', 'helot', 'hello', 'halo', 'hero', 'hell', 'held', 'helm', 'he lo', 'he-lo']
فى امثلة تحت checker ل GtkSpellCheckerDialog و wxSpellCheckerDialog

للمزيد استخدم help

http://github.com/rfk/pyenchant


« Last Edit: October 02, 2009, 08:50:25 PM by Ahmed Youssef »
Logged

Life is just a chance to grow a soul. - A. Powell
Weblog: http://ahmedyoussef.wordpress.com/