com.hankcs.hanlp.seg.common
类 Graph

java.lang.Object
  继承者 com.hankcs.hanlp.seg.common.Graph

public class Graph
extends Object

作者:
hankcs

字段摘要
 List<EdgeFrom>[] edgesTo
          边,到达下标i
 Vertex[] vertexes
          顶点
 
构造方法摘要
Graph(Vertex[] vertexes)
          将一个词网转为词图
 
方法摘要
 void connect(int from, int to, double weight)
          连接两个节点
 List<EdgeFrom> getEdgeListTo(int to)
          获取到达顶点to的边列表
 List<EdgeFrom>[] getEdgesTo()
           
 Vertex[] getVertexes()
           
 List<Vertex> parsePath(int[] path)
          根据节点下标数组解释出对应的路径
static String parseResult(List<Vertex> path)
          从一个路径中转换出空格隔开的结果
 String printByTo()
           
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

vertexes

public Vertex[] vertexes
顶点


edgesTo

public List<EdgeFrom>[] edgesTo
边,到达下标i

构造方法详细信息

Graph

public Graph(Vertex[] vertexes)
将一个词网转为词图

参数:
vertexes - 顶点数组
方法详细信息

connect

public void connect(int from,
                    int to,
                    double weight)
连接两个节点

参数:
from - 起点
to - 终点
weight - 花费

getEdgeListTo

public List<EdgeFrom> getEdgeListTo(int to)
获取到达顶点to的边列表

参数:
to - 到达顶点to
返回:
到达顶点to的边列表

toString

public String toString()
覆盖:
Object 中的 toString

printByTo

public String printByTo()

parsePath

public List<Vertex> parsePath(int[] path)
根据节点下标数组解释出对应的路径

参数:
path -
返回:

parseResult

public static String parseResult(List<Vertex> path)
从一个路径中转换出空格隔开的结果

参数:
path -
返回:

getVertexes

public Vertex[] getVertexes()

getEdgesTo

public List<EdgeFrom>[] getEdgesTo()


Copyright © 2014–2015 码农场. All rights reserved.