91ab0f
From 988372ed85d7317c2f24a956d50e78542728e575 Mon Sep 17 00:00:00 2001
91ab0f
From: Alon Levy <alon@pobox.com>
91ab0f
Date: Thu, 7 Aug 2014 18:33:48 +0300
91ab0f
Subject: [PATCH] pyphen 0.9.1 shared dicts
91ab0f
91ab0f
---
91ab0f
 pyphen.py | 19 ++-----------------
91ab0f
 setup.py  |  6 ------
91ab0f
 2 files changed, 2 insertions(+), 23 deletions(-)
91ab0f
91ab0f
diff --git a/pyphen.py b/pyphen.py
91ab0f
index 4ea1499..06cadd8 100755
91ab0f
--- a/pyphen.py
91ab0f
+++ b/pyphen.py
91ab0f
@@ -42,23 +42,8 @@ hdcache = {}
91ab0f
 parse_hex = re.compile(r'\^{2}([0-9a-f]{2})').sub
91ab0f
 parse = re.compile(r'(\d?)(\D?)').findall
91ab0f
 
91ab0f
-# included dictionaries are available:
91ab0f
-# - at <sys.prefix>/share/pyphen/dictionaries when Pyphen is installed
91ab0f
-# - at <project_root>/dictionaries when Pyphen is not installed
91ab0f
-# - at <pkg_resources>/share/pyphen/dictionaries when Pyphen is in an egg
91ab0f
-try:
91ab0f
-    import pkg_resources
91ab0f
-except ImportError:
91ab0f
-    dictionaries_roots = ()
91ab0f
-else:
91ab0f
-    dictionaries_roots = (os.path.join(
91ab0f
-        pkg_resources.resource_filename('pyphen', ''),
91ab0f
-        'share', 'pyphen', 'dictionaries'),)
91ab0f
-finally:
91ab0f
-    dictionaries_roots += (
91ab0f
-        os.path.join(sys.prefix, 'share', 'pyphen', 'dictionaries'),
91ab0f
-        os.path.join(os.path.dirname(__file__), 'dictionaries'))
91ab0f
-
91ab0f
+# dictionaries provided by hyphen-xx RPM packages, e.g. hyphen-en
91ab0f
+dictionaries_roots = ['/usr/share/hyphen']
91ab0f
 
91ab0f
 LANGUAGES = dict(
91ab0f
     (filename[5:-4], os.path.join(dictionaries_root, filename))
91ab0f
diff --git a/setup.py b/setup.py
91ab0f
index 94022ab..fc54e24 100755
91ab0f
--- a/setup.py
91ab0f
+++ b/setup.py
91ab0f
@@ -21,17 +21,11 @@ classifiers = [
91ab0f
     'Topic :: Text Processing :: Linguistic',
91ab0f
 ]
91ab0f
 
91ab0f
-_dict_folder = os.path.join(os.path.dirname(__file__), 'dictionaries')
91ab0f
 setup(
91ab0f
     name='Pyphen',
91ab0f
     version='0.9.1',
91ab0f
     py_modules=['pyphen'],
91ab0f
     provides=['pyphen'],
91ab0f
-    data_files=[(
91ab0f
-        os.path.join('share', 'pyphen', 'dictionaries'), (
91ab0f
-            os.path.join(_dict_folder, filename)
91ab0f
-            for filename in os.listdir(_dict_folder)
91ab0f
-            if filename.endswith('.dic')))],
91ab0f
     author='Guillaume Ayoub',
91ab0f
     author_email='guillaume.ayoub@kozea.fr',
91ab0f
     url='https://github.com/Kozea/Pyphen',
91ab0f
-- 
91ab0f
1.9.3
91ab0f