# spell checker backend) and distribute linked combinations including
# the two.  You must obey the GNU Lesser General Public License in all
# respects for all of the code used other than said providers.  If you modify
# this file, you may extend this exception to your version of the
# file, but you are not obligated to do so.  If you do not wish to
# do so, delete this exception statement from your version.
#

import importlib
import gtk
import gobject
from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())

printf = enchant_utils.printf
unicode = enchant_utils.unicode

# from enchant.utils import printf, unicode

#   columns
COLUMN_SUGGESTION = 0


def create_list_view(col_label, ):
    # create list widget
    list_ = gtk.ListStore(str)
    list_view = gtk.TreeView(model=list_)
Пример #2
0
"""

    enchant.tokenize.en:    Tokenizer for the English language

    This module implements a PyEnchant text tokenizer for the English
    language, based on very simple rules.

"""

import importlib
import unicodedata
from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant_tokenize = importlib.import_module('.tokenize', EnchantArchitecture())
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())

unicode = enchant_utils.unicode

# import enchant.tokenize
# from enchant.utils import unicode


class tokenize(enchant.tokenize.tokenize):
    """Iterator splitting text into words, reporting position.

    This iterator takes a text string as input, and yields tuples
    representing each distinct word found in the text.  The tuples
    take the form:
Пример #3
0
import importlib
import os
import sys
import unittest
import pickle
try:
    import subprocess
except ImportError:
    subprocess = None

from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant = importlib.import_module(EnchantArchitecture())
_e = importlib.import_module('._enchant', EnchantArchitecture())
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())

unicode = enchant_utils.unicode
raw_unicode = enchant_utils.raw_unicode
printf = enchant_utils.printf
trim_suggestions = enchant_utils.trim_suggestions

# import enchant
# from enchant import *
# from enchant import _enchant as _e
# from enchant.utils import unicode, raw_unicode, printf, trim_suggestions


def runcmd(cmd, **kwds):
Пример #4
0
    * string/unicode compatibility wrappers
    * functions for dealing with locale/language settings
    * ability to list supporting data files (win32 only)
    * functions for bundling supporting data files from a build

"""

import importlib
import codecs
import os
import sys
from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant_errors = importlib.import_module('.errors', EnchantArchitecture())

#from enchant.errors import *

# Attempt to access local language information
try:
    import locale
except ImportError:
    locale = None

#
#  Unicode/Bytes compatibility wrappers.
#
#  These allow us to support both Python 2.x and Python 3.x from
#  the same codebase.
#
Пример #5
0
# Make version info available
__ver_major__ = 2
__ver_minor__ = 0
__ver_patch__ = 0
__ver_sub__ = ""
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__, __ver_patch__,
                              __ver_sub__)

import importlib
import os
from enchant_architecture import EnchantArchitecture

try:
    # use dynamic import commands to support different folder structures
    # for Windows 32-bit and 64-bit support
    _e = importlib.import_module('._enchant', EnchantArchitecture())
    #from enchant import _enchant as _e
except ImportError:
    if not os.environ.get("PYENCHANT_IGNORE_MISSING_LIB", False):
        raise
    _e = None

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant_errors = importlib.import_module('.errors', EnchantArchitecture())
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())
enchant_pypwl = importlib.import_module('.pypwl', EnchantArchitecture())

EnchantStr = enchant_utils.EnchantStr
get_default_language = enchant_utils.get_default_language
UTF16EnchantStr = enchant_utils.UTF16EnchantStr
Пример #6
0
# file, but you are not obligated to do so.  If you do not wish to
# do so, delete this exception statement from your version.
#
"""

    enchant.checker.tests:  Unittests for enchant SpellChecker class

"""

import importlib
import unittest
from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant = importlib.import_module(EnchantArchitecture())
enchant_tokenize = importlib.import_module('.tokenize', EnchantArchitecture())
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())
enchant_errors = importlib.import_module('.errors', EnchantArchitecture())
enchant_checker = importlib.import_module('.checker', EnchantArchitecture())

SpellChecker = enchant_checker.SpellChecker

# import enchant
# import enchant.tokenize
# from enchant.utils import *
# from enchant.errors import *
# from enchant.checker import *


class TestChecker(unittest.TestCase):
    enchant.checker.CmdLineChecker:  Command-Line spell checker

    This module provides the class CmdLineChecker, which interactively
    spellchecks a piece of text by interacting with the user on the
    command line.  It can also be run as a script to spellcheck a file.

"""

import importlib
import sys
from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant_checker = importlib.import_module('.checker', EnchantArchitecture())
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())

SpellChecker = enchant_checker.SpellChecker
printf = enchant_utils.printf

# from enchant.checker import SpellChecker
# from enchant.utils import printf

try:
    get_input = raw_input  # Python 2.x
except NameError:
    get_input = input  # Python 3.x

# Helpers
Пример #8
0
"""
_DOC_ERRORS = [
    "pos", "pos", "tknzr", "URLFilter", "WikiWordFilter", "tkns", "tknzr",
    "pos", "tkns"
]

import importlib
import re
import warnings
import array
from enchant_architecture import EnchantArchitecture

# use dynamic import commands to support different folder structures
# for Windows 32-bit and 64-bit support
enchant = importlib.import_module(EnchantArchitecture())
enchant_utils = importlib.import_module('.utils', EnchantArchitecture())
enchant_errors = importlib.import_module('.errors', EnchantArchitecture())

next = enchant_utils.next
xrange = enchant_utils.xrange

# import enchant
# from enchant.utils import next, xrange
# from enchant.errors import *

#  For backwards-compatibility.  This will eventually be removed, but how
#  does one mark a module-level constant as deprecated?
Error = enchant_errors.TokenizerNotFoundError