mk_semi_lattice 0.4.1 → 0.4.3
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
- data/README.org +7 -11
- data/lib/Rakefile +32 -0
- data/lib/abbrev_checker/abbrev_check.rb +92 -0
- data/lib/abbrev_checker/abbrev_sample.tgz +0 -0
- data/lib/abbrev_checker/abbrev_yamls/command_tree.yaml +19 -0
- data/lib/abbrev_checker/abbrev_yamls/initialism_tree.yaml +13 -0
- data/lib/abbrev_checker/check_log.yaml +13 -0
- data/lib/abbrev_checker/docs/abbrev_checker/abbrev_checker.001.png +0 -0
- data/lib/abbrev_checker/docs/abbrev_checker/abbrev_checker.002.png +0 -0
- data/lib/abbrev_checker/docs/abbrev_checker/abbrev_checker.003.png +0 -0
- data/lib/abbrev_checker/docs/abbrev_checker.key +0 -0
- data/lib/abbrev_checker/docs/readme.html +141 -0
- data/lib/abbrev_checker/docs/readme.org +46 -0
- data/lib/abbrev_checker/word_log.yaml +18 -0
- data/lib/hc.rb +23 -3
- data/lib/mk_semi_lattice/version.rb +1 -1
- data/lib/mk_stack/docs/mk_stack/mk_stack.001.png +0 -0
- data/lib/mk_stack/docs/mk_stack.key +0 -0
- data/lib/mk_stack/docs/readme.html +14 -11
- data/lib/mk_stack/docs/readme.org +3 -0
- data/lib/mk_stack/mk_stack.rb +16 -2
- data/lib/voca_buil/.vscode/settings.json +4 -0
- data/lib/voca_buil/docs/readme.html +59 -37
- data/lib/voca_buil/docs/readme.org +22 -8
- data/lib/voca_buil/docs/voca_buil/voca_buil.001.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.002.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.003.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.004.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.005.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.006.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.007.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.008.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.009.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.010.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.011.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.012.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.013.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.014.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.015.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.016.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.017.png +0 -0
- data/lib/voca_buil/docs/voca_buil/voca_buil.018.png +0 -0
- data/lib/voca_buil/docs/voca_buil.key +0 -0
- data/lib/voca_buil/etymological_builder_check_sample.tgz +0 -0
- data/lib/voca_buil/multi_check.rb +48 -14
- data/lib/voca_buil/project.code-workspace +5 -0
- data/readme.html +143 -0
- metadata +52 -5
- data/lib/voca_buil/check_log.yaml +0 -37
- data/lib/voca_buil/word_log.yaml +0 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e233dadfbe8cb5a119c2ecd860fe0c57794f7115e0893e4ab55f65c8ea8ceac3
|
|
4
|
+
data.tar.gz: 3e8fa60d754b97e5767e7a4e6c96b5955978615d0b1e2a814d1a0ff7dae5abdc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e8eb468407e8adf5353361accef25c67f134d17ad267df993bf34bbadaf9eca25255bd66694a44f55e5fd352d4ea81d7a7098392cdd7c39947eb523db2c153a
|
|
7
|
+
data.tar.gz: 6ab1c2517e7cd158a41a9d25d2a5da34db3ae699acbc31884fefca0da07829b8ec2c44e1f884a3eba24b40070171511aadad2fa4d36349eead0fada7cf498937
|
data/README.org
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
英単語の習得を目指したhcコマンドです.
|
|
13
13
|
|
|
14
14
|
* Installation
|
|
15
|
-
'mk_semi_lattice' depends on 'ruby2d'.
|
|
15
|
+
'mk_semi_lattice' or 'hc view' depends on 'ruby2d'.
|
|
16
16
|
See the installation manual on [[https://www.ruby2d.com/learn/linux/#install-packages][https://www.ruby2d.com]].
|
|
17
17
|
|
|
18
18
|
Install the gem and add to the application's Gemfile by executing:
|
|
@@ -32,17 +32,13 @@ gem install mk_semi_lattice
|
|
|
32
32
|
#+begin_src bash
|
|
33
33
|
> hc -h
|
|
34
34
|
Commands:
|
|
35
|
-
hc check # check word for vocabulary builder
|
|
36
|
-
hc help [COMMAND] # Describe available commands or one specific command
|
|
37
|
-
hc split_pdf # split PDF files
|
|
38
|
-
hc stack # make stacks
|
|
39
|
-
hc view # View Semi Lattice Graph
|
|
40
35
|
#+end_src
|
|
41
|
-
|
|
42
|
-
- [[./lib/
|
|
43
|
-
- [
|
|
44
|
-
- [[./lib/
|
|
45
|
-
- [[./lib/
|
|
36
|
+
- [[./lib/abbrev_checker/docs/readme.org][hc abbrev]] # check abbreviations
|
|
37
|
+
- [[./lib/voca_buil/docs/readme.org][hc check]] # check word for vocabulary builder
|
|
38
|
+
- hc help [COMMAND] # Describe available commands or one specific command
|
|
39
|
+
- [[./lib/split_pdf/docs/readme.org][hc split_pdf]] # split PDF files
|
|
40
|
+
- [[./lib/mk_stack/docs/readme.org][hc stack]] # make stacks
|
|
41
|
+
- [[./lib/mk_semi_lattice/docs/readme.org][hc view]] # View Semi Lattice Graph
|
|
46
42
|
|
|
47
43
|
* Development
|
|
48
44
|
To install this gem onto your local machine, run
|
data/lib/Rakefile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
require "colorize"
|
|
3
|
+
require 'command_line/global'
|
|
4
|
+
|
|
5
|
+
task :default do
|
|
6
|
+
system "rake -T"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
namespace :develop do
|
|
10
|
+
desc "clean up dirs"
|
|
11
|
+
task :tidy do # any name on task_name
|
|
12
|
+
# your code goes
|
|
13
|
+
['**/check_log.yaml',
|
|
14
|
+
'./check_log.yaml',
|
|
15
|
+
'**/word_log.yaml',
|
|
16
|
+
'./word_log.yaml'].each do |file|
|
|
17
|
+
p comm = "rm -f #{file}"
|
|
18
|
+
system comm
|
|
19
|
+
end
|
|
20
|
+
exit
|
|
21
|
+
end
|
|
22
|
+
desc "mk sample tgz"
|
|
23
|
+
task :mk_tgz do # any name on task_name
|
|
24
|
+
# your code goes
|
|
25
|
+
t_name= "abbrev_sample.tgz"
|
|
26
|
+
dirs = "abbrev_yamls"
|
|
27
|
+
p comm = "tar -cvf #{t_name} #{dirs}"
|
|
28
|
+
system comm
|
|
29
|
+
exit
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# !/usr/bin/env ruby
|
|
2
|
+
require 'thor'
|
|
3
|
+
require 'optparse'
|
|
4
|
+
require 'colorize'
|
|
5
|
+
require 'yaml'
|
|
6
|
+
require 'date'
|
|
7
|
+
require_relative '../voca_buil/multi_check' # VocaBuilを親クラスとして利用
|
|
8
|
+
|
|
9
|
+
module AbbrevCheck
|
|
10
|
+
class OptionParserWrapper < VocaBuil::OptionParserWrapper
|
|
11
|
+
# 必要ならここでオプションのデフォルト値などを上書き
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class BaseCheck < VocaBuil::BaseCheck
|
|
15
|
+
# 選択肢を作らず、単語を直接入力させる
|
|
16
|
+
def get_user_inputs(words_shuffled, w_num)
|
|
17
|
+
user_inputs = []
|
|
18
|
+
words_shuffled.first(w_num).each_with_index do |ew, idx|
|
|
19
|
+
break if ew.nil?
|
|
20
|
+
question = "Q#{idx+1}: '#{ew[0]}' ? -> "
|
|
21
|
+
if ENV['SIMPLE_CHECK_TEST']
|
|
22
|
+
puts question
|
|
23
|
+
user_inputs << ew[1] # テスト時は正解を自動入力
|
|
24
|
+
else
|
|
25
|
+
input = Thor::Shell::Basic.new.ask question
|
|
26
|
+
user_input = input ? input.chomp.unicode_normalize(:nfkc) : ""
|
|
27
|
+
user_inputs << user_input
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
user_inputs
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# 入力が正解と完全一致するか判定
|
|
34
|
+
def check_results(words_shuffled, user_inputs, w_num)
|
|
35
|
+
results = {}
|
|
36
|
+
[w_num, words_shuffled.size].min.times do |i|
|
|
37
|
+
ans = words_shuffled[i]
|
|
38
|
+
next if ans.nil?
|
|
39
|
+
user_input = user_inputs[i]
|
|
40
|
+
print "'#{user_input}' "
|
|
41
|
+
if user_input == ans[1]
|
|
42
|
+
print "true: ".green
|
|
43
|
+
t_or_f = 't'
|
|
44
|
+
else
|
|
45
|
+
print "false: ".red
|
|
46
|
+
t_or_f = 'f'
|
|
47
|
+
end
|
|
48
|
+
p ans
|
|
49
|
+
results[ans[0]] = t_or_f
|
|
50
|
+
end
|
|
51
|
+
results
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# runメソッドを上書き
|
|
55
|
+
def run
|
|
56
|
+
selector = WordsSelector.new(@word_log_file, @options)
|
|
57
|
+
words_shuffled = selector.select(@options[:w_num], @options[:a_num])
|
|
58
|
+
user_inputs = get_user_inputs(words_shuffled, @options[:w_num])
|
|
59
|
+
results = check_results(words_shuffled, user_inputs, @options[:w_num])
|
|
60
|
+
update_logs(results)
|
|
61
|
+
results
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class WordsSelector < VocaBuil::WordsSelector
|
|
66
|
+
# 必要ならここで上書き
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class IterativeCheck < VocaBuil::IterativeCheck
|
|
70
|
+
# 必要ならここで上書き
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
class InstallCheckSample < VocaBuil::InstallCheckSample
|
|
74
|
+
def initialize(tgz_file = 'abbrev_sample.tgz')
|
|
75
|
+
# abbrev_checker ディレクトリを基準にパスを解決
|
|
76
|
+
@tgz_file = File.join(File.dirname(__FILE__), tgz_file)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if __FILE__ == $0
|
|
82
|
+
options = AbbrevCheck::OptionParserWrapper.parse
|
|
83
|
+
if options[:install]
|
|
84
|
+
AbbrevCheck::InstallCheckSample.new.run
|
|
85
|
+
exit
|
|
86
|
+
end
|
|
87
|
+
if options[:iter]
|
|
88
|
+
AbbrevCheck::IterativeCheck.new(options, options[:iter]).run
|
|
89
|
+
else
|
|
90
|
+
AbbrevCheck::BaseCheck.new(options).run
|
|
91
|
+
end
|
|
92
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
ls=list:
|
|
3
|
+
ls -lat=list long all time:
|
|
4
|
+
mv=move:
|
|
5
|
+
cp=copy:
|
|
6
|
+
pwd=print working directory:
|
|
7
|
+
mkdir=make directory:
|
|
8
|
+
rm=remove:
|
|
9
|
+
rm -rf=PATHを再帰的で強制的に削除=remove recursively forcefully:
|
|
10
|
+
cd=change directory:
|
|
11
|
+
c-a=ahead:
|
|
12
|
+
c-e=end:
|
|
13
|
+
c-p=previous:
|
|
14
|
+
c-n=next:
|
|
15
|
+
c-f=forward:
|
|
16
|
+
c-b=backward:
|
|
17
|
+
c-d=delete:
|
|
18
|
+
c-k=kill line:
|
|
19
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
GPT=generative pre-trained transformer:
|
|
3
|
+
LLM=large language model:
|
|
4
|
+
CLI=command line interface:
|
|
5
|
+
CLA=command line application:
|
|
6
|
+
GUI=graphical user interface:
|
|
7
|
+
CUI=character user interface:
|
|
8
|
+
TCP=transmission control protocol:
|
|
9
|
+
HTTP=hyper text transfer protocol:
|
|
10
|
+
DNS=domain name system:
|
|
11
|
+
IP=internet protocol:
|
|
12
|
+
cwd=current working directory:
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
- - '2026-01-12 12:38:31'
|
|
3
|
+
- "-f abbrev_yamls/command_tree.yaml"
|
|
4
|
+
- 5/5
|
|
5
|
+
- - '2026-01-12 12:39:49'
|
|
6
|
+
- "-f abbrev_yamls/initialism_tree.yaml"
|
|
7
|
+
- 4/5
|
|
8
|
+
- - '2026-01-12 12:42:06'
|
|
9
|
+
- "-f abbrev_yamls/initialism_tree.yaml"
|
|
10
|
+
- 5/5
|
|
11
|
+
- - '2026-01-12 12:42:33'
|
|
12
|
+
- "-f abbrev_yamls/command_tree.yaml"
|
|
13
|
+
- 5/5
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
|
|
5
|
+
<head>
|
|
6
|
+
<!-- 2026-01-12 Mon 13:02 -->
|
|
7
|
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
<title>hc abbrevの使い方</title>
|
|
10
|
+
<meta name="author" content="Shigeto R. Nishitani" />
|
|
11
|
+
<meta name="generator" content="Org Mode" />
|
|
12
|
+
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
|
|
14
|
+
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/code-copy.css"/>
|
|
15
|
+
<link rel="stylesheet" type="text/css" href="src/readtheorg_theme/css/search.css"/>
|
|
16
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
|
17
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
|
18
|
+
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
|
|
19
|
+
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/search.js"></script>
|
|
20
|
+
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
|
|
21
|
+
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/code-copy.js"></script>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div id="content" class="content">
|
|
25
|
+
<h1 class="title">hc abbrevの使い方</h1>
|
|
26
|
+
<div id="table-of-contents" role="doc-toc">
|
|
27
|
+
<h2>Table of Contents</h2>
|
|
28
|
+
<div id="text-table-of-contents" role="doc-toc">
|
|
29
|
+
<ul>
|
|
30
|
+
<li><a href="#orgdfd811e">1. name</a></li>
|
|
31
|
+
<li><a href="#org93d8eb7">2. install</a></li>
|
|
32
|
+
<li><a href="#org9672085">3. help</a></li>
|
|
33
|
+
<li><a href="#orgda40b6d">4. usage</a></li>
|
|
34
|
+
<li><a href="#org33c9e32">5. dir_tree.yaml編集</a></li>
|
|
35
|
+
</ul>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div id="outline-container-orgdfd811e" class="outline-2">
|
|
39
|
+
<h2 id="orgdfd811e"><span class="section-number-2">1.</span> name</h2>
|
|
40
|
+
<div class="outline-text-2" id="text-1">
|
|
41
|
+
<ul class="org-ul">
|
|
42
|
+
<li>'hc abbrev'はプログラミングで頻出するabbreviation(短縮形)の
|
|
43
|
+
buildingを行うclaです.</li>
|
|
44
|
+
<li>短縮形になっているwordのfull spellを打ち込んでください.</li>
|
|
45
|
+
<li>'hc check'を少し拡張しただけです.</li>
|
|
46
|
+
</ul>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div id="outline-container-org93d8eb7" class="outline-2">
|
|
50
|
+
<h2 id="org93d8eb7"><span class="section-number-2">2.</span> install</h2>
|
|
51
|
+
<div class="outline-text-2" id="text-2">
|
|
52
|
+
<div class="org-src-container">
|
|
53
|
+
<pre class="src src-bash">> sudo gem install mk_semi_lattice <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">install mk_sl and hc</span>
|
|
54
|
+
> hc abbrev --install <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">install abbrev_yamls</span>
|
|
55
|
+
> cd abbrev_yamls
|
|
56
|
+
</pre>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div id="outline-container-org9672085" class="outline-2">
|
|
61
|
+
<h2 id="org9672085"><span class="section-number-2">3.</span> help</h2>
|
|
62
|
+
<div class="outline-text-2" id="text-3">
|
|
63
|
+
<div class="org-src-container">
|
|
64
|
+
<pre class="src src-bash">> hc abbrev -h
|
|
65
|
+
Usage: hc check [options]
|
|
66
|
+
-f, --file FILE YAML file to use
|
|
67
|
+
-a, --answer NUM <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">not used</span>
|
|
68
|
+
-q, --quiz NUM Number of quiz(def 5)
|
|
69
|
+
-i, --iterative [NUM] Test iteratively (<span style="color: #2e8b57;">num</span>=2)
|
|
70
|
+
--install Install sample check data
|
|
71
|
+
</pre>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div id="outline-container-orgda40b6d" class="outline-2">
|
|
76
|
+
<h2 id="orgda40b6d"><span class="section-number-2">4.</span> usage</h2>
|
|
77
|
+
<div class="outline-text-2" id="text-4">
|
|
78
|
+
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<colgroup>
|
|
82
|
+
<col class="org-left" />
|
|
83
|
+
</colgroup>
|
|
84
|
+
<tbody>
|
|
85
|
+
<tr>
|
|
86
|
+
<td class="org-left"><img src="./abbrev_checker/abbrev_checker.002.png" alt="abbrev_checker.002.png" /></td>
|
|
87
|
+
</tr>
|
|
88
|
+
|
|
89
|
+
<tr>
|
|
90
|
+
<td class="org-left">Fig.1 hc abbrevの動作.</td>
|
|
91
|
+
</tr>
|
|
92
|
+
</tbody>
|
|
93
|
+
</table>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div id="outline-container-org33c9e32" class="outline-2">
|
|
97
|
+
<h2 id="org33c9e32"><span class="section-number-2">5.</span> dir_tree.yaml編集</h2>
|
|
98
|
+
<div class="outline-text-2" id="text-5">
|
|
99
|
+
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<colgroup>
|
|
103
|
+
<col class="org-left" />
|
|
104
|
+
</colgroup>
|
|
105
|
+
<tbody>
|
|
106
|
+
<tr>
|
|
107
|
+
<td class="org-left"><img src="./abbrev_checker/abbrev_checker.003.png" alt="abbrev_checker.003.png" /></td>
|
|
108
|
+
</tr>
|
|
109
|
+
|
|
110
|
+
<tr>
|
|
111
|
+
<td class="org-left">Fig.2 dir_tree.yamlのフォーマット.</td>
|
|
112
|
+
</tr>
|
|
113
|
+
</tbody>
|
|
114
|
+
</table>
|
|
115
|
+
<p>
|
|
116
|
+
Answers-Quizはdir_tree.yamlから取り出しています.
|
|
117
|
+
自分の進捗に合わせて編集していってください.
|
|
118
|
+
消してしまわずに'#'でコメントアウトするのが正しいやり方.
|
|
119
|
+
</p>
|
|
120
|
+
|
|
121
|
+
<p>
|
|
122
|
+
さらに,
|
|
123
|
+
</p>
|
|
124
|
+
<pre class="example">
|
|
125
|
+
> hc stack
|
|
126
|
+
</pre>
|
|
127
|
+
|
|
128
|
+
<p>
|
|
129
|
+
でバックアップをとって変えていくのがコツです.
|
|
130
|
+
<a href="../../mk_stack/docs/readme.html">stackの解説</a>を参照ください.
|
|
131
|
+
</p>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div id="postamble" class="status">
|
|
136
|
+
<p class="author">Author: Shigeto R. Nishitani</p>
|
|
137
|
+
<p class="date">Created: 2026-01-12 Mon 13:02</p>
|
|
138
|
+
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
139
|
+
</div>
|
|
140
|
+
</body>
|
|
141
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#+OPTIONS: ^:{}
|
|
2
|
+
#+STARTUP: indent nolineimages overview num
|
|
3
|
+
#+TITLE: hc abbrevの使い方
|
|
4
|
+
#+AUTHOR: Shigeto R. Nishitani
|
|
5
|
+
#+EMAIL: (concat "shigeto_nishitani@mac.com")
|
|
6
|
+
#+LANGUAGE: jp
|
|
7
|
+
#+OPTIONS: H:4 toc:t num:2
|
|
8
|
+
#+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
|
|
9
|
+
|
|
10
|
+
* name
|
|
11
|
+
- 'hc abbrev'はプログラミングで頻出するabbreviation(短縮形)の
|
|
12
|
+
buildingを行うclaです.
|
|
13
|
+
- 短縮形になっているwordのfull spellを打ち込んでください.
|
|
14
|
+
- 'hc check'を少し拡張しただけです.
|
|
15
|
+
|
|
16
|
+
* install
|
|
17
|
+
#+begin_src bash
|
|
18
|
+
> sudo gem install mk_semi_lattice # install mk_sl and hc
|
|
19
|
+
> hc abbrev --install # install abbrev_yamls
|
|
20
|
+
> cd abbrev_yamls
|
|
21
|
+
#+end_src
|
|
22
|
+
* help
|
|
23
|
+
#+begin_src bash
|
|
24
|
+
> hc abbrev -h
|
|
25
|
+
Usage: hc check [options]
|
|
26
|
+
-f, --file FILE YAML file to use
|
|
27
|
+
-a, --answer NUM # not used
|
|
28
|
+
-q, --quiz NUM Number of quiz(def 5)
|
|
29
|
+
-i, --iterative [NUM] Test iteratively (num=2)
|
|
30
|
+
--install Install sample check data
|
|
31
|
+
#+end_src
|
|
32
|
+
* usage
|
|
33
|
+
| [[file:./abbrev_checker/abbrev_checker.002.png]]
|
|
34
|
+
| Fig.1 hc abbrevの動作.
|
|
35
|
+
* dir_tree.yaml編集
|
|
36
|
+
| [[file:./abbrev_checker/abbrev_checker.003.png]]
|
|
37
|
+
| Fig.2 dir_tree.yamlのフォーマット.
|
|
38
|
+
Answers-Quizはdir_tree.yamlから取り出しています.
|
|
39
|
+
自分の進捗に合わせて編集していってください.
|
|
40
|
+
消してしまわずに'#'でコメントアウトするのが正しいやり方.
|
|
41
|
+
|
|
42
|
+
さらに,
|
|
43
|
+
: > hc stack
|
|
44
|
+
でバックアップをとって変えていくのがコツです.
|
|
45
|
+
[[../../mk_stack/docs/readme.org][stackの解説]]を参照ください.
|
|
46
|
+
|
data/lib/hc.rb
CHANGED
|
@@ -3,7 +3,7 @@ require_relative "mk_semi_lattice/version"
|
|
|
3
3
|
require_relative "mk_stack/mk_stack"
|
|
4
4
|
require_relative "voca_buil/multi_check"
|
|
5
5
|
require_relative "split_pdf/split_pdf"
|
|
6
|
-
|
|
6
|
+
require_relative "abbrev_checker/abbrev_check"
|
|
7
7
|
|
|
8
8
|
class CLI < Thor
|
|
9
9
|
desc "view", "View Semi Lattice Graph"
|
|
@@ -20,15 +20,35 @@ class CLI < Thor
|
|
|
20
20
|
def split_pdf(*argv)
|
|
21
21
|
SplitPDF.new(argv).run
|
|
22
22
|
end
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
|
|
24
|
+
desc 'check', 'check word for vocabulary builder'
|
|
25
|
+
def check(*argv)
|
|
25
26
|
options = VocaBuil::OptionParserWrapper.parse
|
|
27
|
+
if options[:install]
|
|
28
|
+
VocaBuil::InstallCheckSample.new.run
|
|
29
|
+
exit
|
|
30
|
+
end
|
|
26
31
|
if options[:iter]
|
|
27
32
|
VocaBuil::IterativeCheck.new(options, options[:iter]).run
|
|
28
33
|
else
|
|
29
34
|
VocaBuil::BaseCheck.new(options).run
|
|
30
35
|
end
|
|
31
36
|
end
|
|
37
|
+
|
|
38
|
+
desc 'abbrev', 'check abbreviations'
|
|
39
|
+
def abbrev(*argv)
|
|
40
|
+
options = AbbrevCheck::OptionParserWrapper.parse
|
|
41
|
+
if options[:install]
|
|
42
|
+
AbbrevCheck::InstallCheckSample.new.run
|
|
43
|
+
exit
|
|
44
|
+
end
|
|
45
|
+
if options[:iter]
|
|
46
|
+
AbbrevCheck::IterativeCheck.new(options, options[:iter]).run
|
|
47
|
+
else
|
|
48
|
+
AbbrevCheck::BaseCheck.new(options).run
|
|
49
|
+
end
|
|
50
|
+
end
|
|
32
51
|
end
|
|
33
52
|
|
|
34
53
|
CLI.start(ARGV)
|
|
54
|
+
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
|
|
5
5
|
<head>
|
|
6
|
-
<!-- 2026-01-
|
|
6
|
+
<!-- 2026-01-10 Sat 12:05 -->
|
|
7
7
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
9
|
<title>hc stack</title>
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
<h2>Table of Contents</h2>
|
|
28
28
|
<div id="text-table-of-contents" role="doc-toc">
|
|
29
29
|
<ul>
|
|
30
|
-
<li><a href="#
|
|
31
|
-
<li><a href="#
|
|
32
|
-
<li><a href="#
|
|
30
|
+
<li><a href="#org196c2c7">1. Name</a></li>
|
|
31
|
+
<li><a href="#orga960af2">2. Help</a></li>
|
|
32
|
+
<li><a href="#orga2b2010">3. What does 'stack' do?</a></li>
|
|
33
33
|
</ul>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
|
-
<div id="outline-container-
|
|
37
|
-
<h2 id="
|
|
36
|
+
<div id="outline-container-org196c2c7" class="outline-2">
|
|
37
|
+
<h2 id="org196c2c7"><span class="section-number-2">1.</span> Name</h2>
|
|
38
38
|
<div class="outline-text-2" id="text-1">
|
|
39
39
|
<p>
|
|
40
40
|
make stack structures.
|
|
@@ -55,20 +55,23 @@ make stack structures.
|
|
|
55
55
|
</ul>
|
|
56
56
|
</div>
|
|
57
57
|
</div>
|
|
58
|
-
<div id="outline-container-
|
|
59
|
-
<h2 id="
|
|
58
|
+
<div id="outline-container-orga960af2" class="outline-2">
|
|
59
|
+
<h2 id="orga960af2"><span class="section-number-2">2.</span> Help</h2>
|
|
60
60
|
<div class="outline-text-2" id="text-2">
|
|
61
61
|
<div class="org-src-container">
|
|
62
62
|
<pre class="src src-bash">> hc stack -h
|
|
63
63
|
Usage: hc stack [options]
|
|
64
64
|
-n, --number=NUMBER Add ordinal number
|
|
65
65
|
-d, --dryrun Dry run (<span style="color: #1c86ee;">do</span> not move or create anything)
|
|
66
|
+
-D Do not move directories (only move files)
|
|
67
|
+
-A Do not move hidden files and directories
|
|
68
|
+
-e, --empty create empty stack
|
|
66
69
|
</pre>
|
|
67
70
|
</div>
|
|
68
71
|
</div>
|
|
69
72
|
</div>
|
|
70
|
-
<div id="outline-container-
|
|
71
|
-
<h2 id="
|
|
73
|
+
<div id="outline-container-orga2b2010" class="outline-2">
|
|
74
|
+
<h2 id="orga2b2010"><span class="section-number-2">3.</span> What does 'stack' do?</h2>
|
|
72
75
|
<div class="outline-text-2" id="text-3">
|
|
73
76
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
74
77
|
|
|
@@ -135,7 +138,7 @@ stackという動作名称は,昔のHyperCardシステムからの借用です
|
|
|
135
138
|
</div>
|
|
136
139
|
<div id="postamble" class="status">
|
|
137
140
|
<p class="author">Author: Shigeto R. Nishitani</p>
|
|
138
|
-
<p class="date">Created: 2026-01-
|
|
141
|
+
<p class="date">Created: 2026-01-10 Sat 12:05</p>
|
|
139
142
|
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
140
143
|
</div>
|
|
141
144
|
</body>
|
|
@@ -24,6 +24,9 @@ make stack structures.
|
|
|
24
24
|
Usage: hc stack [options]
|
|
25
25
|
-n, --number=NUMBER Add ordinal number
|
|
26
26
|
-d, --dryrun Dry run (do not move or create anything)
|
|
27
|
+
-D Do not move directories (only move files)
|
|
28
|
+
-A Do not move hidden files and directories
|
|
29
|
+
-e, --empty create empty stack
|
|
27
30
|
#+end_src
|
|
28
31
|
|
|
29
32
|
* What does 'stack' do?
|
data/lib/mk_stack/mk_stack.rb
CHANGED
|
@@ -11,6 +11,9 @@ class MkStack
|
|
|
11
11
|
opts.banner = "Usage: hc stack [options]"
|
|
12
12
|
opts.on('-n NUMBER', '--number=NUMBER', 'Add ordinal number') { |num| @options[:number] = num }
|
|
13
13
|
opts.on('-d', '--dryrun', 'Dry run (do not move or create anything)') { @options[:dryrun] = true }
|
|
14
|
+
opts.on('-D', 'Do not move directories (only move files)') { @options[:no_dir_move] = true }
|
|
15
|
+
opts.on('-A', 'Do not move hidden files and directories') { @options[:no_hidden] = true }
|
|
16
|
+
opts.on('-e', '--empty', 'create empty stack') { @options[:empty] = true }
|
|
14
17
|
end.parse!(argv)
|
|
15
18
|
|
|
16
19
|
@root_name = argv[0]
|
|
@@ -98,7 +101,18 @@ class MkStack
|
|
|
98
101
|
exclude = ['.', '..', dir, '.vscode', 'project.code-workspace']
|
|
99
102
|
entries = Dir.glob('*', File::FNM_DOTMATCH) - exclude
|
|
100
103
|
|
|
104
|
+
# -Aオプションが指定された場合、ドットで始まるファイル/ディレクトリを除外
|
|
105
|
+
if @options[:no_hidden]
|
|
106
|
+
entries.reject! { |entry| entry.start_with?('.') }
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# -e/--empty オプションが指定された場合、_stackで始まるディレクトリのみ移動
|
|
110
|
+
if @options[:empty]
|
|
111
|
+
entries.select! { |entry| File.directory?(entry) && entry.start_with?('_stack') }
|
|
112
|
+
end
|
|
113
|
+
|
|
101
114
|
entries.each do |entry|
|
|
115
|
+
next if @options[:no_dir_move] && File.directory?(entry)
|
|
102
116
|
if @options[:dryrun]
|
|
103
117
|
puts "[Dry Run] Would move #{entry} to #{dir}"
|
|
104
118
|
else
|
|
@@ -107,9 +121,9 @@ class MkStack
|
|
|
107
121
|
end
|
|
108
122
|
|
|
109
123
|
if @options[:dryrun]
|
|
110
|
-
puts "[Dry Run] Would move
|
|
124
|
+
puts "[Dry Run] Would move #{entries.empty? ? 'nothing' : entries.join(', ')} to #{dir}"
|
|
111
125
|
else
|
|
112
|
-
puts "Moved
|
|
126
|
+
puts "Moved #{entries.empty? ? 'nothing' : entries.join(', ')} to #{dir}"
|
|
113
127
|
end
|
|
114
128
|
end
|
|
115
129
|
|