net.java.sen.dictionary
Class DictionaryUtil

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

public class DictionaryUtil
extends Object

encoding methods for packing the POS file (mostly from Lucene)


Constructor Summary
DictionaryUtil()
           
 
Method Summary
static void readKatakana(ByteBuffer b, char[] s, int off, int len)
           
static void readString(ByteBuffer b, char[] s, int off, int len)
           
static int readVInt(ByteBuffer bb)
          Reads an int stored in variable-length format.
static void writeKatakana(DataOutput d, String s)
           
static void writeVInt(DataOutput d, int i)
          Writes an int in a variable-length format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryUtil

public DictionaryUtil()
Method Detail

readVInt

public static int readVInt(ByteBuffer bb)
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

See Also:
DataOutput#writeVInt(int)

writeVInt

public static void writeVInt(DataOutput d,
                             int i)
                      throws IOException
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

Throws:
IOException
See Also:
DataInput#readVInt()

writeKatakana

public static void writeKatakana(DataOutput d,
                                 String s)
                          throws IOException
Throws:
IOException

readString

public static void readString(ByteBuffer b,
                              char[] s,
                              int off,
                              int len)

readKatakana

public static void readKatakana(ByteBuffer b,
                                char[] s,
                                int off,
                                int len)


Copyright © 2012. All Rights Reserved.