com.ibm.icu.text
Class BreakDictionary

java.lang.Object
  extended by com.ibm.icu.text.BreakDictionary

Deprecated. This API is ICU internal only.

public class BreakDictionary
extends java.lang.Object

This is the class that represents the list of known words used by DictionaryBasedBreakIterator. The conceptual data structure used here is a trie: there is a node hanging off the root node for every letter that can start a word. Each of these nodes has a node hanging off of it for every letter that can be the second letter of a word if this node is the first letter, and so on. The trie is represented as a two-dimensional array that can be treated as a table of state transitions. Indexes are used to compress this array, taking advantage of the fact that this array will always be very sparse.


Constructor Summary
BreakDictionary(java.io.InputStream dictionaryStream)
          Deprecated. This API is ICU internal only.
 
Method Summary
 short at(int row, char ch)
          Deprecated. This API is ICU internal only.
 short at(int row, int col)
          Deprecated. This API is ICU internal only.
static void main(java.lang.String[] args)
          Deprecated. This API is ICU internal only.
 void printWordList(java.lang.String partialWord, int state, java.io.PrintWriter out)
          Deprecated. This API is ICU internal only.
 void readDictionaryFile(java.io.DataInputStream in)
          Deprecated. This API is ICU internal only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreakDictionary

public BreakDictionary(java.io.InputStream dictionaryStream)
                throws java.io.IOException
Deprecated. This API is ICU internal only.

Throws:
java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.UnsupportedEncodingException,
                        java.io.IOException
Deprecated. This API is ICU internal only.

Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException

printWordList

public void printWordList(java.lang.String partialWord,
                          int state,
                          java.io.PrintWriter out)
                   throws java.io.IOException
Deprecated. This API is ICU internal only.

Throws:
java.io.IOException

readDictionaryFile

public void readDictionaryFile(java.io.DataInputStream in)
                        throws java.io.IOException
Deprecated. This API is ICU internal only.

Throws:
java.io.IOException

at

public final short at(int row,
                      char ch)
Deprecated. This API is ICU internal only.

Uses the column map to map the character to a column number, then passes the row and column number to the other version of at()

Parameters:
row - The current state
ch - The character whose column we're interested in
Returns:
The new state to transition to

at

public final short at(int row,
                      int col)
Deprecated. This API is ICU internal only.

Returns the value in the cell with the specified (logical) row and column numbers. In DictionaryBasedBreakIterator, the row number is a state number, the column number is an input, and the return value is the row number of the new state to transition to. (0 is the "error" state, and -1 is the "end of word" state in a dictionary)

Parameters:
row - The row number of the current state
col - The column number of the input character (0 means "not a dictionary character")
Returns:
The row number of the new state to transition to


Copyright (c) 2007 IBM Corporation and others.