rsyntaxtree 1.1.2 → 1.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67efef970625e45d10efb98107d23f9735b43086a41d952fa0aa54c88f5c6fe0
4
- data.tar.gz: 3e727169aa0904018c98f4a414a4401e415cfa857e039d3b0e3051a1ea6ef7fb
3
+ metadata.gz: e4cb4a9863e64fcf684c9d6b608fdbc3eb5ee6356f400704718242212864bd67
4
+ data.tar.gz: f7f87493bfca30cb46df92ecebd5de69c8457ae6a0abee37db43164234790c54
5
5
  SHA512:
6
- metadata.gz: aea448ac39aaa1a79a8c81485d8d6e9df04ce6b12650638288cc9a01010a2a91cb9f891cac2508aea7b0c6316f79a7bf51fe56baea5b04ac8f5e16d0e1381fa7
7
- data.tar.gz: 90b45fe737da07adef9c65d4ed7883e6dbb75fc879bced542c0e34cfc37a0f7c5d06a2bb00884a56ecc14373f8500356954be614fe6d1e78258fb87621056084
6
+ metadata.gz: f49133707195aa0b1bf517e4458a8422994180cb84eb46912aa971f32243836d67cbc5d7b80f66c9db4592e3749b30967947f76ca33423f3134a713e5f066ed6
7
+ data.tar.gz: 36b1cef6536cc7381b8ffd73333ebc16f7d976dfe84bf66a91f0f1b751086832b33edb07b7f71f61181a3d688251cb216dd82dcb9026e43ef09d23d3b956fcec
data/README.md CHANGED
@@ -20,13 +20,17 @@ You can run RSyntaxTree's web interface on your local machine using Docker Deskt
20
20
 
21
21
  ## Examples
22
22
 
23
- See [RSyntaxTree Example Gallery](https://yohasebe.github.io/rsyntaxtree/examples) page for syntax tree samples for
23
+ See [RSyntaxTree Example Gallery](https://yohasebe.github.io/rsyntaxtree/examples) page for examples for
24
24
 
25
25
  - Generative Grammar
26
- - Combinatory Categorial Grammar (Experimental)
27
- - Head-Driven Phrase Structure Grammar (Experimental)
28
- - Cognitive Grammar (Experimental)
29
-
26
+ - Combinatory Categorial Grammar
27
+ - Head-Driven Phrase Structure Grammar
28
+ - Cognitive Grammar
29
+ - Construction Grammar
30
+ - Pragmatics
31
+ - Phonology
32
+
33
+ **NOTE**: Some tree structures in the example gallery are experimental in the sense that they are not drawn according to conventions of the field.
30
34
 
31
35
  **Input text**
32
36
 
data/Rakefile CHANGED
@@ -53,6 +53,8 @@ task :generate do
53
53
  opts[:leafstyle] = value
54
54
  when "font"
55
55
  opts[:fontstyle] = case value
56
+ when /mono/i
57
+ "mono"
56
58
  when /sans/i
57
59
  "sans"
58
60
  when /serif/i
data/bin/rsyntaxtree CHANGED
@@ -19,7 +19,7 @@ opts = Optimist.options do
19
19
  opt :outdir, "Output directory", default: "./"
20
20
  opt :format, "Output format: png, gif, jpg, pdf, or svg", default: "png"
21
21
  opt :leafstyle, "visual style of tree leaves: auto, triangle, bar, or nothing", default: "auto"
22
- opt :fontstyle, "Font style (available when ttf font is specified): sans, serif, cjk", default: "sans"
22
+ opt :fontstyle, "Font style (available when ttf font is specified): sans, serif, cjk, mono", default: "sans"
23
23
  opt :font, "Path to a ttf font used to generate tree (optional)", type: String
24
24
  opt :fontsize, "Size: 8-26", default: 16
25
25
  opt :margin, "Margin: 0-10", default: 1
@@ -33,7 +33,7 @@ end
33
33
  Optimist.die :outdir, "must be an exsting directory path" unless FileTest.directory?(opts[:outdir])
34
34
  Optimist.die :format, "must be png, jpg, gif, or svg" unless /\A(png|jpg|gif|pdf|svg)\z/ =~ opts[:format]
35
35
  Optimist.die :leafstyle, "must be auto, triangle, bar, or nothing" unless /\A(auto|triangle|bar|nothing)\z/ =~ opts[:leafstyle]
36
- Optimist.die :fontstyle, "must be sans, serif, cjk" unless /\A(sans|serif|cjk)\z/ =~ opts[:fontstyle]
36
+ Optimist.die :fontstyle, "must be sans, serif, cjk, or mono" unless /\A(sans|serif|cjk|mono)\z/ =~ opts[:fontstyle]
37
37
  Optimist.die :font, "must be path to an existing ttf font" if opts[:font] && !File.exist?(opts[:font])
38
38
  Optimist.die :fontsize, "must be in the range of 8-26" unless opts[:fontsize] >= 8 && opts[:fontsize] <= 26
39
39
  Optimist.die :color, "must be either on or off" unless /\A(on|off|true|false)\z/ =~ opts[:color]
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: "000"
3
+ caption: "RSyntaxTree basic example"
4
+ colorization: "on"
5
+ category: "General"
6
+ polyline: "off"
7
+ symmetrization: "off"
8
+ connector: "auto"
9
+ font: "Noto Sans Mono"
10
+ reference:
11
+ ---
12
+ ```
13
+ [S
14
+ [NP |R| SyntaxTree\*]
15
+ [VP
16
+ [V generates]
17
+ [NP
18
+ [Adj #\+multilingual\
19
+ \+beautiful]
20
+ [NP syntax\
21
+ trees]
22
+ ]
23
+ ]
24
+ ]
25
+ ```
@@ -2,7 +2,7 @@
2
2
  name: "011"
3
3
  caption: "CCG sample"
4
4
  colorization: "off"
5
- category: "Combinatory Categorial Grammar (Experimental)"
5
+ category: "Combinatory Categorial Grammar"
6
6
  polyline: "off"
7
7
  symmetrization: "off"
8
8
  connector: "none"
@@ -2,7 +2,7 @@
2
2
  name: "012"
3
3
  caption: "CCG sample"
4
4
  colorization: "off"
5
- category: "Combinatory Categorial Grammar (Experimental)"
5
+ category: "Combinatory Categorial Grammar"
6
6
  polyline: "off"
7
7
  symmetrization: "off"
8
8
  connector: "none"
@@ -2,7 +2,7 @@
2
2
  name: "013"
3
3
  caption: "HPSG sample"
4
4
  colorization: "off"
5
- category: "Head-Driven Phrase Structure Grammar (Experimental)"
5
+ category: "Head-Driven Phrase Structure Grammar"
6
6
  polyline: "off"
7
7
  symmetrization: "off"
8
8
  connector: "bar"
@@ -2,7 +2,7 @@
2
2
  name: "014"
3
3
  caption: "Cognitive Grammar sample"
4
4
  colorization: "off"
5
- category: "Cognitive Grammar (Experimental)"
5
+ category: "Cognitive Grammar"
6
6
  polyline: "off"
7
7
  symmetrization: "off"
8
8
  connector: "auto"
@@ -6,7 +6,7 @@ category: "Computer Science"
6
6
  polyline: "on"
7
7
  symmetrization: "off"
8
8
  connector: "bar"
9
- font: "Noto Sans"
9
+ font: "Noto Sans Mono"
10
10
  reference: "Stuart 2014"
11
11
  ---
12
12
  ```
@@ -6,7 +6,7 @@ category: "Computer Science"
6
6
  polyline: "on"
7
7
  symmetrization: "off"
8
8
  connector: "bar"
9
- font: "Noto Serif"
9
+ font: "Noto Sans Mono"
10
10
  reference: ""
11
11
  ---
12
12
  ```
Binary file
Binary file
Binary file
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="1970.4" height="1571.2000000000003" viewBox="-20, -20, 1990.4, 1591.2000000000003" version="1.1" xmlns="http://www.w3.org/2000/svg">
4
+ <defs>
5
+ <marker id="arrow" markerUnits="strokeWidth" markerWidth="11.520000000000001" markerHeight="11.520000000000001" viewBox="0 0 11.520000000000001 11.520000000000001" refX="5.760000000000001" refY="0">
6
+ <polyline fill="none" stroke="purple" stroke-width="1" points="0,11.520000000000001,5.760000000000001,0,11.520000000000001,11.520000000000001" />
7
+ </marker>
8
+ <pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
9
+ <line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
10
+ </pattern>
11
+ <pattern id="hatchForNode" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
12
+ <line x1="0" y="0" x2="0" y2="10" stroke="blue" stroke-width="4"></line>
13
+ </pattern>
14
+ <pattern id="hatchForLeaf" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
15
+ <line x1="0" y="0" x2="0" y2="10" stroke="green" stroke-width="4"></line>
16
+ </pattern>
17
+ </defs>
18
+ <rect x="-20" y="-20" width="1990.4" height="1591.2000000000003" stroke="none" fill="white" />"
19
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='745.35' y='132.0'><tspan x='745.35' y='132.0' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">S</tspan>
20
+ </text>
21
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='266.79999999999995' y='431.2'><tspan x='266.79999999999995' y='431.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">NP</tspan>
22
+ </text>
23
+ <text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='28.799999999999955' y='730.4'><tspan x='54.799999999999955' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">R</tspan>
24
+ <tspan x='116.79999999999995' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif"><tspan style='fill:none;'>■</tspan>SyntaxTree*</tspan>
25
+ </text>
26
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1187.9' y='431.2'><tspan x='1187.9' y='431.2' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">VP</tspan>
27
+ </text>
28
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='836.0' y='730.4'><tspan x='836.0' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">V</tspan>
29
+ </text>
30
+ <text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='692.0' y='1029.6'><tspan x='692.0' y='1029.6' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">generates</tspan>
31
+ </text>
32
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1557.8000000000002' y='730.4'><tspan x='1557.8000000000002' y='730.4' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">NP</tspan>
33
+ </text>
34
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1311.2' y='1029.6'><tspan x='1311.2' y='1029.6' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">Adj</tspan>
35
+ </text>
36
+ <text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='1131.2' y='1328.8000000000002'><tspan x='1131.2' y='1328.8000000000002' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">+multilingual</tspan>
37
+ <tspan x='1131.2' y='1416.8000000000002' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">+beautiful</tspan>
38
+ </text>
39
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1786.4' y='1029.6'><tspan x='1786.4' y='1029.6' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">NP</tspan>
40
+ </text>
41
+ <text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='1714.4' y='1328.8000000000002'><tspan x='1714.4' y='1328.8000000000002' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">syntax</tspan>
42
+ <tspan x='1732.4' y='1416.8000000000002' style="" text-decoration="" font-family="'Noto Sans Mono SemiCondensed', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">trees</tspan>
43
+ </text>
44
+ <line style='stroke:black; stroke-width:2;' x1='302.79999999999995' y1='321.2' x2='763.35' y2='187.0' />
45
+ <line style='stroke:black; stroke-width:2;' x1='1223.9' y1='321.2' x2='763.35' y2='187.0' />
46
+ <polygon style='fill: none; stroke: black; stroke-width:2;' points='28.799999999999955 620.4 576.8 620.4 302.79999999999995 486.2' />
47
+ <line style='stroke:black; stroke-width:2;' x1='854.0' y1='620.4' x2='1223.9' y2='486.2' />
48
+ <line style='stroke:black; stroke-width:2;' x1='1593.8000000000002' y1='620.4' x2='1223.9' y2='486.2' />
49
+ <line style='stroke:black; stroke-width:2;' x1='854.0' y1='919.6' x2='854.0' y2='785.4' />
50
+ <line style='stroke:black; stroke-width:2;' x1='1365.2' y1='919.6' x2='1593.8000000000002' y2='785.4' />
51
+ <line style='stroke:black; stroke-width:2;' x1='1822.4' y1='919.6' x2='1593.8000000000002' y2='785.4' />
52
+ <line style='stroke:black; stroke-width:2;' x1='1365.2' y1='1218.8000000000002' x2='1365.2' y2='1084.6' />
53
+ <line style='stroke:black; stroke-width:2;' x1='1822.4' y1='1218.8000000000002' x2='1822.4' y2='1084.6' />
54
+ <rect style='stroke: green; stroke-width:2;'
55
+ x='28.799999999999955' y='662.0'
56
+ width='88.0' height='88.0'
57
+ fill='none' />
58
+
59
+ <line x1='1116.8' y1='1229.8000000000002' x2='1131.2' y2='1229.8000000000002' style='fill: none; stroke: green; stroke-width:2' />
60
+ <line x1='1116.8' y1='1229.8000000000002' x2='1116.8' y2='1460.8000000000002' style='fill: none; stroke: green; stroke-width:2' />
61
+ <line x1='1116.8' y1='1460.8000000000002' x2='1131.2' y2='1460.8000000000002' style='fill: none; stroke: green; stroke-width:2' />
62
+ <line x1='1613.6' y1='1229.8000000000002' x2='1599.1999999999998' y2='1229.8000000000002' style='fill: none; stroke: green; stroke-width:2' />
63
+ <line x1='1613.6' y1='1229.8000000000002' x2='1613.6' y2='1460.8000000000002' style='fill: none; stroke: green; stroke-width:2' />
64
+ <line x1='1613.6' y1='1460.8000000000002' x2='1599.1999999999998' y2='1460.8000000000002' style='fill: none; stroke: green; stroke-width:2' /></svg>