Lexitron 2.0.3__tar.gz → 2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Lexitron-2.0.3 → Lexitron-2.0.4/Lexitron.egg-info}/PKG-INFO +1 -1
- {Lexitron-2.0.3 → Lexitron-2.0.4}/Lexitron.egg-info/SOURCES.txt +0 -4
- {Lexitron-2.0.3/Lexitron.egg-info → Lexitron-2.0.4}/PKG-INFO +1 -1
- {Lexitron-2.0.3 → Lexitron-2.0.4}/lexitron/lexitron.py +3 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/setup.cfg +1 -1
- Lexitron-2.0.3/lexitron/dict_util.py +0 -47
- Lexitron-2.0.3/lexitron/words-lower.txt +0 -341145
- Lexitron-2.0.3/lexitron/words-upper.txt +0 -75151
- Lexitron-2.0.3/lexitron/words.txt +0 -466550
- {Lexitron-2.0.3 → Lexitron-2.0.4}/LICENSE +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/Lexitron.egg-info/dependency_links.txt +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/Lexitron.egg-info/entry_points.txt +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/Lexitron.egg-info/not-zip-safe +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/Lexitron.egg-info/requires.txt +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/Lexitron.egg-info/top_level.txt +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/README.md +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/lexitron/__init__.py +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/lexitron/agid-common.txt +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/lexitron/agid-proper.txt +0 -0
- {Lexitron-2.0.3 → Lexitron-2.0.4}/pyproject.toml +0 -0
|
@@ -5,11 +5,7 @@ setup.cfg
|
|
|
5
5
|
./lexitron/__init__.py
|
|
6
6
|
./lexitron/agid-common.txt
|
|
7
7
|
./lexitron/agid-proper.txt
|
|
8
|
-
./lexitron/dict_util.py
|
|
9
8
|
./lexitron/lexitron.py
|
|
10
|
-
./lexitron/words-lower.txt
|
|
11
|
-
./lexitron/words-upper.txt
|
|
12
|
-
./lexitron/words.txt
|
|
13
9
|
Lexitron.egg-info/PKG-INFO
|
|
14
10
|
Lexitron.egg-info/SOURCES.txt
|
|
15
11
|
Lexitron.egg-info/dependency_links.txt
|
|
@@ -64,6 +64,9 @@ class Lexitron:
|
|
|
64
64
|
+ 'be used together.'
|
|
65
65
|
raise LexitronOptionsError(msg)
|
|
66
66
|
|
|
67
|
+
# Get the expression ready.
|
|
68
|
+
expr = self.sanitize(args.expression)
|
|
69
|
+
|
|
67
70
|
# Currently, lexitron search is case-insensitive.
|
|
68
71
|
expr = re.compile(expr, flags=re.IGNORECASE)
|
|
69
72
|
matches = {'common': [], 'proper': []}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# This python script is a utility to separate large dictionary files
|
|
2
|
-
# into lowercase and uppercase (common and proper) parts.
|
|
3
|
-
# These parts are written to two new files.
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
from importlib import resources
|
|
7
|
-
|
|
8
|
-
dictfile = 'words.txt'
|
|
9
|
-
with open(dictfile, 'rb') as f:
|
|
10
|
-
words = f.read()
|
|
11
|
-
f.close()
|
|
12
|
-
|
|
13
|
-
words = words.splitlines()
|
|
14
|
-
words = [word.decode('utf-8') for word in words]
|
|
15
|
-
|
|
16
|
-
lowercase = []
|
|
17
|
-
uppercase = []
|
|
18
|
-
|
|
19
|
-
for word in words:
|
|
20
|
-
word = word.strip()
|
|
21
|
-
|
|
22
|
-
# If there is any punctuation in the word, skip it
|
|
23
|
-
if not word.isalpha():
|
|
24
|
-
continue
|
|
25
|
-
|
|
26
|
-
if word[0].islower():
|
|
27
|
-
lowercase.append(word)
|
|
28
|
-
|
|
29
|
-
elif word[0].isupper():
|
|
30
|
-
uppercase.append(word)
|
|
31
|
-
|
|
32
|
-
else:
|
|
33
|
-
print("Error: {} is neither lowercase nor uppercase".format(word))
|
|
34
|
-
|
|
35
|
-
lowercase = [word for word in lowercase]
|
|
36
|
-
uppercase = [word for word in uppercase]
|
|
37
|
-
|
|
38
|
-
lowercase_file = 'words-lower.txt'
|
|
39
|
-
uppercase_file = 'words-upper.txt'
|
|
40
|
-
|
|
41
|
-
with open(lowercase_file, 'w') as f:
|
|
42
|
-
f.write("\n".join(lowercase))
|
|
43
|
-
f.close()
|
|
44
|
-
|
|
45
|
-
with open(uppercase_file, 'w') as f:
|
|
46
|
-
f.write("\n".join(uppercase))
|
|
47
|
-
f.close()
|