Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.corpus.Vocabulary Class Reference
Collaboration diagram for joshua.corpus.Vocabulary:
[legend]

List of all members.

Classes

class  HashCollisionException
class  UnknownSymbolException

Static Public Member Functions

static boolean registerLanguageModel (NGramLanguageModel lm)
static boolean read (String file_name) throws IOException
static void write (String file_name) throws IOException
static void freeze ()
static int id (String token)
static boolean hasId (int id)
static int[] addAll (String sentence)
static String word (int id)
static String getWords (int[] ids)
static String getWords (Iterable< Integer > ids)
static int getUnknownId ()
static String getUnknownWord ()
static boolean nt (int id)
static boolean idx (int id)
static boolean nt (String word)
static int size ()
static int getTargetNonterminalIndex (int id)
static Iterator< String > wordIterator ()

Static Package Functions

 [static initializer]

Static Private Member Functions

static void clear ()

Static Private Attributes

static final Logger logger
static ArrayList
< NGramLanguageModel
lms
static TreeMap< Long, Integer > hashToId
static ArrayList< String > idToString
static TreeMap< Long, String > hashToString
static final Integer lock = new Integer(0)
static final int UNKNOWN_ID
static final String UNKNOWN_WORD

Detailed Description

Static singular vocabulary class. Supports vocabulary freezing and (de-)serialization into a vocabulary file.

Author:
Juri Ganitkevitch

Member Function Documentation

joshua.corpus.Vocabulary.[static initializer] ( ) [static, package]
static int [] joshua.corpus.Vocabulary.addAll ( String  sentence) [static]

Here is the caller graph for this function:

static void joshua.corpus.Vocabulary.clear ( ) [static, private]

Here is the caller graph for this function:

static void joshua.corpus.Vocabulary.freeze ( ) [static]

Here is the call graph for this function:

Here is the caller graph for this function:

static int joshua.corpus.Vocabulary.getTargetNonterminalIndex ( int  id) [static]

Here is the call graph for this function:

Here is the caller graph for this function:

static int joshua.corpus.Vocabulary.getUnknownId ( ) [static]
static String joshua.corpus.Vocabulary.getUnknownWord ( ) [static]
static String joshua.corpus.Vocabulary.getWords ( int[]  ids) [static]

Here is the call graph for this function:

Here is the caller graph for this function:

static String joshua.corpus.Vocabulary.getWords ( Iterable< Integer >  ids) [static]

Here is the call graph for this function:

static boolean joshua.corpus.Vocabulary.hasId ( int  id) [static]
static int joshua.corpus.Vocabulary.id ( String  token) [static]

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean joshua.corpus.Vocabulary.idx ( int  id) [static]

Here is the caller graph for this function:

static boolean joshua.corpus.Vocabulary.nt ( int  id) [static]

Here is the caller graph for this function:

static boolean joshua.corpus.Vocabulary.nt ( String  word) [static]

Here is the call graph for this function:

static boolean joshua.corpus.Vocabulary.read ( String  file_name) throws IOException [static]

Reads a vocabulary from file. This deletes any additions to the vocabulary made prior to reading the file.

Parameters:
file_name
Returns:
Returns true if vocabulary was read without mismatches or collisions.
Exceptions:
IOException

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

static int joshua.corpus.Vocabulary.size ( ) [static]

Here is the caller graph for this function:

static String joshua.corpus.Vocabulary.word ( int  id) [static]

Here is the caller graph for this function:

static Iterator<String> joshua.corpus.Vocabulary.wordIterator ( ) [static]
static void joshua.corpus.Vocabulary.write ( String  file_name) throws IOException [static]

Here is the caller graph for this function:


Member Data Documentation

TreeMap<Long, Integer> joshua.corpus.Vocabulary.hashToId [static, private]
TreeMap<Long, String> joshua.corpus.Vocabulary.hashToString [static, private]
ArrayList<String> joshua.corpus.Vocabulary.idToString [static, private]
ArrayList<NGramLanguageModel> joshua.corpus.Vocabulary.lms [static, private]
final Integer joshua.corpus.Vocabulary.lock = new Integer(0) [static, private]
final Logger joshua.corpus.Vocabulary.logger [static, private]
final int joshua.corpus.Vocabulary.UNKNOWN_ID [static, private]
final String joshua.corpus.Vocabulary.UNKNOWN_WORD [static, private]