Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
Toy-MT-Introduction
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
NiuTrans
Toy-MT-Introduction
Commits
f296f667
Commit
f296f667
authored
May 23, 2020
by
单韦乔
Browse files
Options
Browse Files
Download
Plain Diff
合并分支 'shanweiqiao' 到 'caorunzhe'
删除第四章多余图片 查看合并请求
!255
parents
7ca04ad0
748fc3eb
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
0 行增加
和
52 行删除
+0
-52
Book/Chapter4/Figures/cyk-algorithm.tex
+0
-38
Book/Chapter4/Figures/example-of-cyk-algorithm-execution-label.tex
+0
-14
Book/Chapter4/Figures/example-of-cyk-algorithm-execution.tex
+0
-0
没有找到文件。
Book/Chapter4/Figures/cyk-algorithm.tex
deleted
100644 → 0
查看文件 @
7ca04ad0
%------------------------------------------------------------------------------------------------------------
%%% CYK解码
% 看NiuTrans Manual
\begin{center}
\begin{tikzpicture}
\tikzstyle
{
alignmentnode
}
= [rectangle,fill=blue!30,minimum size=0.45em,text=white,inner sep=0.1pt]
\tikzstyle
{
selectnode
}
= [rectangle,fill=green!20,minimum height=1.5em,minimum width=1.5em,inner sep=1.2pt]
\tikzstyle
{
srcnode
}
= [anchor=south west]
\begin{scope}
[scale=0.85]
\node
[srcnode]
(c1) at (0,0)
{
\normalsize
{
\textbf
{
Function
}
CYK-Algorithm(
$
\textbf
{
s
}
,G
$
)
}}
;
\node
[srcnode,anchor=north west]
(c21) at ([xshift=1.5em,yshift=0.4em]c1.south west)
{
\normalsize
{
\textbf
{
fore
}
$
j
=
0
$
to
$
J
-
1
$}}
;
\node
[srcnode,anchor=north west]
(c22) at ([xshift=1.5em,yshift=0.4em]c21.south west)
{
\normalsize
{$
span
[
j,j
+
1
]
$
.Add(
$
A
\to
a
\in
G
$
)
}}
;
\node
[srcnode,anchor=north west]
(c3) at ([xshift=-1.5em,yshift=0.4em]c22.south west)
{
\normalsize
{
\textbf
{
for
}
$
l
$
= 1 to
$
J
$}}
;
\node
[srcnode,anchor=west]
(c31) at ([xshift=6em]c3.east)
{
\normalsize
{
// length of span
}}
;
\node
[srcnode,anchor=north west]
(c4) at ([xshift=1.5em,yshift=0.4em]c3.south west)
{
\normalsize
{
\textbf
{
for
}
$
j
$
= 0 to
$
J
-
l
$}}
;
\node
[srcnode,anchor=north west]
(c41) at ([yshift=0.4em]c31.south west)
{
\normalsize
{
// beginning of span
}}
;
\node
[srcnode,anchor=north west]
(c5) at ([xshift=1.5em,yshift=0.4em]c4.south west)
{
\normalsize
{
\textbf
{
for
}
$
k
$
=
$
j
$
to
$
j
+
l
$}}
;
\node
[srcnode,anchor=north west]
(c51) at ([yshift=0.4em]c41.south west)
{
\normalsize
{
// partition of span
}}
;
\node
[srcnode,anchor=north west]
(c6) at ([xshift=1.5em,yshift=0.4em]c5.south west)
{
\normalsize
{$
hypos
$
= Compose(
$
span
[
j, k
]
, span
[
k, j
+
l
]
$
)
}}
;
\node
[srcnode,anchor=north west]
(c7) at ([yshift=0.4em]c6.south west)
{
\normalsize
{$
span
[
j, j
+
l
]
$
.Update(
$
hypos
$
)
}}
;
\node
[srcnode,anchor=north west]
(c8) at ([xshift=-4.5em,yshift=0.4em]c7.south west)
{
\normalsize
{
\textbf
{
return
}
$
span
[
0
, J
]
$}}
;
\node
[anchor=west]
(c9) at ([xshift=-3.2em,yshift=1.7em]c1.west)
{
\small
{
\textrm
{
参数:
}
\textbf
{
s
}
为输入字符串。
$
G
$
为输入CFG。
$
J
$
为待分析字符串长度。
}}
;
\node
[anchor=west]
(c10) at ([xshift=0em,yshift=1.3em]c9.west)
{
\small
{
\textrm
{
输出:字符串全部可能的语法分析结果
}}}
;
\node
[anchor=west]
(c11) at ([xshift=0em,yshift=1.3em]c10.west)
{
\small
{
\textrm
{
输入:符合乔姆斯基范式的待分析字符串和一个上下文无关文法(CFG)
}}}
;
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=0.2em,rounded corners=1pt,fill=blue!10!white] [fit = (c1) (c21) (c3) (c6) (c7) (c8) (c11)] (gl1)
{}
;
\end{pgfonlayer}
\end{scope}
\end{tikzpicture}
\end{center}
Book/Chapter4/Figures/example-of-cyk-algorithm-execution-label.tex
deleted
100644 → 0
查看文件 @
7ca04ad0
%------------------------------------------------------------------------------------------------------------
%%% 基于树的解码方法 - chart-based decoding
\begin{center}
\begin{tikzpicture}
\footnotesize
\begin{scope}
[scale=0.2]
\node
[anchor=south east]
(g1) at (0,0)
{
\small
{$
\textrm
{
S
}
\to
\textrm
{
AB
}
\ \ \ \textrm
{
A
}
\to
\textrm
{
CD
}
\ \vert
\ \textrm
{
CF
}
\ \ \ \textrm
{
B
}
\to
\textrm
{
c
}
\ \vert
\ \textrm
{
BE
}$}}
;
\node
[anchor=north west]
(g2) at ([yshift=0.3em]g1.south west)
{
\small
{$
\textrm
{
C
}
\to
\textrm
{
a
}
\ \ \ \ \textrm
{
D
}
\to
\textrm
{
b
}
\ \ \ \ \textrm
{
E
}
\to
\textrm
{
c
}
\ \ \ \ \textrm
{
F
}
\to
\textrm
{
AD
}$}}
;
\begin{pgfonlayer}
{
background
}
\node
[rectangle,inner sep=0.1em,rounded corners=1pt,fill=green!10,drop shadow,draw=ugreen] [fit = (g1) (g2)] (gl1)
{}
;
\end{pgfonlayer}
\end{scope}
\end{tikzpicture}
\end{center}
Book/Chapter4/Figures/example-of-cyk-algorithm-execution.tex
deleted
100644 → 0
查看文件 @
7ca04ad0
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论