net.java.sen.dictionary
Class Dictionary

java.lang.Object
  extended by net.java.sen.dictionary.Dictionary

public class Dictionary
extends Object

The Dictionary class wraps access to a compiled Sen dictionary


Constructor Summary
Dictionary(ShortBuffer connectionCostBuffer, ByteBuffer partOfSpeechInfoBuffer, ByteBuffer tokenBuffer, IntBuffer trieBuffer, String[] posIndex, String[] conjTypeIndex, String[] conjFormIndex)
           
 
Method Summary
 CToken[] commonPrefixSearch(CharIterator iterator)
          Searches for possible morphemes starting at the current position of a CharIterator.
 CToken getBOSToken()
          Gets a unique beginning-of-string CToken.
 int getCost(Node lNode2, Node lNode, Node rNode)
          Retrieves the cost between three Nodes from the connection cost matrix
 CToken getEOSToken()
          Gets a unique end-of-string CToken.
 CToken getUnknownToken()
          Gets a unique unknown-morpheme CToken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dictionary

public Dictionary(ShortBuffer connectionCostBuffer,
                  ByteBuffer partOfSpeechInfoBuffer,
                  ByteBuffer tokenBuffer,
                  IntBuffer trieBuffer,
                  String[] posIndex,
                  String[] conjTypeIndex,
                  String[] conjFormIndex)
Throws:
IOException
Method Detail

getBOSToken

public CToken getBOSToken()
Gets a unique beginning-of-string CToken. The CToken returned by this method is freshly cloned and not an alias of any other CToken

Returns:
A beginning-of-string CToken

getEOSToken

public CToken getEOSToken()
Gets a unique end-of-string CToken. The CToken returned by this method is freshly cloned and not an alias of any other CToken

Returns:
An end-of-string CToken

getUnknownToken

public CToken getUnknownToken()
Gets a unique unknown-morpheme CToken. The CToken returned by this method is freshly cloned and not an alias of any other CToken

Returns:
A unknown-morpheme CToken

getCost

public int getCost(Node lNode2,
                   Node lNode,
                   Node rNode)
Retrieves the cost between three Nodes from the connection cost matrix

Parameters:
lNode2 - The first Node
lNode - The second Node
rNode - The third Node
Returns:
The connection cost

commonPrefixSearch

public CToken[] commonPrefixSearch(CharIterator iterator)
Searches for possible morphemes starting at the current position of a CharIterator. The iterator is advanced by the length of the longest matching morpheme

Parameters:
iterator - The iterator to search from
Returns:
The possible morphemes found


Copyright © 2012. All Rights Reserved.