mindwords 0.6.7 → 0.7.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -3
- data/lib/mindwords.rb +44 -2
- data.tar.gz.sig +0 -0
- metadata +8 -9
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d7be53f70e76eda32325d70cce4e3eb690799b1403440eaff8329929dc4082c
|
4
|
+
data.tar.gz: fa87c01d3bff8ff57506fbb0eb801ff7d881dc2aff607fbc0142e457e658b005
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f01791819abc0b4a78b2573c2513b5dc929142a318bf30d0f3c052ea1b654e03d0462c3fddae891be170d23b03d5fa4512dedd5c85b678ac633481d3bdecd798
|
7
|
+
data.tar.gz: b99eec4aa8a9a47c3e73b690727cbcc7bf16a1c0f43699fb399f309c8a752d94c7eb5128c5df998679ea0fdc1eeca14d005954e5476a75e74b0d59ef8ac1181f
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
cm� �����|>��c���I���"�g`��qm��|)f�S�܈0��8�qj�a���ޡ��ͧ.4y槟�]���&����V�W̓X����S�����5�9O�H�{�G��XEjE���.�,�G��1,y.�6�jD��[�̜gS)�օ�P3~����8K��S+@�/h���A#�*��*b�E�pVZ����h�\5U���^�M��S�fNYu������]p�]�!7�������v⮼k����I��{�<���6�8��ee�D^x;�Z�'=����]FJP|�@<=��c&2 \�F�3��Zj��
|
1
|
+
M:�e5ja8�>���
|
2
|
+
� �6�$zfI�՛��
|
data/lib/mindwords.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# file: mindwords.rb
|
4
4
|
|
5
5
|
require 'rexle'
|
6
|
-
require '
|
6
|
+
require 'rxfreadwrite'
|
7
7
|
require 'line-tree'
|
8
8
|
|
9
9
|
module HashCopy
|
@@ -19,8 +19,9 @@ end
|
|
19
19
|
class MindWords
|
20
20
|
using ColouredText
|
21
21
|
using HashCopy
|
22
|
-
include
|
22
|
+
include RXFReadWriteModule
|
23
23
|
|
24
|
+
attr_reader :words_missing
|
24
25
|
attr_accessor :lines, :filepath
|
25
26
|
|
26
27
|
def initialize(raws='', parent: nil, debug: false)
|
@@ -345,6 +346,7 @@ class MindWords
|
|
345
346
|
|
346
347
|
a = rexlize(h)
|
347
348
|
doc = Rexle.new(['root', {}, '', *a])
|
349
|
+
puts 'doc.xml: ' + doc.xml(pretty: true) if @debug
|
348
350
|
|
349
351
|
# apply node nesting
|
350
352
|
|
@@ -361,6 +363,7 @@ class MindWords
|
|
361
363
|
|
362
364
|
end
|
363
365
|
|
366
|
+
puts 'after nesting; doc.xml: ' + doc.xml(pretty: true) if @debug
|
364
367
|
|
365
368
|
# remove duplicates which appear in the same branch above the nested node
|
366
369
|
rm_duplicates(doc)
|
@@ -408,6 +411,45 @@ class MindWords
|
|
408
411
|
|
409
412
|
@outline = treeize node
|
410
413
|
|
414
|
+
# ----
|
415
|
+
|
416
|
+
# It's common for words to be missing from the outline, either because
|
417
|
+
# they have erroneously been flagged as redundant or lack specific hashtag
|
418
|
+
# context. Below, we attempt to identify the missing words with a
|
419
|
+
# suggestion on how to fix it.
|
420
|
+
|
421
|
+
words = @outline.lines.map(&:strip)
|
422
|
+
orig_words = to_s().lines.map {|x| x[/^[^#]+(?= #)/]}.compact
|
423
|
+
@words_missing = orig_words - words
|
424
|
+
|
425
|
+
if @words_missing.any? then
|
426
|
+
|
427
|
+
tags = []
|
428
|
+
@words_missing.inject(tags) do |r,word|
|
429
|
+
|
430
|
+
found = to_s().lines.grep(/#{word}/)
|
431
|
+
|
432
|
+
if found then
|
433
|
+
r << found.first.scan(/#\w+/).map {|x| x[1..-1]}
|
434
|
+
else
|
435
|
+
r
|
436
|
+
end
|
437
|
+
|
438
|
+
end
|
439
|
+
|
440
|
+
add_sugg = tags.uniq.map do |atag|
|
441
|
+
("%s #%s" % [atag[0], atag[1]]).bg_black
|
442
|
+
end
|
443
|
+
|
444
|
+
puts ('@words_missing: ' + @words_missing.join(', ') ).warn
|
445
|
+
puts "suggestion: try adding the following:".info
|
446
|
+
puts add_sugg.join("\n")
|
447
|
+
puts
|
448
|
+
|
449
|
+
end
|
450
|
+
|
451
|
+
# ----
|
452
|
+
|
411
453
|
node.root.each_recursive do |e|
|
412
454
|
|
413
455
|
e.attributes[:id] = e.attributes[:title].downcase.gsub(/ +/,'-')
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mindwords
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
eUqhPOSrxIRLebVebvo/SHN6+ed3Q1tXowsbLGCT9QwqbaZ5MZ7zks92mIWeJvsA
|
36
36
|
JdpabIXfcOANNKd0ha4NO+Yu
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-03-15 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: line-tree
|
@@ -58,25 +58,25 @@ dependencies:
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: 0.9.3
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
|
-
name:
|
61
|
+
name: rxfreadwrite
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
66
|
+
version: '0.2'
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 0.2.5
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '0.2'
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
79
|
+
version: 0.2.5
|
80
80
|
description:
|
81
81
|
email: digital.robertson@gmail.com
|
82
82
|
executables: []
|
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
|
107
|
-
rubygems_version: 2.7.10
|
106
|
+
rubygems_version: 3.2.22
|
108
107
|
signing_key:
|
109
108
|
specification_version: 4
|
110
109
|
summary: Helps get what's in your mind into a structure using words and hashtags.
|
metadata.gz.sig
CHANGED
Binary file
|