|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.hankcs.hanlp.collection.MDAG.MDAG
public class MDAG
最小环形图
A minimalistic directed acyclical graph suitable for storing a set of Strings.
| 字段摘要 | |
|---|---|
protected TreeSet<Character> |
charTreeSet
字母表 |
protected HashMap<MDAGNode,MDAGNode> |
equivalenceClassMDAGNodeHashMap
等价类集合,相当于论文中的register |
protected SimpleMDAGNode[] |
mdagDataArray
调用simplify()后填充此空间 |
protected SimpleMDAGNode |
simplifiedSourceNode
简化后的根节点(简化指的是用数组简化,而不是最小化,这个结构永远是最小化的) |
protected MDAGNode |
sourceNode
根节点 |
protected int |
transitionCount
所有边的数量 |
| 构造方法摘要 | |
|---|---|
MDAG()
空白图 |
|
MDAG(Collection<String> strCollection)
Creates an MDAG from a collection of Strings. |
|
MDAG(File dataFile)
从一个文件建立MDAG Creates an MDAG from a newline delimited file containing the data of interest. |
|
| 方法摘要 | |
|---|---|
HashMap<MDAGNode,MDAGNode> |
_getEquivalenceClassMDAGNodeHashMap()
调试用 |
void |
addString(String str)
Adds a string to the MDAG. |
void |
addStrings(Collection<String> strCollection)
Adds a Collection of Strings to the MDAG. |
boolean |
contains(String str)
是否包含 Determines whether a String is present in the MDAG. |
HashSet<String> |
getAllStrings()
取出所有key Retrieves all the valid Strings that have been inserted in to the MDAG. |
SimpleMDAGNode[] |
getSimpleMDAGArray()
获取简化后的状态Array Returns the array of SimpleMDAGNodes collectively containing the data of this MDAG, or null if it hasn't been simplified yet. |
HashSet<String> |
getStringsEndingWith(String suffixStr)
后缀查询 Retrieves all the Strings in the MDAG that begin with a given String. |
HashSet<String> |
getStringsStartingWith(String prefixStr)
前缀查询 Retrieves all the Strings in the MDAG that begin with a given String. |
HashSet<String> |
getStringsWithSubstring(String str)
返回包含字串的key Retrieves all the Strings in the MDAG that contain a given String. |
boolean |
load(ByteArray byteArray)
载入 |
void |
removeString(String str)
Removes a String from the MDAG. |
void |
save(DataOutputStream out)
写入 |
void |
simplify()
固化自己 Creates a space-saving version of the MDAG in the form of an array. |
void |
unSimplify()
解压缩 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected MDAGNode sourceNode
protected SimpleMDAGNode simplifiedSourceNode
protected HashMap<MDAGNode,MDAGNode> equivalenceClassMDAGNodeHashMap
protected SimpleMDAGNode[] mdagDataArray
protected TreeSet<Character> charTreeSet
protected int transitionCount
| 构造方法详细信息 |
|---|
public MDAG(File dataFile)
throws IOException
dataFile - a File representation of a file
containing the Strings that the MDAG will contain
IOException - if datafile cannot be opened, or a read operation on it cannot be carried outpublic MDAG(Collection<String> strCollection)
strCollection - a Collection containing Strings that the MDAG will containpublic MDAG()
| 方法详细信息 |
|---|
public void save(DataOutputStream out)
throws Exception
ICacheAble 复制的描述
ICacheAble 中的 saveExceptionpublic boolean load(ByteArray byteArray)
ICacheAble 复制的描述
ICacheAble 中的 loadpublic final void addStrings(Collection<String> strCollection)
strCollection - a Collection containing Strings to be added to the MDAGpublic void addString(String str)
str - the String to be added to the MDAGpublic void removeString(String str)
str - the String to be removed from the MDAGpublic void simplify()
public void unSimplify()
public boolean contains(String str)
str - the String to be searched for
str is present in the MDAG, and false otherwisepublic HashSet<String> getAllStrings()
public HashSet<String> getStringsStartingWith(String prefixStr)
prefixStr - a String that is the prefix for all the desired Strings
prefixStringpublic HashSet<String> getStringsWithSubstring(String str)
str - a String that is contained in all the desired Strings
prefixStringpublic HashSet<String> getStringsEndingWith(String suffixStr)
suffixStr - a String that is the suffix for all the desired Strings
suffixStrpublic SimpleMDAGNode[] getSimpleMDAGArray()
public HashMap<MDAGNode,MDAGNode> _getEquivalenceClassMDAGNodeHashMap()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||