edu.cmu.sphinx.linguist.dictionary
Class Word

java.lang.Object
  extended byedu.cmu.sphinx.linguist.dictionary.Word

public class Word
extends java.lang.Object

Represents a word, its spelling and its pronunciation.


Field Summary
static Word UNKNOWN
          The Word representing the unknown word.
 
Constructor Summary
Word(java.lang.String spelling, Pronunciation[] pronunciations, boolean isFiller)
          Creates a Word
 
Method Summary
 Pronunciation getMostLikelyPronunciation()
          Get the highest probability pronunciation for a word
 Pronunciation[] getPronunciations()
          Retrieves the pronunciations of this word
 Pronunciation[] getPronunciations(WordClassification wordClassification)
          Retrieves the pronunciations of this word
 java.lang.String getSpelling()
          Returns the spelling of the word.
 boolean isFiller()
          Determines if this is a filler word
 boolean isSentenceEndWord()
          Returns true if this word is an end of sentence word
 boolean isSentenceStartWord()
          Returns true if this word is a start of sentence word
 java.lang.String toString()
          Returns a string representation of this word, which is the spelling
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final Word UNKNOWN
The Word representing the unknown word.

Constructor Detail

Word

public Word(java.lang.String spelling,
            Pronunciation[] pronunciations,
            boolean isFiller)
Creates a Word

Parameters:
spelling - the spelling of this word
pronunciations - the pronunciations of this word
isFiller - true if the word is a filler word
Method Detail

getSpelling

public java.lang.String getSpelling()
Returns the spelling of the word.

Returns:
the spelling of the word

isFiller

public boolean isFiller()
Determines if this is a filler word

Returns:
true if this word is a filler word, otherwise it returns false

isSentenceEndWord

public boolean isSentenceEndWord()
Returns true if this word is an end of sentence word

Returns:
true if the word matches Dictionary.SENTENCE_END_SPELLING

isSentenceStartWord

public boolean isSentenceStartWord()
Returns true if this word is a start of sentence word

Returns:
true if the word matches Dictionary.SENTENCE_START_SPELLING

getPronunciations

public Pronunciation[] getPronunciations(WordClassification wordClassification)
Retrieves the pronunciations of this word

Parameters:
wordClassification - the classification of the word (typically part of speech classification) or null if all word classifications are acceptable. The word classification must be one of the set returned by Dictionary.getPossibleWordClassifications
Returns:
the pronunciations of this word

getPronunciations

public Pronunciation[] getPronunciations()
Retrieves the pronunciations of this word

Returns:
the pronunciations of this word

getMostLikelyPronunciation

public Pronunciation getMostLikelyPronunciation()
Get the highest probability pronunciation for a word

Returns:
the highest probability pronunciation

toString

public java.lang.String toString()
Returns a string representation of this word, which is the spelling

Returns:
the spelling of this word