rsyntaxtree 1.2.10 → 1.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/Dockerfile +2 -0
- data/README.md +3 -1
- data/bin/rsyntaxtree +3 -1
- data/docs/_examples/052.md +58 -0
- data/docs/assets/img/000.png +0 -0
- data/docs/assets/img/001.png +0 -0
- data/docs/assets/img/002.png +0 -0
- data/docs/assets/img/003.png +0 -0
- data/docs/assets/img/004.png +0 -0
- data/docs/assets/img/005.png +0 -0
- data/docs/assets/img/006.png +0 -0
- data/docs/assets/img/007.png +0 -0
- data/docs/assets/img/008.png +0 -0
- data/docs/assets/img/009.png +0 -0
- data/docs/assets/img/010.png +0 -0
- data/docs/assets/img/011.png +0 -0
- data/docs/assets/img/012.png +0 -0
- data/docs/assets/img/013.png +0 -0
- data/docs/assets/img/014.png +0 -0
- data/docs/assets/img/015.png +0 -0
- data/docs/assets/img/016.png +0 -0
- data/docs/assets/img/017.png +0 -0
- data/docs/assets/img/018.png +0 -0
- data/docs/assets/img/019.png +0 -0
- data/docs/assets/img/020.png +0 -0
- data/docs/assets/img/021.png +0 -0
- data/docs/assets/img/022.png +0 -0
- data/docs/assets/img/023.png +0 -0
- data/docs/assets/img/024.png +0 -0
- data/docs/assets/img/025.png +0 -0
- data/docs/assets/img/026.png +0 -0
- data/docs/assets/img/027.png +0 -0
- data/docs/assets/img/028.png +0 -0
- data/docs/assets/img/029.png +0 -0
- data/docs/assets/img/030.png +0 -0
- data/docs/assets/img/031.png +0 -0
- data/docs/assets/img/032.png +0 -0
- data/docs/assets/img/033.png +0 -0
- data/docs/assets/img/034.png +0 -0
- data/docs/assets/img/035.png +0 -0
- data/docs/assets/img/036.png +0 -0
- data/docs/assets/img/037.png +0 -0
- data/docs/assets/img/038.png +0 -0
- data/docs/assets/img/039.png +0 -0
- data/docs/assets/img/040.png +0 -0
- data/docs/assets/img/041.png +0 -0
- data/docs/assets/img/042.png +0 -0
- data/docs/assets/img/043.png +0 -0
- data/docs/assets/img/044.png +0 -0
- data/docs/assets/img/045.png +0 -0
- data/docs/assets/img/046.png +0 -0
- data/docs/assets/img/048.png +0 -0
- data/docs/assets/img/049.png +0 -0
- data/docs/assets/img/050.png +0 -0
- data/docs/assets/img/051.png +0 -0
- data/docs/assets/img/052.png +0 -0
- data/docs/assets/svg/005.svg +17 -17
- data/docs/assets/svg/013.svg +76 -76
- data/docs/assets/svg/026.svg +15 -15
- data/docs/assets/svg/027.svg +46 -46
- data/docs/assets/svg/040.svg +63 -63
- data/docs/assets/svg/052.svg +96 -0
- data/lib/rsyntaxtree/version.rb +1 -1
- data/lib/rsyntaxtree.rb +2 -0
- data/rsyntaxtree.gemspec +3 -2
- data/test/example_verify_test.rb +5 -5
- metadata +22 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3391346a580d49f8492e2a0d9291c1b90102fd516f6a0052cf58805284dc754
|
4
|
+
data.tar.gz: e56e9dad60a0949cbc562686457526fc283c24e10711e5e6a917c4189e9b3fe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d33f47df1ffc221f4b60bfb1aacbbb2ba19c403eeffee117d1003ea0e56a74b3f44a12d37b561bc496946a22125a2f55fd22129d6e5b473c35810a3f626c06a
|
7
|
+
data.tar.gz: cb82465f750cd98bd309c6cd85b0815bd33e556c76f74b668b4ba027459833565e768325c170a953a1aa952ede5308cf082dbac77c5df65788787c351ba75786
|
data/Dockerfile
CHANGED
@@ -9,7 +9,9 @@ RUN apk update && \
|
|
9
9
|
apk add --no-cache gobject-introspection gobject-introspection-dev && \
|
10
10
|
apk add --no-cache -t .build-packages --no-cache build-base curl-dev wget gcompat
|
11
11
|
|
12
|
+
|
12
13
|
ADD Gemfile $WORKSPACE
|
14
|
+
ADD rsyntaxtree.gemspec $WORKSPACE
|
13
15
|
RUN bundle install -j4
|
14
16
|
|
15
17
|
ADD fonts $WORKSPACE
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<img src='https://github.com/yohasebe/rsyntaxtree/blob/master/img/rsyntaxtree.png?raw=true' style='width: 256px;' />
|
2
2
|
|
3
|
-
**RSyntaxTree** is a graphical syntax tree generator
|
3
|
+
**RSyntaxTree** is a graphical syntax tree generator for linguistic research
|
4
4
|
|
5
5
|
## Documentation
|
6
6
|
|
@@ -58,6 +58,8 @@ See [RSyntaxTree Example Gallery](https://yohasebe.github.io/rsyntaxtree/example
|
|
58
58
|
|
59
59
|
`# gem install rsyntaxtree`
|
60
60
|
|
61
|
+
**NOTE**: Currently, installation of the gem package on macOS is not recommended. Please use the [Docker image](https://hub.docker.com/r/yohasebe/rsyntaxtree) or the [web interface](https://yohasebe.com/rsyntaxtree).
|
62
|
+
|
61
63
|
## Usage
|
62
64
|
|
63
65
|
For the web interface, see Usage section of <https://yohasebe.com/rsyntaxtree>.
|
data/bin/rsyntaxtree
CHANGED
@@ -18,6 +18,7 @@ opts = Optimist.options do
|
|
18
18
|
BANNER
|
19
19
|
|
20
20
|
opt :outdir, "Output directory", default: "./"
|
21
|
+
opt :outfilename, "Output file base name", default: "syntree"
|
21
22
|
opt :format, "Output format: png, pdf, or svg", default: "png"
|
22
23
|
opt :leafstyle, "visual style of tree leaves: auto, triangle, bar, or nothing", default: "auto"
|
23
24
|
opt :fontstyle, "Font style (available when ttf font is specified): sans, serif, cjk, mono", default: "sans"
|
@@ -69,7 +70,8 @@ begin
|
|
69
70
|
string_opts[:data] = data
|
70
71
|
rsg = RSyntaxTree::RSGenerator.new(string_opts)
|
71
72
|
ext = string_opts[:format]
|
72
|
-
|
73
|
+
outfilename = string_opts[:outfilename] || "syntree"
|
74
|
+
filepath = File.expand_path(string_opts[:outdir]) + "/#{outfilename}." + ext
|
73
75
|
case ext
|
74
76
|
when "pdf"
|
75
77
|
outfile = File.new(filepath, "wb")
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
name: "052"
|
3
|
+
color: "off"
|
4
|
+
caption: "Major clause constructions of English"
|
5
|
+
category: "Construction Grammar"
|
6
|
+
polyline: "on"
|
7
|
+
symmetrization: "off"
|
8
|
+
connector: "auto"
|
9
|
+
connector_height: "3.0"
|
10
|
+
linewidth: "1"
|
11
|
+
hide_default_connectors: "off"
|
12
|
+
font: "Noto Serif"
|
13
|
+
reference: "Hoffmann 2022: 220"
|
14
|
+
---
|
15
|
+
```
|
16
|
+
[ Major<>clause<>construction
|
17
|
+
[Declarative<>clause<>cxn\
|
18
|
+
---\
|
19
|
+
*He<>was<>tired.*\
|
20
|
+
*He<>made<>mistakes.*
|
21
|
+
]
|
22
|
+
[Interrogative<>cxn\
|
23
|
+
[Yes/No interrogative<>cxn\
|
24
|
+
---\
|
25
|
+
*Was<>he<>tired?*\
|
26
|
+
*Did<>he<>make<>mistakes?*
|
27
|
+
]
|
28
|
+
[WH\-interrogative<>cxn
|
29
|
+
[WH\-subject<>interrogative<>cxn\
|
30
|
+
---\
|
31
|
+
*Who<>was<>tired?*
|
32
|
+
]
|
33
|
+
[WH\-nonsubject<>interrogative<>cxn\
|
34
|
+
---\
|
35
|
+
*What<>was<>he?*\
|
36
|
+
*What<>did<>he<>make?*
|
37
|
+
]
|
38
|
+
]
|
39
|
+
]
|
40
|
+
[WH\-exclamative<>cxn\
|
41
|
+
---\
|
42
|
+
*How<>tired<>he<>was!*\
|
43
|
+
*What<>mistakes<>he<>made!*
|
44
|
+
]
|
45
|
+
Imperative<>cxn
|
46
|
+
[Relative<>clause<>cxn\
|
47
|
+
[WH\-subject<>relative<>clause<>cxn\
|
48
|
+
---\
|
49
|
+
The<>emails,<>which<>arrived<>overnight<>...
|
50
|
+
]
|
51
|
+
[WH\-nonsubject<>relative<>clause<>cxn\
|
52
|
+
---\
|
53
|
+
A<>pilot<>shouldn't<>be<>tired,<>which<>Ben<>was.\
|
54
|
+
The<>mistalkes<>that<>he<>made<>...
|
55
|
+
]
|
56
|
+
]
|
57
|
+
]
|
58
|
+
```
|
data/docs/assets/img/000.png
CHANGED
Binary file
|
data/docs/assets/img/001.png
CHANGED
Binary file
|
data/docs/assets/img/002.png
CHANGED
Binary file
|
data/docs/assets/img/003.png
CHANGED
Binary file
|
data/docs/assets/img/004.png
CHANGED
Binary file
|
data/docs/assets/img/005.png
CHANGED
Binary file
|
data/docs/assets/img/006.png
CHANGED
Binary file
|
data/docs/assets/img/007.png
CHANGED
Binary file
|
data/docs/assets/img/008.png
CHANGED
Binary file
|
data/docs/assets/img/009.png
CHANGED
Binary file
|
data/docs/assets/img/010.png
CHANGED
Binary file
|
data/docs/assets/img/011.png
CHANGED
Binary file
|
data/docs/assets/img/012.png
CHANGED
Binary file
|
data/docs/assets/img/013.png
CHANGED
Binary file
|
data/docs/assets/img/014.png
CHANGED
Binary file
|
data/docs/assets/img/015.png
CHANGED
Binary file
|
data/docs/assets/img/016.png
CHANGED
Binary file
|
data/docs/assets/img/017.png
CHANGED
Binary file
|
data/docs/assets/img/018.png
CHANGED
Binary file
|
data/docs/assets/img/019.png
CHANGED
Binary file
|
data/docs/assets/img/020.png
CHANGED
Binary file
|
data/docs/assets/img/021.png
CHANGED
Binary file
|
data/docs/assets/img/022.png
CHANGED
Binary file
|
data/docs/assets/img/023.png
CHANGED
Binary file
|
data/docs/assets/img/024.png
CHANGED
Binary file
|
data/docs/assets/img/025.png
CHANGED
Binary file
|
data/docs/assets/img/026.png
CHANGED
Binary file
|
data/docs/assets/img/027.png
CHANGED
Binary file
|
data/docs/assets/img/028.png
CHANGED
Binary file
|
data/docs/assets/img/029.png
CHANGED
Binary file
|
data/docs/assets/img/030.png
CHANGED
Binary file
|
data/docs/assets/img/031.png
CHANGED
Binary file
|
data/docs/assets/img/032.png
CHANGED
Binary file
|
data/docs/assets/img/033.png
CHANGED
Binary file
|
data/docs/assets/img/034.png
CHANGED
Binary file
|
data/docs/assets/img/035.png
CHANGED
Binary file
|
data/docs/assets/img/036.png
CHANGED
Binary file
|
data/docs/assets/img/037.png
CHANGED
Binary file
|
data/docs/assets/img/038.png
CHANGED
Binary file
|
data/docs/assets/img/039.png
CHANGED
Binary file
|
data/docs/assets/img/040.png
CHANGED
Binary file
|
data/docs/assets/img/041.png
CHANGED
Binary file
|
data/docs/assets/img/042.png
CHANGED
Binary file
|
data/docs/assets/img/043.png
CHANGED
Binary file
|
data/docs/assets/img/044.png
CHANGED
Binary file
|
data/docs/assets/img/045.png
CHANGED
Binary file
|
data/docs/assets/img/046.png
CHANGED
Binary file
|
data/docs/assets/img/048.png
CHANGED
Binary file
|
data/docs/assets/img/049.png
CHANGED
Binary file
|
data/docs/assets/img/050.png
CHANGED
Binary file
|
data/docs/assets/img/051.png
CHANGED
Binary file
|
Binary file
|
data/docs/assets/svg/005.svg
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" standalone="no"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg width="
|
3
|
+
<svg width="514.0" height="545.75" viewBox="-16.8, 0, 530.8, 557.0" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
4
4
|
<defs>
|
5
5
|
<marker id="arrow" markerUnits="userSpaceOnUse" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="16.8" markerHeight="16.8" orient="auto">
|
6
6
|
<path d="M 0 0 L 10 5 L 0 10" fill="black"/>
|
@@ -24,27 +24,27 @@
|
|
24
24
|
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
25
25
|
</pattern>
|
26
26
|
</defs>
|
27
|
-
<rect x="-16.8" y="0" width="
|
28
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='
|
29
|
-
<tspan x='
|
27
|
+
<rect x="-16.8" y="0" width="530.8" height="557.0" stroke="none" fill="white" />"
|
28
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='172.1625' y='67.5'><tspan x='172.1625' y='67.5' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">X</tspan>
|
29
|
+
<tspan x='194.1625' y='57.25' style="font-size: 70%; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">max</tspan>
|
30
30
|
</text>
|
31
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='16.
|
31
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='16.80000000000001' y='218.0'><tspan x='16.80000000000001' y='218.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">[Y−X]</tspan>
|
32
32
|
</text>
|
33
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='
|
33
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='312.525' y='218.0'><tspan x='312.525' y='218.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">YP</tspan>
|
34
34
|
</text>
|
35
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='
|
36
|
-
<tspan x='
|
35
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='210.0' y='368.5'><tspan x='210.0' y='368.5' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Spec</tspan>
|
36
|
+
<tspan x='283.0' y='372.5' style="font-size: 70%; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">1</tspan>
|
37
37
|
</text>
|
38
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='
|
38
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='400.54999999999995' y='368.5'><tspan x='400.54999999999995' y='368.5' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Y'</tspan>
|
39
39
|
</text>
|
40
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='
|
40
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='362.2' y='519.0'><tspan x='362.2' y='519.0' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">t</tspan>
|
41
41
|
</text>
|
42
|
-
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='
|
42
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: black; storoke-width: 0; font-size: 32px;' x='441.4' y='519.0'><tspan x='441.4' y='519.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">ZP</tspan>
|
43
43
|
</text>
|
44
|
-
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='
|
45
|
-
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='
|
46
|
-
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='
|
47
|
-
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='
|
48
|
-
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='
|
49
|
-
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='
|
44
|
+
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='79.80000000000001' y1='161.75' x2='206.6625' y2='95.625' />
|
45
|
+
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='333.525' y1='161.75' x2='206.6625' y2='95.625' />
|
46
|
+
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='252.5' y1='312.25' x2='333.525' y2='246.125' />
|
47
|
+
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='414.54999999999995' y1='312.25' x2='333.525' y2='246.125' />
|
48
|
+
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='368.2' y1='462.75' x2='414.54999999999995' y2='396.625' />
|
49
|
+
<line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='460.9' y1='462.75' x2='414.54999999999995' y2='396.625' />
|
50
50
|
</svg>
|