File: use-system-wordnet.patch

package info (click to toggle)
python-pattern 2.6%2Bgit20150109-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 78,672 kB
  • sloc: python: 53,865; xml: 11,965; ansic: 2,318; makefile: 94
file content (27 lines) | stat: -rw-r--r-- 1,028 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Index: python-pattern-2.6+git20150109/pattern/text/en/wordnet/__init__.py
===================================================================
--- python-pattern-2.6+git20150109.orig/pattern/text/en/wordnet/__init__.py
+++ python-pattern-2.6+git20150109/pattern/text/en/wordnet/__init__.py
@@ -28,10 +28,12 @@ try:
 except:
     MODULE = ""
 
+WORDNET_DICT = "/usr/share/wordnet"
+
 # Path to WordNet /dict folder.
 CORPUS = ""
 os.environ["WNHOME"] = os.path.join(MODULE, CORPUS)
-os.environ["WNSEARCHDIR"] = os.path.join(MODULE, CORPUS, "dict")
+os.environ["WNSEARCHDIR"] = WORDNET_DICT
 
 from pywordnet import wordnet as wn
 from pywordnet import wntools
@@ -46,7 +48,7 @@ from pywordnet import wntools
 # - line 1186: _lineAt() seeks in second datafile if offset > EOF first datafile.
 
 VERSION = ""
-s = open(os.path.join(MODULE, CORPUS, "dict", "index.noun")).read(2048)
+s = open(os.path.join(WORDNET_DICT, "index.noun")).read(2048)
 if "WordNet 2.1" in s: VERSION = "2.1"
 if "WordNet 3.0" in s: VERSION = "3.0"
 del s