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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Lexitron
3
- Version: 2.0.3
3
+ Version: 2.0.4
4
4
  Summary: A command-line regex search engine for the English language
5
5
  Home-page: http://github.com/rothos/lexitron
6
6
  Author: Rothos
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Lexitron
3
- Version: 2.0.3
3
+ Version: 2.0.4
4
4
  Summary: A command-line regex search engine for the English language
5
5
  Home-page: http://github.com/rothos/lexitron
6
6
  Author: Rothos
@@ -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,6 +1,6 @@
1
1
  [metadata]
2
2
  name = Lexitron
3
- version = 2.0.3
3
+ version = 2.0.4
4
4
  author = Rothos
5
5
  url = http://github.com/rothos/lexitron
6
6
  description = A command-line regex search engine for the English language
@@ -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()