rubyplb 0.2.94 → 0.3.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
- data/..gitignore.un~ +0 -0
- data/.gitignore +2 -0
- data/VERSION +1 -1
- data/bin/rubyplb +2 -13
- data/lib/rubyplb.rb +3 -3
- data/lib/rubyplb/version.rb +1 -1
- data/rubyplb.log +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c87752c6645eca0aef973b1442a675b3151f7e7
|
4
|
+
data.tar.gz: 290c4a0d12625729ecbdd95f03533cf504a2da2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0789c4de961244ad427e528e433309475fc5d3440d7808ceb7f0b0fcc6df7b5694b21b2ab995f465b239bff7e9bb0cc576f102a6e0824ea704218c82e8c8e0b7
|
7
|
+
data.tar.gz: 4817f7c6cbc3cef52e0acc871c1a3179f932ba99f7fc583ec22023eb7540f2de2f30020376f4714396a63f52ecc0bd2a3dc8326903cf94363bbd95017e4a3c1d
|
data/..gitignore.un~
ADDED
Binary file
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/bin/rubyplb
CHANGED
@@ -11,7 +11,7 @@ require 'ruby_graphviz'
|
|
11
11
|
########## parse options ##########
|
12
12
|
|
13
13
|
opts = Trollop::options do
|
14
|
-
version
|
14
|
+
version File.read(File.dirname(__FILE__) + "/../VERSION").chomp
|
15
15
|
banner <<-EOS
|
16
16
|
|
17
17
|
RubyPLB generates pattern lattice graphics from lists of patterns.
|
@@ -34,7 +34,7 @@ EOS
|
|
34
34
|
opt :straight, "Straighten edges (available when output format is either png, jpg, or eps)", :default => false
|
35
35
|
opt :nodesep, "Size of separation between sister nodes (from 0.1 to 5.0)", :default => 0.8
|
36
36
|
opt :ranksep, "Size of separation between ranks (from 0.1 to 5.0)", :default => 0.8
|
37
|
-
opt :
|
37
|
+
opt :direction, "Direction of elements (LR or RL)", :default => "LR"
|
38
38
|
end
|
39
39
|
|
40
40
|
Trollop::die :coloring, "must be 0, 1, or 2" if (opts[:coloring] > 2 || opts[:coloring] < 0)
|
@@ -44,10 +44,6 @@ Trollop::die :nodesep, "must be within 0.1 - 5.0" if (opts[:nodesep] < 0.1 || o
|
|
44
44
|
############### main program ###############
|
45
45
|
|
46
46
|
if ARGV.size != 2
|
47
|
-
if opts[:version]
|
48
|
-
puts version
|
49
|
-
exit
|
50
|
-
end
|
51
47
|
showerror("Input and output files are not set properly", 1)
|
52
48
|
end
|
53
49
|
|
@@ -64,13 +60,6 @@ if (input_type !~ /\A(plb|txt)\z/ || output_type !~ /\A(dot|png|jpg|eps)\z/)
|
|
64
60
|
showerror("These file extensions are not (yet) supported.", 1)
|
65
61
|
end
|
66
62
|
|
67
|
-
#
|
68
|
-
# input cxt data is kept as plain text
|
69
|
-
#
|
70
|
-
f = File.open(filename1, "r")
|
71
|
-
inputdata = f.read
|
72
|
-
f.close
|
73
|
-
|
74
63
|
#
|
75
64
|
# ask for confirmation of overwriting an exisiting file
|
76
65
|
#
|
data/lib/rubyplb.rb
CHANGED
@@ -77,7 +77,6 @@ class PatLattice
|
|
77
77
|
|
78
78
|
def create_patterns(sentence, compact)
|
79
79
|
words = sentence.split(/\s+/)
|
80
|
-
|
81
80
|
if /\((\d+)\)/ =~ words[-1]
|
82
81
|
words.pop
|
83
82
|
times = $1.to_i
|
@@ -96,6 +95,8 @@ class PatLattice
|
|
96
95
|
end
|
97
96
|
end
|
98
97
|
|
98
|
+
words.reverse! if /\ARL\z/i =~ @opts[:direction]
|
99
|
+
|
99
100
|
idx = (0...words.size).to_a
|
100
101
|
words_with_idx = words.zip(idx).collect{|a| a.join("-")}
|
101
102
|
masks = words_with_idx.subset
|
@@ -134,8 +135,7 @@ class PatLattice
|
|
134
135
|
end
|
135
136
|
|
136
137
|
def insert(sentence, compact)
|
137
|
-
ptns = create_patterns(sentence, compact)
|
138
|
-
|
138
|
+
ptns = create_patterns(sentence, compact)
|
139
139
|
new_nodes = []
|
140
140
|
ptns.each do |ptn|
|
141
141
|
if existing = search(ptn)
|
data/lib/rubyplb/version.rb
CHANGED
data/rubyplb.log
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
Warning: transparent is not a known color.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyplb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kow Kuroda
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Command line Pattern Lattice building tool written in Ruby.
|
15
15
|
email:
|
@@ -19,6 +19,7 @@ executables:
|
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
|
+
- "..gitignore.un~"
|
22
23
|
- ".document"
|
23
24
|
- ".gitignore"
|
24
25
|
- Gemfile
|