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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +2 -0
  3. data/README.md +3 -1
  4. data/bin/rsyntaxtree +3 -1
  5. data/docs/_examples/052.md +58 -0
  6. data/docs/assets/img/000.png +0 -0
  7. data/docs/assets/img/001.png +0 -0
  8. data/docs/assets/img/002.png +0 -0
  9. data/docs/assets/img/003.png +0 -0
  10. data/docs/assets/img/004.png +0 -0
  11. data/docs/assets/img/005.png +0 -0
  12. data/docs/assets/img/006.png +0 -0
  13. data/docs/assets/img/007.png +0 -0
  14. data/docs/assets/img/008.png +0 -0
  15. data/docs/assets/img/009.png +0 -0
  16. data/docs/assets/img/010.png +0 -0
  17. data/docs/assets/img/011.png +0 -0
  18. data/docs/assets/img/012.png +0 -0
  19. data/docs/assets/img/013.png +0 -0
  20. data/docs/assets/img/014.png +0 -0
  21. data/docs/assets/img/015.png +0 -0
  22. data/docs/assets/img/016.png +0 -0
  23. data/docs/assets/img/017.png +0 -0
  24. data/docs/assets/img/018.png +0 -0
  25. data/docs/assets/img/019.png +0 -0
  26. data/docs/assets/img/020.png +0 -0
  27. data/docs/assets/img/021.png +0 -0
  28. data/docs/assets/img/022.png +0 -0
  29. data/docs/assets/img/023.png +0 -0
  30. data/docs/assets/img/024.png +0 -0
  31. data/docs/assets/img/025.png +0 -0
  32. data/docs/assets/img/026.png +0 -0
  33. data/docs/assets/img/027.png +0 -0
  34. data/docs/assets/img/028.png +0 -0
  35. data/docs/assets/img/029.png +0 -0
  36. data/docs/assets/img/030.png +0 -0
  37. data/docs/assets/img/031.png +0 -0
  38. data/docs/assets/img/032.png +0 -0
  39. data/docs/assets/img/033.png +0 -0
  40. data/docs/assets/img/034.png +0 -0
  41. data/docs/assets/img/035.png +0 -0
  42. data/docs/assets/img/036.png +0 -0
  43. data/docs/assets/img/037.png +0 -0
  44. data/docs/assets/img/038.png +0 -0
  45. data/docs/assets/img/039.png +0 -0
  46. data/docs/assets/img/040.png +0 -0
  47. data/docs/assets/img/041.png +0 -0
  48. data/docs/assets/img/042.png +0 -0
  49. data/docs/assets/img/043.png +0 -0
  50. data/docs/assets/img/044.png +0 -0
  51. data/docs/assets/img/045.png +0 -0
  52. data/docs/assets/img/046.png +0 -0
  53. data/docs/assets/img/048.png +0 -0
  54. data/docs/assets/img/049.png +0 -0
  55. data/docs/assets/img/050.png +0 -0
  56. data/docs/assets/img/051.png +0 -0
  57. data/docs/assets/img/052.png +0 -0
  58. data/docs/assets/svg/005.svg +17 -17
  59. data/docs/assets/svg/013.svg +76 -76
  60. data/docs/assets/svg/026.svg +15 -15
  61. data/docs/assets/svg/027.svg +46 -46
  62. data/docs/assets/svg/040.svg +63 -63
  63. data/docs/assets/svg/052.svg +96 -0
  64. data/lib/rsyntaxtree/version.rb +1 -1
  65. data/lib/rsyntaxtree.rb +2 -0
  66. data/rsyntaxtree.gemspec +3 -2
  67. data/test/example_verify_test.rb +5 -5
  68. metadata +22 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67664c0d5428e9bc73da63d0fbdd1f0d2ff724b613d1b6e9cb13f700fb0f2c3a
4
- data.tar.gz: 7dff584250e312bf81af2cab9c1a0b81d8f89838168b3c62c852baad6dd69682
3
+ metadata.gz: f3391346a580d49f8492e2a0d9291c1b90102fd516f6a0052cf58805284dc754
4
+ data.tar.gz: e56e9dad60a0949cbc562686457526fc283c24e10711e5e6a917c4189e9b3fe2
5
5
  SHA512:
6
- metadata.gz: 89a6024dab82e852da223bd4c016770ea456a01040d50542f5455becffdf60d1e866bec3bf219a742f375f41b14cfb915ee0b680c2779ffe676c04b4f15102cf
7
- data.tar.gz: 3ff3d49d923155fb00657fc5fa9ac126d50eea25a62175e772ea13281d7cdd5e52d007c07008e7ab21e6fcb08c7a9327f56748df0f2818880f80d35ec6ef453c
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 written in the Ruby programming language.
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
- filepath = File.expand_path(string_opts[:outdir]) + "/syntree." + ext
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
+ ```
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -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="472.0" height="545.75" viewBox="-16.8, 0, 488.8, 557.0" version="1.1" xmlns="http://www.w3.org/2000/svg">
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="488.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='140.6625' y='67.5'><tspan x='140.6625' y='67.5' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">X</tspan>
29
- <tspan x='162.6625' y='57.25' style="font-size: 70%; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">max</tspan>
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.799999999999997' y='218.0'><tspan x='16.799999999999997' y='218.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">[Y−X]</tspan>
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='270.525' y='218.0'><tspan x='270.525' y='218.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">YP</tspan>
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='168.0' y='368.5'><tspan x='168.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='241.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>
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='358.54999999999995' y='368.5'><tspan x='358.54999999999995' y='368.5' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">Y'</tspan>
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='320.20000000000005' y='519.0'><tspan x='320.20000000000005' y='519.0' style="font-style: italic; " text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">t</tspan>
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='399.4' y='519.0'><tspan x='399.4' y='519.0' style="" text-decoration="" font-family="'Noto Serif', 'Noto Serif JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', serif">ZP</tspan>
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='58.8' y1='161.75' x2='175.1625' y2='95.625' />
45
- <line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='291.525' y1='161.75' x2='175.1625' y2='95.625' />
46
- <line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='210.5' y1='312.25' x2='291.525' y2='246.125' />
47
- <line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='372.54999999999995' y1='312.25' x2='291.525' y2='246.125' />
48
- <line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='326.20000000000005' y1='462.75' x2='372.54999999999995' y2='396.625' />
49
- <line style='fill: none; stroke:black; stroke-width:2; stroke-linejoin:round; stroke-linecap:round;' x1='418.9' y1='462.75' x2='372.54999999999995' y2='396.625' />
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>