forked from GitHub/gf-core
word alignment ex in tutorial
This commit is contained in:
BIN
doc/tutorial/align2.png
Normal file
BIN
doc/tutorial/align2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -1119,11 +1119,11 @@ Human eye may prefer to see a visualization: <CODE>visualize_tree = vt</CODE>:
|
|||||||
</PRE>
|
</PRE>
|
||||||
<P>
|
<P>
|
||||||
The tree is generated in postscript (<CODE>.ps</CODE>) file. The <CODE>-view</CODE> option is used for
|
The tree is generated in postscript (<CODE>.ps</CODE>) file. The <CODE>-view</CODE> option is used for
|
||||||
telling what command to use to view the file. Its default is <CODE>"gv"</CODE>, which works
|
telling what command to use to view the file. Its default is <CODE>"open"</CODE>, which works
|
||||||
on most Linux installations. On a Mac, one would probably write
|
on Mac OS X. On Ubuntu Linux, one can write
|
||||||
</P>
|
</P>
|
||||||
<PRE>
|
<PRE>
|
||||||
> parse "this delicious cheese is very Italian" | visualize_tree -view="open"
|
> parse "this delicious cheese is very Italian" | visualize_tree -view="eog"
|
||||||
</PRE>
|
</PRE>
|
||||||
<P></P>
|
<P></P>
|
||||||
<P>
|
<P>
|
||||||
@@ -1240,6 +1240,19 @@ are put before the noun. This distinction can be controlled by parameters,
|
|||||||
which are introduced in <a href="#chaptwo">Lesson 3</a>.)
|
which are introduced in <a href="#chaptwo">Lesson 3</a>.)
|
||||||
</P>
|
</P>
|
||||||
<P>
|
<P>
|
||||||
|
Multilingual grammars have yet another visualization option:
|
||||||
|
<B>word alignment</B>, which shows what words correspond to each other.
|
||||||
|
Technically, this means words that have the same smallest spanning subtrees
|
||||||
|
in abstract syntax. The command is <CODE>align_words = aw</CODE>:
|
||||||
|
</P>
|
||||||
|
<PRE>
|
||||||
|
> parse "this delicious cheese is very Italian" | align_words
|
||||||
|
</PRE>
|
||||||
|
<P></P>
|
||||||
|
<P>
|
||||||
|
<IMG ALIGN="middle" SRC="align2.png" BORDER="0" ALT="">
|
||||||
|
</P>
|
||||||
|
<P>
|
||||||
<!-- NEW -->
|
<!-- NEW -->
|
||||||
</P>
|
</P>
|
||||||
<A NAME="toc29"></A>
|
<A NAME="toc29"></A>
|
||||||
|
|||||||
@@ -1263,14 +1263,15 @@ Human eye may prefer to see a visualization: ``visualize_tree = vt``:
|
|||||||
> parse "this delicious cheese is very Italian" | visualize_tree
|
> parse "this delicious cheese is very Italian" | visualize_tree
|
||||||
```
|
```
|
||||||
The tree is generated in postscript (``.ps``) file. The ``-view`` option is used for
|
The tree is generated in postscript (``.ps``) file. The ``-view`` option is used for
|
||||||
telling what command to use to view the file. Its default is ``"gv"``, which works
|
telling what command to use to view the file. Its default is ``"open"``, which works
|
||||||
on most Linux installations. On a Mac, one would probably write
|
on Mac OS X. On Ubuntu Linux, one can write
|
||||||
```
|
```
|
||||||
> parse "this delicious cheese is very Italian" | visualize_tree -view="open"
|
> parse "this delicious cheese is very Italian" | visualize_tree -view="eog"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#MYTREE
|
#MYTREE
|
||||||
|
|
||||||
This command uses the program [Graphviz http://www.graphviz.org/], which you
|
This command uses the program [Graphviz http://www.graphviz.org/], which you
|
||||||
@@ -1365,6 +1366,17 @@ Thus Italian says ``vino italiano`` for ``Italian wine``.
|
|||||||
are put before the noun. This distinction can be controlled by parameters,
|
are put before the noun. This distinction can be controlled by parameters,
|
||||||
which are introduced in #Rchapfour.)
|
which are introduced in #Rchapfour.)
|
||||||
|
|
||||||
|
Multilingual grammars have yet another visualization option:
|
||||||
|
**word alignment**, which shows what words correspond to each other.
|
||||||
|
Technically, this means words that have the same smallest spanning subtrees
|
||||||
|
in abstract syntax. The command is ``align_words = aw``:
|
||||||
|
```
|
||||||
|
> parse "this delicious cheese is very Italian" | align_words
|
||||||
|
```
|
||||||
|
|
||||||
|
[align2.png]
|
||||||
|
|
||||||
|
|
||||||
#NEW
|
#NEW
|
||||||
|
|
||||||
===Exercises on multilinguality===
|
===Exercises on multilinguality===
|
||||||
|
|||||||
BIN
doc/tutorial/myparse.png
Normal file
BIN
doc/tutorial/myparse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Reference in New Issue
Block a user