marytts.tools.transcription
Class TranscriptionTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by marytts.tools.transcription.TranscriptionTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class TranscriptionTableModel
extends javax.swing.table.AbstractTableModel

TranscriptionTableModel, an AbstractTableModel, stores transcription data

Author:
sathish pammi
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TranscriptionTableModel()
           
TranscriptionTableModel(java.lang.String fileName)
           
 
Method Summary
 void createLexicon(java.lang.String lexiconFilename, java.lang.String fstFilename)
          Creates lexicon in FST format and letter-to-sound models
 void createPOSFst(java.lang.String posFilename, java.lang.String fstFilename)
           
 java.lang.Class getColumnClass(int c)
           
 int getColumnCount()
          get column count
 java.lang.String getColumnName(int col)
          get column name
 boolean[] getCorrectSyntaxList()
           
 java.lang.Object[][] getData()
           
 java.lang.Object getDataAt(int x, int y)
           
 boolean[] getManualVerifiedList()
           
 int getRowCount()
          get row count
 java.lang.Object getValueAt(int row, int col)
          get value at given location
 boolean hasFunctionalData()
           
 boolean hasLexiconData()
           
 boolean isCellEditable(int row, int col)
           
 boolean isDataModified()
           
 void loadTranscription(java.util.ArrayList<java.lang.String> wordList)
           
 void loadTranscription(java.util.HashMap<java.lang.String,java.lang.Integer> wordList)
          Deprecated. 
 void loadTranscription(java.lang.String fileName, boolean keepCurrentData)
          Load transcription from file, either replacing or adding to any existing data.
 void saveFunctionalWords(java.lang.String fileName)
          Save all functional words into text file
 void saveSampaLexiconFormat(java.lang.String fileName)
          Save user entered and verified transcription in to lexicon format
 void saveSampaLexiconFormat(java.lang.String fileName, AllophoneSet phoneSet)
          Save user entered and verified transcription in to lexicon format
 void saveTranscription(java.lang.String fileName)
          Save transcription to a file
 void setAsCorrectSyntax(int x, boolean t)
           
 void setAsManualVerify(int x, boolean t)
           
 void setValueAt(java.lang.Object value, int row, int col)
           
 void testFST(java.lang.String lexiconFilename, java.lang.String fstFilename)
          For all words in lexicon, verify if they can be looked up in fst file.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranscriptionTableModel

public TranscriptionTableModel()

TranscriptionTableModel

public TranscriptionTableModel(java.lang.String fileName)
                        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getDataAt

public java.lang.Object getDataAt(int x,
                                  int y)

getData

public java.lang.Object[][] getData()

setAsManualVerify

public void setAsManualVerify(int x,
                              boolean t)

setAsCorrectSyntax

public void setAsCorrectSyntax(int x,
                               boolean t)

getManualVerifiedList

public boolean[] getManualVerifiedList()

getCorrectSyntaxList

public boolean[] getCorrectSyntaxList()

saveTranscription

public void saveTranscription(java.lang.String fileName)
                       throws java.lang.Exception
Save transcription to a file

Parameters:
fileName -
Throws:
java.lang.Exception

loadTranscription

public void loadTranscription(java.lang.String fileName,
                              boolean keepCurrentData)
                       throws java.lang.Exception
Load transcription from file, either replacing or adding to any existing data. If adding, only words not contained in the existing data will be added.

Parameters:
fileName -
whether - to keep any current data and add, or use only the loaded data.
Throws:
java.lang.Exception

loadTranscription

@Deprecated
public void loadTranscription(java.util.HashMap<java.lang.String,java.lang.Integer> wordList)
                       throws java.lang.Exception
Deprecated. 

Load transcription from HashMap

Parameters:
wordList -
Throws:
java.lang.Exception

loadTranscription

public void loadTranscription(java.util.ArrayList<java.lang.String> wordList)

saveSampaLexiconFormat

public void saveSampaLexiconFormat(java.lang.String fileName)
                            throws java.io.IOException
Save user entered and verified transcription in to lexicon format

Parameters:
fileName -
Throws:
java.io.IOException

saveSampaLexiconFormat

public void saveSampaLexiconFormat(java.lang.String fileName,
                                   AllophoneSet phoneSet)
                            throws java.io.IOException
Save user entered and verified transcription in to lexicon format

Parameters:
fileName -
Throws:
java.io.IOException

saveFunctionalWords

public void saveFunctionalWords(java.lang.String fileName)
                         throws java.io.IOException
Save all functional words into text file

Parameters:
fileName -
Throws:
java.io.IOException

hasFunctionalData

public boolean hasFunctionalData()

hasLexiconData

public boolean hasLexiconData()

testFST

public void testFST(java.lang.String lexiconFilename,
                    java.lang.String fstFilename)
             throws java.io.IOException
For all words in lexicon, verify if they can be looked up in fst file.

Parameters:
lexiconFilename -
fstFilename -
Throws:
java.io.IOException

createPOSFst

public void createPOSFst(java.lang.String posFilename,
                         java.lang.String fstFilename)
                  throws java.lang.Exception
Throws:
java.lang.Exception

createLexicon

public void createLexicon(java.lang.String lexiconFilename,
                          java.lang.String fstFilename)
                   throws java.lang.Exception
Creates lexicon in FST format and letter-to-sound models

Parameters:
lexiconFilename -
fstFilename -
Throws:
java.lang.Exception

getColumnCount

public int getColumnCount()
get column count


getRowCount

public int getRowCount()
get row count


getColumnName

public java.lang.String getColumnName(int col)
get column name

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
get value at given location


getColumnClass

public java.lang.Class getColumnClass(int c)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

isDataModified

public boolean isDataModified()