LittleWeasel 5.0.3 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 660a032ce9305f5b3ea781e2c8c6e69f353463d87cf6a735be13c9ee47e0329d
4
- data.tar.gz: 6d55d4091eae71f72c994f1f467a4f534a6a64a3654734b745304255cf9114b6
3
+ metadata.gz: 518d900219064961b4d1f343fa303dff75105c2c36f2c00b542dac4894bc5efe
4
+ data.tar.gz: cf820c4c97f197df2d7b6300bd31530d9a57bca26cdea57810706ed5a0a82fb3
5
5
  SHA512:
6
- metadata.gz: ecfd9806d8f39779c1e65b225a4593b05d59e3cdb6ce25ae1a1be0410d6f7a02205205882e33b7d621142e1ae43008866db689d9ac34c6819607219ee1800de9
7
- data.tar.gz: 13cf23ef8f666fdd15b2f826c25cd4096f9298ae183f46bfcac1c5c1a03b7c4042db7e60ba625076714fe12d7451fea6349d0baaed909fccbdb19b35acc95b08
6
+ metadata.gz: 04c00544d23c129b14de2cab062256fb36f61255eb6f12c2227a14c77e88529979cc717d11707b81f2bdcf3265a9b9926c020b7a18f41439be27f68c7e8f5b4f
7
+ data.tar.gz: 6880772d028fde2a2b224bd7c7df9bd3ec250058e7a7404dab039ad03e0dd548cf0b9622a7963aab71c65c953819801f7cde20141034f3b0e8c34c6a6c10a25b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 5.0.4
2
+ * changes
3
+ * Fix README.md erroneous references to WordResults#successful? (should be #success?)
4
+ * Gem update.
1
5
  ### 5.0.3
2
6
  * changes
3
7
  * Update gems to patch CVE.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- LittleWeasel (5.0.3)
4
+ LittleWeasel (5.0.4)
5
5
  activesupport (~> 6.1, >= 6.1.3.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -28,12 +28,12 @@
28
28
 
29
29
  # About LittleWeasel
30
30
 
31
- **LittleWeasel** is _more_ than just a spell checker for words (and word blocks, i.e. groups of words); LittleWeasel provides information about a particular word(s) through its API. LittleWeasel allows you to apply preprocessing to words through any number of word preprocessors _before_ they are checked against the dictionary(ies) you provide. In addition to this, you may provide any number of word filters that allow you to consider the validity of each word being checked, regardless of whether or not it's literally found in the dictionary. LittleWeasel will tell you exactly what word preprocessors were applied to a given word, even showing you the transformation of the original word as it passes through each preprocessor; it will also inform you of each matching word filters along the way, so you can make a decision about every word being validated.
31
+ **LittleWeasel** is _more_ than just a spell checker for words (and word blocks, i.e. groups of words); LittleWeasel provides information about a particular word(s) through its API. LittleWeasel allows you to apply preprocessing to words through any number of word preprocessors _before_ they are checked against the dictionary(ies) you provide. In addition to this, you may provide any number of word filters that allow you to consider the validity of each word being checked, regardless of whether or not it's literally found in the dictionary. LittleWeasel will tell you exactly what word preprocessors were applied to a given word, even showing you the transformation of the original word as it passes through each preprocessor; it will also inform you of each matching word filters along the way, so you can make a decision about every word being validated.
32
32
 
33
33
  LittleWeasel provides other features as well:
34
34
 
35
35
  * LittleWeasel allows you to provide any number of "dictionaries" which may be in the form of a collecton of words in a file on disk _or_ an Array of words you provide, so that dictionaries may be created _dynamically_.
36
- * Dictionaries are identified by a unique "dictionary key"; that is, a key based on locale (<language>-<REGION>, e.g. en-US) and/or optional "tag" (en-US-<tag>, e.g. en-US-slang).
36
+ * Dictionaries are identified by a unique "dictionary key"; that is, a key based on locale (<language>-<REGION>, e.g. en-US) and/or optional "tag" (en-US-<tag>, e.g. en-US-slang).
37
37
  * Dictionaries created from files on disk are cached; their words and metadata are shared across dictionary instances that share the same dictionary key.
38
38
  * Dictionaries can have observable, metadata objects attached to them which are notified when a word or word block is being evaluated; therefore, metadata about the dictionary, words, etc. can be gathered and used. For example, LittleWeasel uses a LittleWeasel::Metadata::InvalidWordsMetadata metadata object that caches and keeps track of the total bytes of invalid words searched against the dictionary. If the total bytes of invalid words exceeds what is set in the configuration, caching of invalid words ceases. You can create your own metadata objects to gather and use your own metadata.
39
39
 
@@ -41,7 +41,7 @@ LittleWeasel provides other features as well:
41
41
 
42
42
  At its most basic level, there are three (3) steps to using LittleWeasel:
43
43
  1. Create a **LittleWeasel::Dictionary** object.
44
- 2. Consume the **LittleWeasel::Dictionary#word_results** and/or **LittleWeasel::Dictionary#block_results** APIs to obtain a **LittleWeasel::WordResults** [^1] object for a particular word or word block.
44
+ 2. Consume the **LittleWeasel::Dictionary#word_results** and/or **LittleWeasel::Dictionary#block_results** APIs to obtain a **LittleWeasel::WordResults** [^1] object for a particular word or word block.
45
45
  3. Interrogate the **LittleWeasel::WordResults** [^1] object returned from either of the aforementioned APIs.
46
46
 
47
47
  Some of the more advanced LittleWeasel features include the use of **word preprocessors**, **word filters** and **dictionary metadata modules**; for these, read on.
@@ -111,32 +111,32 @@ block_results = en_us_dictionary.block_results word_block
111
111
  # Results of calling #word_block with:
112
112
  # "This is a word-block of 8 words and 2 numbers."...
113
113
  block_results #=>
114
- preprocessed_words_or_original_words #=>
114
+ preprocessed_words_or_original_words #=>
115
115
  ["This", "is", "a", "word-block", "of", "8", "words", "and", "2", "numbers"]
116
-
116
+
117
117
  word_results[0] #=>
118
118
  # The word before any word preprocessors have been applied.
119
119
  original_word #=> "This"
120
-
120
+
121
121
  # The word after all word preprocessors have been applied against
122
122
  # the word.
123
123
  preprocessed_word #=> nil
124
-
124
+
125
125
  # Indicates whether or not the word was found in the literal
126
126
  # dictionary (#word_valid?) OR if the word (after word preprocessing)
127
127
  # was matched against a word filter (#filter_match?).
128
128
  success? #=> false
129
-
130
- # Indicates whether or not word (after word preprocessing) was found
129
+
130
+ # Indicates whether or not word (after word preprocessing) was found
131
131
  # in the literal dictionary.
132
132
  word_valid? #=> false
133
-
133
+
134
134
  # Indicates whether or not the word is cached, either as a word found
135
135
  # in the literal dictionary OR as an invalid word. The latter will
136
136
  # only take place if LittleWeasel::Configuration#max_invalid_words_bytesize
137
137
  # is greater than 0.
138
138
  word_cached? #=> false
139
-
139
+
140
140
  # Indicates whether or not #preprocessed_word is present due to
141
141
  # word having passed through one or more word preprocessors. This
142
142
  # will only return true if word preprocessors are available to the
@@ -145,25 +145,25 @@ block_results #=>
145
145
  # AND the word meets the criteria for word preprocessing for one or
146
146
  # more word preprocessors (LittleWeasel::Preprocessors::WordPreprocessor#preprocess?).
147
147
  preprocessed_word? #=> false
148
-
148
+
149
149
  # Returns #preprocessed_word if word preprocessing has been applied
150
150
  # or original_word if word preprocessing has NOT been applied.
151
151
  preprocessed_word_or_original_word #=> "This"
152
-
153
- # Indicates whether or not word has been matched by at least 1
152
+
153
+ # Indicates whether or not word has been matched by at least 1
154
154
  # word filter.
155
155
  filter_match? #=> false
156
-
156
+
157
157
  # Indicates the word filters that were matched against
158
158
  # word (LittleWeasel::Filters::WordFilter#filter_match?). If
159
159
  # word did not match any word filters, an empty Array is returned.
160
160
  filters_matched #=> []
161
-
161
+
162
162
  # Indicates the word preprocessors that were applied against
163
163
  # word. If no word preprocessors were applied to word, an empty
164
164
  # Array is returned.
165
165
  preprocessed_words #=> []
166
-
166
+
167
167
  word_results[1] #=>
168
168
  original_word #=> "is"
169
169
  preprocessed_word #=> nil
@@ -297,13 +297,13 @@ en_us_names_dictionary.add_filters word_filters: [LittleWeasel::Filters::EnUs::S
297
297
  word_results = en_us_names_dictionary.word_results 'elijah'
298
298
 
299
299
  # Returns true if the word is found in the literal dictionary (#word_valid?) or
300
- # if the word matched any word filters (#filter_match?). true is returned because
300
+ # if the word matched any word filters (#filter_match?). true is returned because
301
301
  # 'elijah' ('Elijah' after preprocessing) was found in the literal dictionary,
302
302
  # despite not having matched any word filters.
303
- word_results.successful?
303
+ word_results.success?
304
304
  #=> true
305
305
 
306
- # Returns true because 'elijah' ('Elijah' after preprocessing) was found in the
306
+ # Returns true because 'elijah' ('Elijah' after preprocessing) was found in the
307
307
  # literal dictionary.
308
308
  word_results.word_valid?
309
309
  #=> true
@@ -333,17 +333,17 @@ word_results.preprocessed_word
333
333
  # Search for a word that does not exist in the literal dictionary, but matches a filter...
334
334
 
335
335
  # Because of the LittleWeasel::Filters::EnUs::SingleCharacterWordFilter word filter,
336
- # "i" ("I" after word preprocessing) will be considered valid, even though it's not
336
+ # "i" ("I" after word preprocessing) will be considered valid, even though it's not
337
337
  # literally found in the dictionary.
338
338
  word_results = en_us_names_dictionary.word_results 'i'
339
339
 
340
340
  # true is returned because 'i' ('I' after preprocessing) was matched against the
341
341
  # LittleWeasel::Filters::EnUs::SingleCharacterWordFilter word filter, despite not
342
342
  # having been found in the literal dictionary.
343
- word_results.successful?
343
+ word_results.success?
344
344
  #=> true
345
345
 
346
- # Returns false because 'i' ('I' after preprocessing) was not found in the
346
+ # Returns false because 'i' ('I' after preprocessing) was not found in the
347
347
  # literal dictionary.
348
348
  word_results.word_valid?
349
349
  #=> false
@@ -2,5 +2,5 @@
2
2
 
3
3
  # The version of this gem
4
4
  module LittleWeasel
5
- VERSION = '5.0.3'
5
+ VERSION = '5.0.4'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: LittleWeasel
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gene M. Angelo, Jr.