|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectarch.PhoneInventory
public class PhoneInventory
The PhoneInventory handles storage and loading of (poly)phone inventories. It is also used within the LexicalTree to model the contained words.
Constructor Summary | |
---|---|
PhoneInventory()
|
Method Summary | |
---|---|
void |
addPolyphone(Polyphone p)
Add a single polyphone to the inventory, ignore if already present. |
void |
addPolyphones(Polyphone[] ps)
Add a list of polyphones to the inventory. |
void |
addPolyphonesFromLexicon(Lexicon lex)
Add all polyphones occurring in the given Lexicon |
void |
clearPhoneInventory()
Clear the inventory for a clean start. |
Polyphone |
getMonophone(java.lang.String phone)
Retrieve the most general polyphone for the given phone |
Polyphone |
getPolyphone(java.lang.String phoneInContext)
Retrieve a certain polyphone |
java.lang.String |
hierarchyAsDotFormat(boolean includeHeader)
Generate a .dot representation of the phoneme hierarchy for a visual check |
java.lang.String |
hierarchyAsString()
Get a String representation of the phone inventory, including the polyphone hierarchy. |
static void |
main(java.lang.String[] args)
|
void |
prunePhonemeHierarchy()
Prune the unneeded polyphones, i.e. |
void |
prunePhonemeHierarchyByOccurrence(int minOcc,
Lexicon lex,
java.lang.String sentenceFile)
Prune the phoneme hierarchy by their number of occurrence. |
void |
reduceToBiphone()
Reduce the phone inventory to a mono- and biphone inventory |
void |
reduceToMonophone()
Reduce the phone inventory to a monophone ONLY inventory |
void |
reduceToTriphone()
Reduce the phone inventory to a mono-, bi and tri-phone inventory |
int |
size()
Get the size of the phone inventory. |
java.lang.String |
toString()
Return information about this PhoneInventory. |
Polyphone[] |
translateWord(java.lang.String[] transcription)
Construct the Polyphone sequence for a given transcription. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PhoneInventory()
Method Detail |
---|
public void addPolyphone(Polyphone p)
p
- Polyphone to insert.public void addPolyphones(Polyphone[] ps)
ps
- Array of Polyphone instancespublic void addPolyphonesFromLexicon(Lexicon lex)
lex
- public void clearPhoneInventory()
public Polyphone getMonophone(java.lang.String phone)
phone
-
public Polyphone getPolyphone(java.lang.String phoneInContext)
phoneInContext
- e.g. S/n/o
public java.lang.String hierarchyAsDotFormat(boolean includeHeader)
public java.lang.String hierarchyAsString()
public static void main(java.lang.String[] args) throws java.io.IOException, java.lang.ClassNotFoundException, OutOfVocabularyException
java.io.IOException
java.lang.ClassNotFoundException
OutOfVocabularyException
public void prunePhonemeHierarchy()
public void prunePhonemeHierarchyByOccurrence(int minOcc, Lexicon lex, java.lang.String sentenceFile) throws java.io.IOException, OutOfVocabularyException
minOcc
- minimum number of occurrences of remaining polyphoneslex
- Lexicon to transcribe the sentencessentenceFile
- file containing line-by-line sentences
java.io.IOException
OutOfVocabularyException
public void reduceToBiphone()
public void reduceToMonophone()
public void reduceToTriphone()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public Polyphone[] translateWord(java.lang.String[] transcription)
transcription
- word transcription including word boundaries at beginning and end!
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |