1 // Implementation of most LinguisticaMainWindow methods
2 // Copyright © 2009 The University of Chicago
3 #include "linguisticamainwindow.h"
10 #include <QDesktopWidget>
11 #include <QProgressBar>
12 #include <QMessageBox>
13 #include <Q3PopupMenu>
15 #include <QResizeEvent>
16 #include <QCloseEvent>
19 #include <Q3TextStream>
20 #include <Q3ValueList>
21 #include "listbuilderdialog.h"
22 #include "helpaboutdialog.h"
23 #include "verifydialog.h"
24 #include "LPreferences.h"
25 #include "GraphicView.h"
26 #include "GUIclasses.h"
27 #include "gui/Status.h"
28 #include "Sequencer.h"
29 #include "DLHistory.h"
33 #include "MiniLexicon.h"
35 #include "Signature.h"
37 #include "SignatureCollection.h"
38 #include "TemplateCollection.h"
39 #include "SuffixCollection.h"
40 #include "PrefixCollection.h"
41 #include "StemCollection.h"
42 #include "WordCollection.h"
43 #include "CommandLine.h"
48 // command-line argument parsing helper
49 struct command_line_args
{
50 QString corpus
, logFile
, goldStdFile
, outputDir
, error
;
57 command_line_args() : mini(false),
58 prefix(false), suffix(false),
59 verbose(false), count(0) { }
60 /// result is false for --help and errors
61 bool process(int argc
, char** argv
)
63 return processCommandLineArgs(argc
, argv
,
64 corpus
, count
, logFile
, goldStdFile
,
65 outputDir
, mini
, prefix
, suffix
,
71 LinguisticaMainWindow::LinguisticaMainWindow( const int argc
, char** argv
,
72 QApplication
* app
, QWidget
* parent
, Qt::WindowFlags f
)
73 : QMainWindow(parent
, f
), Ui::LinguisticaMainWindowBase(),
76 m_commandLineFlag(argc
> 1),
78 // XXX. set organization string "UChicago", application "Linguistica"
80 m_preferences(&m_Settings
),
82 m_lexicon(new CLexicon(this)),
93 m_logFileName(m_Settings
.value(
94 "/linguistica.uchicago.edu/Linguistica/MainWindow/LogFile/FileName",
95 QString("C:\\.txt")).value
<QString
>()),
98 // Status/Progress bar
101 m_progressText1(), m_progressText2(),
103 m_counterDisplayFlag(false),
107 m_projectDirectory(m_Settings
.value(
108 "/linguistica.uchicago.edu/Linguistica/Project/Directory",
109 QString()).value
<QString
>()),
111 m_projectDirty(false), // No changes yet
113 m_corpusFileName(m_Settings
.value(
114 "/linguistica.uchicago.edu/Linguistica/MainWindow/FileMenu/Open",
115 QString()).value
<QString
>()),
116 m_goldStdFileName(m_Settings
.value(
117 "/linguistica.uchicago.edu/Linguistica/MainWindow/DiagnosticsMenu/NewGoldStdFile",
118 QString()).value
<QString
>()),
119 m_goldStdOutputFile(),
121 m_EncodingType(m_Settings
.value(
122 "/linguistica.uchicago.edu/Linguistica/MainWindow/Encoding/EncodingType",
123 QString()).value
<QString
>()),
125 m_eastFont(m_preferences
.GetFontPreference("Main")),
128 // String edit distance
130 m_Words_InitialTemplates(), m_Words_Templates(),
131 m_Sequencer(new CSequencer
),
132 m_Stats(new CStats(this)),
134 m_SmallCanvas(new Q3Canvas(10, 10)),
135 m_SmallGraphicDisplay(), // initialized below
136 m_SmallGraphicDisplayVBox()
141 command_line_args args
;
142 if (m_commandLineFlag
&& !args
.process(argc
, argv
)) {
143 printf("%s", args
.error
.ascii());
149 setCaption("Linguistica " + QString(LXA_VERSION
));
152 // Set up the status bars
154 using linguistica::ui::qt::status_interface
;
156 auto_ptr
<QLabel
> statusBar1(new QLabel(this));
157 auto_ptr
<QLabel
> statusBar2(new QLabel(this));
158 auto_ptr
<QProgressBar
> progressBar(new QProgressBar
);
159 m_status
= auto_ptr
<status_interface
>(new status_interface(
160 *statusBar1
.get(), *statusBar2
.get(), *progressBar
.get()));
162 statusBar1
->setMaximumWidth(250);
163 progressBar
->setMaximumWidth(250);
164 statusBar2
->setMaximumWidth(250);
165 statusBar()->addPermanentWidget(statusBar1
.release(), 33);
166 statusBar()->addPermanentWidget(progressBar
.release(), 33);
167 statusBar()->addPermanentWidget(statusBar2
.release(), 33);
170 m_commandLine
->setWordWrap( Q3TextEdit::NoWrap
);
172 // Toolbars and Status Bar visible
173 viewToolbarsAction
->setOn(true);
174 viewStatusBarAction
->setOn(true);
177 auto_ptr
<Q3PopupMenu
> help(new Q3PopupMenu(this));
178 // Web links in windows version only
179 auto_ptr
<Q3PopupMenu
> links(new Q3PopupMenu(this));
180 links
->insertItem( "&John Goldsmith", this, SLOT(jgWebLinksActionSlot()) );
181 links
->insertItem( "&Linguistica", this, SLOT(lxaWebLinksActionSlot()) );
182 help
->insertItem( "&Web Links", links
.release() );
183 help
->insertSeparator();
184 help
->insertItem( "&About", this, SLOT( helpAboutSlot() ) );
185 menuBar()->insertItem( "&Help", help
.release() );
189 // memory owned by m_SmallGraphicDisplayTab
190 m_SmallGraphicDisplay
= new GraphicView(m_SmallCanvas
,
191 NULL
, m_SmallGraphicDisplayTab
);
192 m_SmallGraphicDisplayTab
->layout()->addWidget(m_SmallGraphicDisplay
);
195 this->pImgLabel
= new QLabel
;
196 this->pImgLabel
->setSizePolicy(QSizePolicy::Expanding
, QSizePolicy::Expanding
);
197 this->pImgLabel
->setAlignment(Qt::AlignCenter
);
198 this->pImgLabel
->setMinimumSize(240, 160);
199 QVBoxLayout
* smGraphicDisplayLayout
= new QVBoxLayout
;
200 smGraphicDisplayLayout
->addWidget(pImgLabel
);
201 m_SmallGraphicDisplay
->setLayout(smGraphicDisplayLayout
);
204 // Get all user settings and preferences
206 m_Settings
.beginGroup("/linguistica.uchicago.edu/Linguistica");
208 setMinimumSize(800, 600);
210 m_Settings
.beginGroup("Geometry");
211 if (m_Settings
.contains("Width") &&
212 m_Settings
.contains("Height") &&
213 m_Settings
.contains("X_Pos") &&
214 m_Settings
.contains("Y_Pos")) {
215 QSize
sz(m_Settings
.value("Width").value
<int>(),
216 m_Settings
.value("Height").value
<int>());
217 QPoint
loc(m_Settings
.value("X_Pos").value
<int>(),
218 m_Settings
.value("Y_Pos").value
<int>());
225 m_Settings
.endGroup();
228 // Hack: ensure that if the window closed maximized, the next
229 // time it opens it will be maximized again and when
230 // un-maximized it will return to the last remembered
231 // un-maximized size and position.
233 // If the remembered position was large, the window
234 // probably closed maximized.
235 const bool maximized
= QApplication::desktop()->width() < width()+10 ||
236 QApplication::desktop()->height() < height()+30;
239 m_Settings
.beginGroup("Geometry");
240 if (m_Settings
.contains("Width_Old") &&
241 m_Settings
.contains("Height_Old") &&
242 m_Settings
.contains("X_Pos_Old") &&
243 m_Settings
.contains("Y_Pos_Old")) {
244 QSize
sz(m_Settings
.value("Width_Old").value
<int>(),
245 m_Settings
.value("Height_Old").value
<int>());
246 QPoint
loc(m_Settings
.value("X_Pos_Old").value
<int>(),
247 m_Settings
.value("Y_Pos_Old").value
<int>());
252 m_Settings
.endGroup();
258 m_numberOfTokens
= m_Settings
.value(
259 "Lexicon/NumberOfTokens", 10000)
262 // Set the triscreen dimensions
264 m_Settings
.beginGroup("Triscreen");
266 if (m_Settings
.contains("West") &&
267 m_Settings
.contains("East") &&
268 m_Settings
.contains("North") &&
269 m_Settings
.contains("South")) {
270 QList
<int> eastWest
, northSouth
;
273 eastWest
.append(m_Settings
.value("West").value
<int>());
275 eastWest
.append(m_Settings
.value("East").value
<int>());
278 northSouth
.append(m_Settings
.value("North").value
<int>());
280 northSouth
.append(m_Settings
.value("South").value
<int>());
282 m_eastWestSplitter
->setSizes(eastWest
);
283 m_northSouthSplitter
->setSizes(northSouth
);
286 m_Settings
.endGroup();
288 m_Settings
.endGroup();
292 // Connect signals and slots
293 connect(this, SIGNAL(updateAllViewsSignal()),
294 this, SLOT(updateTreeViewSlot()));
295 connect(this, SIGNAL(updateAllViewsSignal()),
296 this, SLOT(updateCollectionViewSlot()));
297 connect(this, SIGNAL(updateAllViewsSignal()),
298 this, SLOT(updateCommandLineSlot()));
299 connect(this, SIGNAL(updateCommandLineSignal()),
300 this, SLOT(updateCommandLineSlot()));
301 connect(this, SIGNAL(updateTreeViewSignal()),
302 this, SLOT(updateTreeViewSlot()));
303 connect(this, SIGNAL(tokensRequestedSignal()),
304 this, SLOT(tokensRequestedDialogSlot()));
308 m_treeView
->setSortColumn(-1);
309 emit
updateAllViewsSignal();
311 // Prepare collection view
312 m_collectionView
->setShowSortIndicator(true);
314 // Command line execution
315 if (!args
.corpus
.isEmpty()) {
316 m_corpusFileName
= args
.corpus
;
318 if (!args
.logFile
.isEmpty()) {
320 m_logFileName
= args
.logFile
;
323 if (!args
.goldStdFile
.isEmpty())
324 m_goldStdFileName
= args
.goldStdFile
;
326 if (!args
.outputDir
.isEmpty())
327 m_projectDirectory
= args
.outputDir
;
329 executeCommandLineArgs(args
.count
, args
.mini
,
330 args
.prefix
, args
.suffix
);
335 LinguisticaMainWindow::~LinguisticaMainWindow()
338 delete m_pSig1
; // never used
339 delete m_pSig2
; // never used
340 delete m_GUIWords
; // never used
341 // close log file (flushes buffers)
343 delete m_logFileStream
;
344 delete m_progressDialog
;
345 delete m_Words_InitialTemplates
;
346 delete m_Words_Templates
;
350 delete m_SmallCanvas
;
351 delete m_SmallGraphicDisplayVBox
; // never used
354 void LinguisticaMainWindow::enableLoggingActionSlot(bool b
)
357 emit
updateAllViewsSignal();
361 void LinguisticaMainWindow::clearLogFileActionSlot()
363 if( m_logFileStream
)
365 // Log file open, can't clear now.
366 // TODO: message to screen.
370 // Delete the file and create a new, empty one with
372 Q_ASSERT(!GetLogFileName().isEmpty());
373 m_logFile
= new QFile( GetLogFileName() );
378 *m_logFileStream
<< "";
381 emit
updateAllViewsSignal();
385 void LinguisticaMainWindow::CloseLogFile()
387 if ( !m_logFileStream
)
389 *GetLogFileStream() << "</body></html>";
390 Q_ASSERT ( !m_logging
);
391 // AfxMessageBox ("Log file is not open."); // TODO: Qt
395 Q_ASSERT ( m_logging
);
399 m_logFileStream
= NULL
;
404 void LinguisticaMainWindow::OpenLogFile()
406 if( m_logFileStream
)
408 Q_ASSERT ( m_logging
);
409 // AfxMessageBox ("Log file is already open."); // TODO: Qt
413 if( GetLogFileName().lower() == "c:\\.txt" || GetLogFileName().lower() == "none" )
415 AskUserForLogFileName();
418 m_logFile
= new QFile( GetLogFileName() );
420 if ( m_logFile
->open( QIODevice::WriteOnly
) )
422 m_logFileStream
= new QTextStream( m_logFile
);
423 m_logFileStream
->setEncoding( QTextStream::Unicode
);
425 *m_logFileStream
<< "<html><head> <meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\"/> <link rel=\"stylesheet\" type=\"text/css\" href=\"template_files/lxa.css\"/> <script charset=\"utf-8\" id=\"injection_graph_func\" src=\"template_files/injection_graph_func.js\"></script>";
426 *m_logFileStream
<< " <style type=\"text/css\">" ;
427 *m_logFileStream
<< " h1 { font-size: 250%; color: white; background-color: #1A4969; text-align: center;; font-family: Georgia, \"Times New Roman\", Times, serif }";
428 *m_logFileStream
<< " h2 { text-align: center; color: #0000FF; background-color: #E3DDAF ; font-size: 150%; margin-left:25%; margin-right:25%; }";
429 *m_logFileStream
<< " h3 { text-align: center; font-size: 120%; font-weight: bold; color: black; background-color: #21AD94 ; %border-top: thin solid #000000; border-bottom: thin solid #000000; margin-left: 0%; margin-right: 40%; padding: 0.3em; border-right: 1em solid black }" ;
430 *m_logFileStream
<< " h4 { text-align: center; font-size: 120%; color: #000000; background-color: #21AD94 ; padding: 5px; height: auto; border-left: 1em solid black; %border: thin solid #FF0000; %margin-top: 5px; %margin-bottom: 5px; margin-left: 40%; }" ;
431 *m_logFileStream
<< " h5 { color: #FF0000; background-color: #EEEEEE; font-size: 80%; text-align: center; }" ;
432 *m_logFileStream
<< " table { border-width: 4px 4px 4px 4px; border-spacing: 2px; border-style: outset outset outset outset; border-color: #1A4969 #1A4969 #1A4969 #1A4969; border-collapse: separate; background-color: rgb(255, 255, 255); margin-left: auto; margin-right: auto; margin-top: 2em; }";
433 *m_logFileStream
<< "table th { border-width: 1px 1px 1px 1px; padding: 2px 2px 2px 2px; border-style: solid solid solid solid; border-color: gray gray gray gray; background-color: white; -moz-border-radius: 3px 3px 3px 3px; }" ;
434 *m_logFileStream
<< " h4 { table td { border-width: 1px 1px 1px 1px; padding: 2px 2px 2px 2px; border-style: solid solid solid solid; border-color: gray gray gray gray; background-color: white; -moz-border-radius: 3px 3px 3px 3px; }" ;
435 *m_logFileStream
<< "</style></head><body>";
445 void LinguisticaMainWindow::newLogFileActionSlot()
447 AskUserForLogFileName();
448 emit
updateAllViewsSignal();
452 void LinguisticaMainWindow::runAllSuffixActionSlot()
454 if( m_lexicon
->GetMiniCount() )
456 // Run all suffix functions, log if desired
457 if( m_logging
) OpenLogFile();
458 m_lexicon
->FindSuffixes();
459 if( m_logging
) CloseLogFile();
461 // Update corpus words
462 m_lexicon
->DoWordUpdates();
466 // findAllomorphyAction->setEnabled(true);
469 m_projectDirty
= true;
472 emit
updateAllViewsSignal();
477 void LinguisticaMainWindow::runAllPrefixActionSlot()
479 if( m_lexicon
->GetMiniCount() )
481 // Run all prefix functions, log if desired
482 if( m_logging
) OpenLogFile();
483 m_lexicon
->FindPrefixes();
484 if( m_logging
) CloseLogFile();
486 // Update corpus words
487 m_lexicon
->DoWordUpdates();
490 m_projectDirty
= true;
493 emit
updateAllViewsSignal();
498 void LinguisticaMainWindow::AskUserForLogFileName()
502 QString lastfile
= m_Settings
.readEntry( "/linguistica.uchicago.edu/Linguistica/MainWindow/LogFile/FileName", QString::null
, &ok
);
503 m_logFileName
= Q3FileDialog::getSaveFileName( lastfile
,
504 "Text Files( *.txt );;Rich Text Files( *.rtf );;All Files( *.* )",
507 if( !m_logFileName
.isEmpty() && lastfile
!= m_logFileName
)
508 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/MainWindow/LogFile/FileName", m_logFileName
);
512 // Change font in collection view and command line only
513 void LinguisticaMainWindow::changeFontSlot()
516 QFont font
= QFontDialog::getFont( &ok
, m_eastFont
, this );
519 // Apply this font to the collection view and
520 // command line frames
522 font
= GetFontPreference( "Affix" );
523 font
.setFamily( m_eastFont
.family() );
524 font
.setPointSize( m_eastFont
.pointSize() );
525 SetFontPreference( "Affix", font
);
527 font
= GetFontPreference( "Signature" );
528 font
.setFamily( m_eastFont
.family() );
529 font
.setPointSize( m_eastFont
.pointSize() );
530 SetFontPreference( "Signature", font
);
532 font
= GetFontPreference( "Stem" );
533 font
.setFamily( m_eastFont
.family() );
534 font
.setPointSize( m_eastFont
.pointSize() );
535 SetFontPreference( "Stem", font
);
537 font
= GetFontPreference( "Word" );
538 font
.setFamily( m_eastFont
.family() );
539 font
.setPointSize( m_eastFont
.pointSize() );
540 SetFontPreference( "Word", font
);
542 emit
updateAllViewsSignal();
546 // the user canceled the dialog; font is set
547 // to the application's default font
551 // Called before closing the main window
552 void LinguisticaMainWindow::closeEvent(QCloseEvent
* close
)
554 if (m_commandLineFlag
) {
561 // Record triscreen position before closing
562 Q3ValueList
<int> eastWest
= m_eastWestSplitter
->sizes(),
563 northSouth
= m_northSouthSplitter
->sizes();
565 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Triscreen/West", eastWest
.first() );
566 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Triscreen/East", eastWest
.last() );
567 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Triscreen/North", northSouth
.first() );
568 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Triscreen/South", northSouth
.last() );
570 // Verify information saved
571 QString notifications
= GetPreference( "Notifications" );
572 if( notifications
.length() ) verify
= GetPreference( "Notifications" ).toInt();
575 if ( verify
&& m_projectDirty
) {
576 QString message
= "Would you like to save your changes before closing?";
577 VerifyDialog
*saveCheckDlg
= new VerifyDialog(message
);
578 saveCheckDlg
->setCaption( saveCheckDlg
->caption() + "Save Project?" );
580 switch( saveCheckDlg
->exec() )
583 // User clicked 'Yes', save changes and close
584 saveFileActionSlot();
585 if ( m_projectDirty
) close
->ignore();
586 else close
->accept();
589 // User clicked 'No', close without saving
594 // User clicked 'Cancel', do not close
600 // allow the window to close
605 // Called whenever the window is resized, includes maximizing,
606 // normalizing, opening and closing the window
607 void LinguisticaMainWindow::resizeEvent( QResizeEvent
*resize
)
609 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/Width", resize
->size().width() );
610 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/Height", resize
->size().height() );
612 // If old size and new size are different, update old size
613 if( resize
->size().width() != resize
->oldSize().width() )
614 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/Width_Old", resize
->oldSize().width() );
615 if( resize
->size().width() != resize
->oldSize().width() )
616 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/Height_Old", resize
->oldSize().height() );
620 // Called whenever the window is moved, includes maximizing,
621 // normalizing, opening and closing the window
622 void LinguisticaMainWindow::moveEvent( QMoveEvent
*move
)
625 int x_max
= QApplication::desktop()->width() - ( width() + 10 );
626 int y_max
= QApplication::desktop()->height() - ( height() + 30 );
629 if( x
> x_max
) x
= x_max
;
632 if( y
> y_max
) y
= y_max
;
634 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/X_Pos", x
);
635 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/Y_Pos", y
);
637 // If old position and new position are different, update old position.
638 if( move
->pos().x() != move
->oldPos().x() || move
->pos().y() != move
->oldPos().y() )
640 x
= move
->oldPos().x();
642 if( x
> x_max
) x
= x_max
;
643 y
= move
->oldPos().y();
645 if( y
> y_max
) y
= y_max
;
647 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/X_Pos_Old", x
);
648 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Geometry/Y_Pos_Old", y
);
652 void LinguisticaMainWindow::tokensRequestedDialogSlot()
655 int amount
= QInputDialog::getInteger(this, "Linguistica",
656 "Number of tokens requested:", m_numberOfTokens
,
657 0, std::numeric_limits
<int>::max(), 1, &ok
);
659 if (!ok
|| amount
== 0)
663 // user entered something and pressed OK
664 m_numberOfTokens
= amount
;
665 m_Settings
.writeEntry("/linguistica.uchicago.edu/Linguistica/"
666 "Lexicon/NumberOfTokens", amount
);
668 m_collectionView
->clear();
670 emit
updateTreeViewSignal();
673 void LinguisticaMainWindow::setStatusBar1(QString string
)
675 if (m_progressText1
== string
) return;
676 m_progressText1
= string
;
677 m_status
->major_operation
= string
;
681 void LinguisticaMainWindow::setStatusBar2(QString string
)
683 if (m_progressText2
== string
) return;
684 m_progressText2
= string
;
685 m_status
->details
= string
;
689 void LinguisticaMainWindow::BeginCountDown()
691 m_status
->progress
.clear();
695 void LinguisticaMainWindow::EndCountDown()
697 m_status
->progress
.clear();
699 m_progressText1
= "";
700 m_progressText2
= "";
704 void LinguisticaMainWindow::CountDownOnStatusBar( int i
, int total
, int stepsize
)
707 stepsize
= total
/100;
711 if (i
< 0 || i
> total
)
712 m_status
->progress
.clear();
714 // Update on multiples of stepsize
715 if (i
% stepsize
== 0) {
716 m_status
->progress
.set_denominator(total
);
717 m_status
->progress
= i
;
722 void LinguisticaMainWindow::newFileActionSlot()
727 // Verify information saved before overwrite
728 bool notifications
= GetPreference( "Notifications" ).toInt();
729 if( notifications
&& m_projectDirty
)
731 QString message
= "This action will overwrite your data. Would you like to\nsave your changes first?";
732 VerifyDialog
*saveCheckDlg
= new VerifyDialog(message
);
733 saveCheckDlg
->setCaption( saveCheckDlg
->caption() + "Save Project?" );
735 switch( saveCheckDlg
->exec() )
738 // User clicked 'Yes', save changes and continue
739 saveFileActionSlot();
740 if( m_projectDirty
) return;
743 // User clicked 'No', continue
747 // User clicked 'Cancel', just return
753 // Dialog for lexicon file
754 QString lastfile
= m_Settings
.readEntry( "/linguistica.uchicago.edu/Linguistica/MainWindow/FileMenu/Open", QString::null
, &ok
);
755 QString filename
= Q3FileDialog::getOpenFileName( lastfile
, "Text Files( *.txt );;Rich Text Files( *.rtf );;All Files( *.* )" );
756 if( !filename
.isEmpty() ){
757 if( lastfile
!= filename
) m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/MainWindow/FileMenu/Open", filename
);
759 m_corpusFileName
= filename
;
761 // Read the lexicon and activate other functions
762 // if successful. Log if desired.
763 m_lexicon
->ClearAll();
764 if( m_logging
) OpenLogFile();
765 result
= m_lexicon
->ReadCorpus( filename
, GetNumberOfTokens() );
766 if( m_logging
) CloseLogFile();
769 // runAllAction->setEnabled(true);
770 rereadCorpusAction
->setEnabled( true );
774 // if( runAllAction->isEnabled() ) runAllAction->setEnabled(false);
775 if( rereadCorpusAction
->isEnabled() ) rereadCorpusAction
->setEnabled(false);
778 // Update corpus words
779 m_lexicon
->DoWordUpdates();
782 m_projectDirty
= true;
785 // Set the filter for graphic display and anything else if necessary
786 m_SmallGraphicDisplay
->SetFilter( m_lexicon
->GetOutFilter() );
788 // Clear the collection view
789 m_collectionView
->clear();
793 emit
updateAllViewsSignal();
797 void LinguisticaMainWindow::SetUpNewLexicon()
799 // int count = m_lexicon->GetNumberOfWords();
801 m_lexicon
= new CLexicon(this);
802 // m_lexicon->SetNumberOfWords( count );
805 GetStringListPreference( "Character_Combinations", &items
);
806 m_lexicon
->SetFilters( &items
);
810 void LinguisticaMainWindow::openFileActionSlot()
817 int SlashLoc
, DotLoc
, i
, j
;
823 CorpusFileName
= Q3FileDialog::getOpenFileName( m_projectDirectory
,
824 "Project files (*.prj);;All files (*.*)",
827 "Choose a project to open" );
829 if( CorpusFileName
!= QString::null
)
831 SlashLoc
= CorpusFileName
.findRev ('\\');
832 if( SlashLoc
< 0 ) SlashLoc
= CorpusFileName
.findRev('/');
833 Directory
= CorpusFileName
.left( SlashLoc
+ 1 );
835 setProjectDirectory( Directory
);
837 FileName
= CorpusFileName
.mid (SlashLoc
+1);
838 DotLoc
= FileName
.findRev ('.');
839 if( DotLoc
< 0 ) return;
841 ProjectName
= FileName
.left(DotLoc
);
842 ProjectFileName
= Directory
+ ProjectName
+ ".prj";
844 int miniCount
= m_lexicon
->ReadProjectFile( ProjectFileName
);
846 for( i
=0; i
< miniCount
; i
++ )
848 j
= m_lexicon
->NewMiniLexicon();
850 mini
= m_lexicon
->GetMiniLexicon(i
);
852 QString Prefix
= Directory
+ ProjectName
+ "_";
853 QString SuffixFileName
= Prefix
+ QString("Mini%1_").arg(i
+1) + "Suffixes.txt";
854 QString PrefixFileName
= Prefix
+ QString("Mini%1_").arg(i
+1) + "Prefixes.txt";
855 QString SignatureFileName
= Prefix
+ QString("Mini%1_").arg(i
+1) + "Signatures.txt";
856 QString StemFileName
= Prefix
+ QString("Mini%1_").arg(i
+1) + "Stems.txt";
857 QString WordFileName
= Prefix
+ QString("Mini%1_").arg(i
+1) + "Words.txt";
859 setStatusBar1( "Reading suffixes..." );
860 mini
->GetSuffixes()->ReadSuffixFile( SuffixFileName
);// must precede signatures Oct 20 1999 jg
862 if( mini
&& mini
->GetSuffixes()->GetCount() == 0 )
864 mini
->SetAffixLocation( STEM_INITIAL
);
865 setStatusBar1( "Reading prefixes..." );
866 mini
->GetPrefixes()->ReadPrefixFile( PrefixFileName
);// must precede signatures Oct 20 1999 jg
869 setStatusBar1( "Reading signatures..." );
870 mini
->GetSignatures()->ReadSignatureFile( SignatureFileName
, mini
->GetAffixLocation() ); // must follow suffixes
872 setStatusBar1( "Reading stems..." );
873 mini
->GetStems()->ReadStemFile( StemFileName
, mini
->GetAffixLocation() ); //stems must follow signatures Oct 24 1999 jg, but also must precede signatures for signatures to get their stem lists...too bad.
875 setStatusBar1 ( "Reading signatures (verbose)..." );
876 mini
->GetSignatures()->ReadSignatureFileBis(SignatureFileName
);
878 setStatusBar1 ( "Reading words..." );
879 mini
->GetWords()->ReadWordFile( WordFileName
);
882 // TODO: read corpus words
884 setStatusBar1 ( "" );
886 emit
updateAllViewsSignal();
891 void LinguisticaMainWindow::saveAsFileActionSlot()
897 // Notify about large number of files
899 QString notifications
= GetPreference( "Notifications" );
900 if( notifications
.length() ) notify
= GetPreference( "Notifications" ).toInt();
905 QString message
= "Linguistica saves your project in a large number of 'readable' text\nfiles. We suggest you create a new folder in which to save them.";
906 QMessageBox::information ( this, "Linguistica : Save File", message
);
909 QString FileName
= Q3FileDialog::getSaveFileName( m_projectDirectory
+ m_projectName
,
910 "Linguistica Projects (*.prj)",
913 "Choose a folder to save under" );
915 if (FileName
.length() == 0 ) return;
917 SlashLoc
= FileName
.findRev ('\\');
918 if( SlashLoc
< 0 ) SlashLoc
= FileName
.findRev('/');
921 m_projectDirectory
= FileName
.left( SlashLoc
+ 1 );
922 m_Settings
.writeEntry( "/linguistica.uchicago.edu/Linguistica/Project/Directory", m_projectDirectory
);
924 m_projectName
= FileName
.mid ( SlashLoc
+ 1 );
925 NameLoc
= m_projectName
.findRev(".prj");
926 SlashLoc
= m_projectName
.findRev("_");
929 if( SlashLoc
>= 0 && SlashLoc
< NameLoc
)
931 FileName
= m_projectName
.mid( SlashLoc
+ 1, NameLoc
- SlashLoc
- 1 );
932 m_projectIndex
= FileName
.toInt();
933 m_projectName
= m_projectName
.left( SlashLoc
);
937 m_projectName
= m_projectName
.left( NameLoc
);
941 //saveFileActionSlot(); //removed so I can use in Xfst function -sw
946 void LinguisticaMainWindow::saveFileActionSlot()
948 if ( m_projectDirectory
.length() == 0 || m_projectName
.length() == 0 )
950 saveAsFileActionSlot();
951 //return; //changed flow, control returns to this func -sw
954 QString Prefix
= m_projectDirectory
+ m_projectName
+ "_" + QString("%1").arg( m_projectIndex
);
956 QString ProjectFileName
= Prefix
+ ".prj";
958 for( int i
=0; i
< m_lexicon
->GetMiniSize(); i
++ )
960 CMiniLexicon
* mini
= m_lexicon
->GetMiniLexicon(i
);
961 if( !mini
) continue;
963 QString WordsFileName
= Prefix
+ QString("_Mini%1").arg(i
+1) + "_Words.txt";
965 QString SuffixFileName
= Prefix
+ QString("_Mini%1").arg(i
+1) + "_Suffixes.txt";
966 QString PrefixFileName
= Prefix
+ QString("_Mini%1").arg(i
+1) + "_Prefixes.txt";
968 QString SignatureFileName
= Prefix
+ QString("_Mini%1").arg(i
+1) + "_Signatures.txt";
969 QString StemFileName
= Prefix
+ QString("_Mini%1").arg(i
+1) + "_Stems.txt";
971 mini
->GetWords()->OutputWords(WordsFileName
,
972 m_lexicon
->GetOutFilter());
974 if( mini
->GetAffixLocation() == WORD_FINAL
||
975 mini
->GetAffixLocation() == STEM_FINAL
)
977 mini
->GetSuffixes()->OutputSuffixes( SuffixFileName
);
980 if( mini
->GetAffixLocation() == WORD_INITIAL
||
981 mini
->GetAffixLocation() == STEM_INITIAL
)
983 mini
->GetPrefixes()->OutputPrefixes( PrefixFileName
);
986 if( mini
->GetSignatures() )
988 mini
->GetSignatures()->OutputSignatures( SignatureFileName
);
989 mini
->GetStems()->OutputStems(StemFileName
,
990 m_lexicon
->GetOutFilter());
995 m_lexicon
->OutputStats( ProjectFileName
);
997 // TODO: output corpus words
1000 m_projectDirty
= false;
1002 emit
updateTreeViewSignal();
1005 void LinguisticaMainWindow::xfstExportActionSlot()
1007 if ( m_projectDirectory
.length() == 0 || m_projectName
.length() == 0 )
1008 saveAsFileActionSlot(); //get project dir and name
1010 QString Prefix
= m_projectDirectory
+ m_projectName
+ "_" + QString("%1").arg( m_projectIndex
);
1012 for( int i
=0; i
< m_lexicon
->GetMiniSize(); i
++ )
1014 CMiniLexicon
* mini
= m_lexicon
->GetMiniLexicon(i
);
1015 if( mini
&& mini
->GetSignatures() )
1017 QString XfstFileName
= Prefix
+ QString("_Mini%1").arg(i
+1) + ".xfst";
1018 mini
->GetSignatures()->OutputXfst( XfstFileName
);
1019 mini
->GetFSA()->OutputFSAXfst(Prefix
+"_FSA.xfst");
1026 // "c:\\Program Files\\Internet Explorer\\iexplore.exe" on Windows?
1027 const QString default_browser
= "netscape";
1030 void LinguisticaMainWindow::jgWebLinksActionSlot()
1032 // code taken from a Qt message board -jeremy
1033 QString url
= "http://humanities.uchicago.edu/faculty/goldsmith";
1034 Q3Process
*browser
= new Q3Process( this );
1035 browser
->clearArguments();
1036 browser
->addArgument(default_browser
);
1038 if(url
.stripWhiteSpace().length() > 0)
1040 browser
->addArgument(url
);
1042 if( !browser
->start() )
1044 QMessageBox::critical(this, "Critical!",
1045 "Browser reports error!");
1050 void LinguisticaMainWindow::lxaWebLinksActionSlot()
1052 // code taken from a Qt message board -jeremy
1053 QString url
= "http://linguistica.uchicago.edu/linguistica.html";
1054 Q3Process
*browser
= new Q3Process( this );
1055 browser
->clearArguments();
1056 browser
->addArgument(default_browser
);
1058 if(url
.stripWhiteSpace().length() > 0)
1060 browser
->addArgument(url
);
1062 if( !browser
->start() )
1064 QMessageBox::critical(this, "Critical!",
1065 "Browser reports error!");
1071 void LinguisticaMainWindow::findAllomorphySlot()
1073 if( m_lexicon
->GetMiniCount() )
1076 if( m_logging
) OpenLogFile();
1077 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1079 current_mini
->RelateStems();
1083 // m_lexicon->FindAllomorphy();
1084 // m_lexicon->FindAllomorphy2();
1085 if( m_logging
) CloseLogFile();
1087 // Update corpus words
1088 m_lexicon
->DoWordUpdates();
1090 // Disable this functionality
1091 // if( findAllomorphyAction->isEnabled() ) findAllomorphyAction->setEnabled(false);
1094 m_projectDirty
= true;
1097 emit
updateAllViewsSignal();
1103 void LinguisticaMainWindow::showDeleteesSlot( bool b
)
1105 m_showDeleteesAction
->setOn( b
);
1106 emit
updateAllViewsSignal();
1110 void LinguisticaMainWindow::rereadCorpusSlot()
1114 if (m_corpusFileName
.isEmpty()) {
1115 // XXX. no corpus file chosen! let user know.
1119 // Verify information saved before overwrite
1120 bool notifications
= GetPreference( "Notifications" ).toInt();
1121 if( notifications
&& m_projectDirty
)
1123 QString message
= "This action will overwrite your data. Would you like to\nsave your changes first?";
1124 VerifyDialog
*saveCheckDlg
= new VerifyDialog(message
);
1125 saveCheckDlg
->setCaption( saveCheckDlg
->caption() + "Save Project?" );
1127 switch( saveCheckDlg
->exec() )
1130 // User clicked 'Yes', save changes and continue
1131 saveFileActionSlot();
1132 if( m_projectDirty
) return;
1135 // User clicked 'No', continue
1139 // User clicked 'Cancel', just return
1144 // Clear collection view
1145 m_collectionView
->clear();
1148 // Read the lexicon and activate other functions
1149 // if successful. Log if desired.
1150 if( m_logging
) OpenLogFile();
1151 Q_ASSERT(!m_corpusFileName
.isEmpty());
1152 result
= m_lexicon
->RereadCorpus( m_corpusFileName
, GetNumberOfTokens() );
1153 if( m_logging
) CloseLogFile();
1154 // if( result != -1 ) runAllAction->setEnabled(true);
1155 // else if( runAllAction->isEnabled() ) runAllAction->setEnabled(false);
1157 // Set the filter for graphic display and anything else if necessary
1158 m_SmallGraphicDisplay
->SetFilter( m_lexicon
->GetOutFilter() );
1160 // Update corpus words
1161 m_lexicon
->DoWordUpdates();
1164 m_projectDirty
= true;
1166 emit
updateAllViewsSignal();
1170 void LinguisticaMainWindow::clearLexiconSlot()
1172 // Verify information saved before overwrite
1173 bool notifications
= GetPreference( "Notifications" ).toInt();
1174 if( notifications
&& m_projectDirty
)
1176 QString message
= "This action will overwrite your data. Would you like to\nsave your changes first?";
1177 VerifyDialog
*saveCheckDlg
= new VerifyDialog(message
);
1178 saveCheckDlg
->setCaption( saveCheckDlg
->caption() + "Save Project?" );
1180 switch( saveCheckDlg
->exec() )
1183 // User clicked 'Yes', save changes and continue
1184 saveFileActionSlot();
1185 if( m_projectDirty
) return;
1188 // User clicked 'No', continue
1192 // User clicked 'Cancel', just return
1197 m_collectionView
->clear();
1199 m_lexicon
->ClearAll();
1200 m_projectDirty
= false;
1201 emit
updateAllViewsSignal();
1205 void LinguisticaMainWindow::successorFreqSlot()
1207 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1209 if( m_lexicon
->GetMiniCount() )
1211 if( isCorrectAffix( STEM_FINAL
) )
1214 // Run successor freq function, log if desired
1215 if( m_logging
) OpenLogFile();
1216 current_mini
->GetWords()->SuccessorFreq1(
1217 current_mini
->GetStems(),
1218 current_mini
->GetSuffixes(),
1219 current_mini
->GetSignatures(), SF1
,
1220 CStem::NUMBER
| CStem::UNKNOWN
);
1221 if( m_logging
) CloseLogFile();
1223 // Update corpus words
1224 m_lexicon
->DoWordUpdates();
1227 m_projectDirty
= true;
1230 emit
updateAllViewsSignal();
1234 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1235 new_mini
->SetAffixLocation( STEM_FINAL
);
1236 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1237 CMiniLexicon::WW_All
);
1238 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1239 successorFreqSlot();
1245 void LinguisticaMainWindow::predecessorFreqSlot()
1247 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1249 if( m_lexicon
->GetMiniCount() )
1251 if( isCorrectAffix( STEM_INITIAL
) )
1254 // Run predecessor freq function, log if desired
1255 if( m_logging
) OpenLogFile();
1256 current_mini
->GetWords()->CreateReverseTrie();
1257 current_mini
->GetWords()->PredecessorFreq1(
1258 current_mini
->GetStems(),
1259 current_mini
->GetPrefixes(),
1260 current_mini
->GetSignatures(),
1262 CStem::NUMBER
| CStem::UNKNOWN
);
1263 if( m_logging
) CloseLogFile();
1265 // Update corpus words
1266 m_lexicon
->DoWordUpdates();
1269 m_projectDirty
= true;
1272 emit
updateAllViewsSignal();
1276 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1277 new_mini
->SetAffixLocation( STEM_INITIAL
);
1278 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1279 CMiniLexicon::WW_All
);
1280 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1281 predecessorFreqSlot();
1287 void LinguisticaMainWindow::checkPfxSignaturesSlot()
1289 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1291 if( m_lexicon
->GetMiniCount() )
1293 if( isCorrectAffix( STEM_INITIAL
) )
1296 // Run successor freq function, log if desired
1297 if( m_logging
) OpenLogFile();
1298 current_mini
->CheckSignatures();
1300 if( m_logging
) CloseLogFile();
1302 // Update corpus words
1303 m_lexicon
->DoWordUpdates();
1306 m_projectDirty
= true;
1309 emit
updateAllViewsSignal();
1313 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1314 new_mini
->SetAffixLocation( STEM_INITIAL
);
1315 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1316 CMiniLexicon::WW_All
);
1317 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1318 checkPfxSignaturesSlot();
1323 void LinguisticaMainWindow::checkSignaturesSlot()
1325 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1327 if( m_lexicon
->GetMiniCount() )
1329 if( isCorrectAffix( STEM_FINAL
) )
1332 // Run successor freq function, log if desired
1333 if( m_logging
) OpenLogFile();
1334 m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex())->CheckSignatures();
1336 if( m_logging
) CloseLogFile();
1338 // Update corpus words
1339 // m_lexicon->DoWordUpdates();
1342 m_projectDirty
= true;
1345 emit
updateAllViewsSignal();
1349 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1350 new_mini
->SetAffixLocation( STEM_FINAL
);
1351 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1352 CMiniLexicon::WW_All
);
1353 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1354 checkSignaturesSlot();
1359 void LinguisticaMainWindow::knownStemsPrefixesSlot()
1361 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1363 if( m_lexicon
->GetMiniCount() )
1365 if( isCorrectAffix( STEM_INITIAL
) )
1368 // Run successor freq function, log if desired
1369 if( m_logging
) OpenLogFile();
1370 current_mini
->ExtendKnownStemsToKnownAffixes();
1372 if( m_logging
) CloseLogFile();
1374 // Update corpus words
1375 m_lexicon
->DoWordUpdates();
1378 m_projectDirty
= true;
1381 emit
updateAllViewsSignal();
1385 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1386 new_mini
->SetAffixLocation( STEM_INITIAL
);
1387 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1388 CMiniLexicon::WW_All
);
1389 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1390 knownStemsPrefixesSlot();
1396 void LinguisticaMainWindow::knownStemsSuffixesSlot()
1398 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1400 if( m_lexicon
->GetMiniCount() )
1402 if( isCorrectAffix( STEM_FINAL
) )
1405 // Run successor freq function, log if desired
1406 if( m_logging
) OpenLogFile();
1407 current_mini
->ExtendKnownStemsToKnownAffixes();
1409 if( m_logging
) CloseLogFile();
1411 // Update corpus words
1412 m_lexicon
->DoWordUpdates();
1415 m_projectDirty
= true;
1418 emit
updateAllViewsSignal();
1422 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1423 new_mini
->SetAffixLocation( STEM_FINAL
);
1424 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1425 CMiniLexicon::WW_All
);
1426 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1427 knownStemsSuffixesSlot();
1432 void LinguisticaMainWindow::fromPfxSigsFindStemsSlot()
1434 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1436 if( m_lexicon
->GetMiniCount() )
1438 if( isCorrectAffix( STEM_INITIAL
) )
1441 // Run successor freq function, log if desired
1442 if( m_logging
) OpenLogFile();
1443 current_mini
->TakeSignaturesFindStems();
1445 if( m_logging
) CloseLogFile();
1447 // Update corpus words
1448 m_lexicon
->DoWordUpdates();
1451 m_projectDirty
= true;
1454 emit
updateAllViewsSignal();
1458 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1459 new_mini
->SetAffixLocation( STEM_INITIAL
);
1460 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1461 CMiniLexicon::WW_All
);
1462 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1463 fromPfxSigsFindStemsSlot();
1469 void LinguisticaMainWindow::fromSigsFindStemsSlot()
1471 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1473 if( m_lexicon
->GetMiniCount() )
1475 if( isCorrectAffix( STEM_FINAL
) )
1478 // Run successor freq function, log if desired
1479 if( m_logging
) OpenLogFile();
1480 current_mini
->TakeSignaturesFindStems();
1482 if( m_logging
) CloseLogFile();
1484 // Update corpus words
1485 m_lexicon
->DoWordUpdates();
1488 m_projectDirty
= true;
1491 emit
updateAllViewsSignal();
1495 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1496 new_mini
->SetAffixLocation( STEM_FINAL
);
1497 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1498 CMiniLexicon::WW_All
);
1499 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1500 fromSigsFindStemsSlot();
1506 void LinguisticaMainWindow::fromStemsFindAffixesSlot()
1508 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1510 if( m_lexicon
->GetMiniCount() )
1512 if( isCorrectAffix( STEM_FINAL
) )
1515 // Run successor freq function, log if desired
1516 if( m_logging
) OpenLogFile();
1517 current_mini
->FromStemsFindAffixes();
1519 if( m_logging
) CloseLogFile();
1521 // Update corpus words
1522 m_lexicon
->DoWordUpdates();
1525 m_projectDirty
= true;
1528 emit
updateAllViewsSignal();
1532 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1533 new_mini
->SetAffixLocation( STEM_FINAL
);
1534 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1535 CMiniLexicon::WW_All
);
1536 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1537 fromStemsFindAffixesSlot();
1543 void LinguisticaMainWindow::findPfxSingletonSigsSlot()
1545 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1547 if( m_lexicon
->GetMiniCount() )
1549 if( isCorrectAffix( STEM_INITIAL
) )
1552 // Run successor freq function, log if desired
1553 if( m_logging
) OpenLogFile();
1554 current_mini
->FindSingletonSignatures();
1556 if( m_logging
) CloseLogFile();
1558 // Update corpus words
1559 m_lexicon
->DoWordUpdates();
1562 m_projectDirty
= true;
1565 emit
updateAllViewsSignal();
1569 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1570 new_mini
->SetAffixLocation( STEM_INITIAL
);
1571 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1572 CMiniLexicon::WW_All
);
1573 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1574 findPfxSingletonSigsSlot();
1580 void LinguisticaMainWindow::findSingletonSigsSlot()
1582 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1584 if( m_lexicon
->GetMiniCount() )
1586 if( isCorrectAffix( STEM_FINAL
) )
1589 // Run successor freq function, log if desired
1590 if( m_logging
) OpenLogFile();
1591 current_mini
->FindSingletonSignatures();
1593 if( m_logging
) CloseLogFile();
1595 // Update corpus words
1596 m_lexicon
->DoWordUpdates();
1599 m_projectDirty
= true;
1602 emit
updateAllViewsSignal();
1606 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1607 new_mini
->SetAffixLocation( STEM_FINAL
);
1608 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1609 CMiniLexicon::WW_All
);
1610 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1611 findSingletonSigsSlot();
1617 void LinguisticaMainWindow::pfxLooseFitSlot()
1619 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1621 if( m_lexicon
->GetMiniCount() )
1623 if( isCorrectAffix( STEM_INITIAL
) )
1626 // Run successor freq function, log if desired
1627 if( m_logging
) OpenLogFile();
1628 current_mini
->LooseFit();
1630 if( m_logging
) CloseLogFile();
1632 // Update corpus words
1633 m_lexicon
->DoWordUpdates();
1636 m_projectDirty
= true;
1639 emit
updateAllViewsSignal();
1643 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1644 new_mini
->SetAffixLocation( STEM_INITIAL
);
1645 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1646 CMiniLexicon::WW_All
);
1647 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1654 void LinguisticaMainWindow::looseFitSlot()
1656 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
1658 if( m_lexicon
->GetMiniCount() )
1660 if( isCorrectAffix( STEM_FINAL
) )
1663 // Run successor freq function, log if desired
1664 if( m_logging
) OpenLogFile();
1665 current_mini
->LooseFit();
1667 if( m_logging
) CloseLogFile();
1669 // Update corpus words
1670 m_lexicon
->DoWordUpdates();
1673 m_projectDirty
= true;
1676 emit
updateAllViewsSignal();
1680 CMiniLexicon
* new_mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->NewMiniLexicon() );
1681 new_mini
->SetAffixLocation( STEM_FINAL
);
1682 new_mini
->AddToWordCollection(current_mini
->GetWords(),
1683 CMiniLexicon::WW_All
);
1684 m_lexicon
->SetActiveMiniIndex( new_mini
->GetIndex() );
1690 void LinguisticaMainWindow::showToolbarsSlot(bool b
)
1692 if (b
) m_Toolbar
->show();
1693 else m_Toolbar
->hide();
1697 void LinguisticaMainWindow::showStatusBarSlot(bool b
)
1699 if( b
) statusBar()->show();
1700 else statusBar()->hide();
1704 void LinguisticaMainWindow::saveBrokenCorpusSlot()
1706 QString BrokenCorpusFileName
= m_corpusFileName
.left( m_corpusFileName
.find('.') ) + "_Broken.txt";
1707 BrokenCorpusFileName
= Q3FileDialog::getSaveFileName( BrokenCorpusFileName
,
1708 "Text Documents (*.txt)",
1711 "Choose a folder to save under" );
1713 if( BrokenCorpusFileName
.length() == 0 ) return;
1715 m_lexicon
->MakeBrokenCorpus( BrokenCorpusFileName
);
1719 void LinguisticaMainWindow::helpAboutSlot()
1721 HelpAboutDialog
*helpDlg
= new HelpAboutDialog( this );
1722 if( helpDlg
->exec() == QDialog::Accepted
)
1734 void LinguisticaMainWindow::newMiniLexiconActionSlot()
1738 for( index
= m_lexicon
->GetMiniSize(); index
>= 0; index
-- )
1740 if( m_lexicon
->GetMiniLexicon(index
) )
1749 newFileActionSlot();
1753 // Create the new mini
1754 index
= m_lexicon
->NewMiniLexicon();
1755 m_lexicon
->SetActiveMiniIndex( index
);
1757 // Populate its words
1758 populateWordsActionSlot();
1761 QString
mini_name( "Mini-Lexicon %1" );
1762 mini_name
= mini_name
.arg( index
+ 1 );
1763 QString remark
= "Before analysis; words only";
1764 m_lexicon
->GetDLHistory()->append( mini_name
, remark
, m_lexicon
->GetMiniLexicon( index
) );
1768 void LinguisticaMainWindow::deleteMiniLexiconActionSlot()
1770 if( m_lexicon
->GetMiniCount() == 1 )
1776 int active
= m_lexicon
->GetActiveMiniIndex();
1777 m_lexicon
->DeleteMiniLexicon( active
);
1780 SetDocType( NO_DOC
);
1781 emit
updateAllViewsSignal();
1785 void LinguisticaMainWindow::autoLayeringActionSlot()
1787 if( m_lexicon
->GetMiniCount() )
1789 // Run all suffix functions, log if desired
1790 if( m_logging
) OpenLogFile();
1791 m_lexicon
->FindSuffixes( true );
1793 if( m_logging
) CloseLogFile();
1795 // Update corpus words
1796 m_lexicon
->DoWordUpdates();
1799 m_projectDirty
= true;
1802 emit
updateAllViewsSignal();
1807 void LinguisticaMainWindow::populateWordsActionSlot()
1809 int index
= m_lexicon
->GetActiveMiniIndex();
1810 CMiniLexicon
* active
, * other
;
1812 QStringList notIncluded
, included
;
1814 if( m_lexicon
->GetMiniLexicon( index
-1 ) )
1816 included
<< "Mini-Lexicon " + QString("%1").arg( index
) + " : Unanalyzed Words";
1817 included
<< "Mini-Lexicon " + QString("%1").arg( index
) + " : Stems";
1818 notIncluded
<< "Mini-Lexicon " + QString("%1").arg( index
) + " : Analyzed Words";
1820 for( int i
=0; i
< m_lexicon
->GetMiniSize(); i
++ )
1822 if( i
!= index
&& i
!= index
-1 && m_lexicon
->GetMiniLexicon(i
) )
1824 notIncluded
<< "Mini-Lexicon " + QString("%1").arg( i
+1 ) + " : Analyzed Words";
1825 notIncluded
<< "Mini-Lexicon " + QString("%1").arg( i
+1 ) + " : Unanalyzed Words";
1826 notIncluded
<< "Mini-Lexicon " + QString("%1").arg( i
+1 ) + " : Stems";
1830 ListBuilderDialog
*dlg
= new ListBuilderDialog( "Linguistica : Populate Mini-Lexicon",
1831 notIncluded
, included
, this );
1832 if( dlg
->exec() == QDialog::Accepted
)
1834 Q3ListBoxItem
* included
= dlg
->GetIncluded()->item(0);
1837 // Populate the word collection of a new mini
1838 active
= m_lexicon
->GetMiniLexicon( index
);
1841 while( active
&& included
)
1843 item
= included
->text();
1844 index
= item
.find( " :" ) - 1;
1845 index
= item
.mid( index
, 1 ).toInt() - 1;
1847 other
= m_lexicon
->GetMiniLexicon( index
);
1848 if( !other
) continue;
1850 if( item
.find( "Unanalyzed" ) >= 0 )
1852 active
->AddToWordCollection(
1853 other
->GetWords(), CMiniLexicon::WW_UnanalyzedOnly
);
1855 else if( item
.find( "Analyzed" ) >= 0 )
1857 active
->AddToWordCollection(other
->GetWords(),
1858 CMiniLexicon::WW_AnalyzedOnly
);
1860 else if( item
.find( "Stems" ) >= 0 )
1862 active
->AddToWordCollection( other
->GetStems() );
1865 included
= included
->next();
1874 emit
updateTreeViewSignal();
1878 void LinguisticaMainWindow::addToBorrowedSigsSlot()
1880 int index
= m_lexicon
->GetActiveMiniIndex();
1881 CMiniLexicon
* active
, * other
;
1883 QStringList notIncluded
, included
;
1885 if( m_lexicon
->GetMiniLexicon( index
-1 ) )
1887 included
<< "Mini-Lexicon " + QString("%1").arg( index
) + " : Signatures";
1889 for( int i
=0; i
< m_lexicon
->GetMiniSize(); i
++ )
1891 if( i
!= index
-1 && m_lexicon
->GetMiniLexicon(i
) )
1893 notIncluded
<< "Mini-Lexicon " + QString("%1").arg( i
+1 ) + " : Signatures";
1897 ListBuilderDialog
*dlg
= new ListBuilderDialog( "Linguistica : Populate Mini-Lexicon",
1898 notIncluded
, included
, this );
1899 if( dlg
->exec() == QDialog::Accepted
)
1901 Q3ListBoxItem
* included
= dlg
->GetIncluded()->item(0);
1904 // Populate the word collection of a new mini
1905 active
= m_lexicon
->GetMiniLexicon( index
);
1907 while( active
&& included
)
1909 item
= included
->text();
1910 index
= item
.find( " :" ) - 1;
1911 index
= item
.mid( index
, 1 ).toInt() - 1;
1913 other
= m_lexicon
->GetMiniLexicon( index
);
1914 if( !other
) continue;
1916 included
= included
->next();
1925 emit
updateTreeViewSignal();
1931 void LinguisticaMainWindow::RunSedSlot()
1933 QMessageBox::information( this, "Debug","Finding word neighbors","OK" );
1936 if ( m_Words_InitialTemplates
!= NULL
)
1938 QMessageBox::information( this, "Attention","You have run the SED !","OK" );
1942 // StringEdit Distance Init
1943 m_Words_InitialTemplates
= new CTemplateCollection
;
1944 m_Words_Templates
= new CTemplateCollection
;
1946 if( m_logging
) OpenLogFile();
1949 FindAllEditDistances(m_Words_InitialTemplates
);
1950 FindAllWordNeighbors(m_lexicon
);
1953 if (false) // John Goldsmith Dec 28 2008 testing what follows:
1955 CheckForConflations(m_Words_Templates
, m_Words_InitialTemplates
);
1957 // Update the Stickness
1958 m_Words_Templates
->UpdateGlobalStickNess2();
1960 // Move Common Head/Tail
1961 m_Words_Templates
->AdjustTemplatesByMovingCommonTailOrHead2(0);
1963 // Collapse algorithm 1
1964 m_Words_Templates
->CollapseAlgorithm1(1);
1966 // Then sort these templates again.
1967 m_Words_Templates
->SetSwitchOfSortingValue(true);
1968 m_Words_Templates
->SetSortValidFlag(false);
1969 m_Words_Templates
->Sort(TEMPLATE_SORT
);
1972 // Next, I tried the absorption algorithm
1973 m_Words_Templates
->AbsorbWords1(1);
1974 m_Words_Templates
->SetSwitchOfSortingValue(true);
1975 m_Words_Templates
->SetSortValidFlag(false);
1976 m_Words_Templates
->Sort(TEMPLATE_SORT
);
1979 // Next, I tried the Paradigmatic graph function
1980 m_Words_Templates
->UpdateGlobalStickNess2();
1981 m_Words_Templates
->FindMorphemePrefixOrSuffixWithParadigmaticGraph(1);
1983 // Then sort these templates again.
1984 m_Words_Templates
->SetSwitchOfSortingValue(true);
1985 m_Words_Templates
->SetSortValidFlag(false);
1986 m_Words_Templates
->Sort(TEMPLATE_SORT
);
1991 m_Words_Templates
->OutputTemplatesForGoldStand();
1992 } // end of if (FALSE);
1993 emit
updateTreeViewSignal();
1997 QMessageBox::information( this, "Attention","Lexicon is NULL","OK" );
1999 if( m_logging
) CloseLogFile();
2003 void LinguisticaMainWindow::FindSlicesSlot()
2005 if( m_lexicon
&& m_lexicon
->GetMiniCount())
2007 //QTime t; t.start();
2009 if (m_logging
) OpenLogFile();
2011 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
2012 CWordCollection
* Words
= current_mini
->GetWords();
2014 SliceCollection MySlices
;
2015 StringInventory MyStringInventory
;
2016 setStatusBar1("Finding slices...");
2017 MyStringInventory
.addwordcollection(Words
, MySlices
, status_display());
2019 if (m_logging
) { MySlices
.writetolog(*GetLogFileStream()); }
2021 MySlices
.FindWordPairs(status_display(), m_lexicon
);
2023 if (m_logging
) CloseLogFile();
2025 //std::cout << "FindSlices:: Time elapsed: " << t.elapsed() << "ms." << std::endl;
2030 /////////////////////////////////////////////////////////////////
2031 void LinguisticaMainWindow::FindAllWordNeighbors(CLexicon
* MyLexicon
)
2034 MyLexicon
->GetSEDWords()->FindAllWordNeighbors(MyLexicon
);
2041 /////////////////////////////////////////////////////////////////
2042 //// FindStringEditDistance
2043 void LinguisticaMainWindow::FindAllEditDistances(CTemplateCollection
* pContainer
)
2045 pContainer
->FindAllEditDistances ( m_lexicon
, m_lexicon
->GetSEDWords()) ;
2050 void LinguisticaMainWindow::CheckForConflations(CTemplateCollection
* Target
, CTemplateCollection
* Source
)
2052 Target
->CheckForConflations(Source
);
2055 bool LinguisticaMainWindow::isCorrectAffix( eAffixLocation affixLoc
)
2057 CMiniLexicon
* mini
= m_lexicon
->GetMiniLexicon( m_lexicon
->GetActiveMiniIndex() );
2058 eAffixLocation current
= mini
->GetAffixLocation();
2060 if( current
== affixLoc
) return TRUE
;
2062 if( ( mini
->GetSuffixes() && !mini
->GetSuffixes()->GetCount() ) ||
2063 ( mini
->GetPrefixes() && !mini
->GetPrefixes()->GetCount() ) )
2065 mini
->SetAffixLocation( affixLoc
);
2073 if( current
== STEM_INITIAL
|| current
== WORD_INITIAL
) return TRUE
;
2079 if( current
== STEM_FINAL
|| current
== WORD_FINAL
) return TRUE
;
2084 void LinguisticaMainWindow::commandLineCloseSlot()
2087 void LinguisticaMainWindow::executeCommandLineArgs(int count
,
2088 bool mini
, bool prefix
, bool suffix
)
2090 if (m_corpusFileName
.isEmpty()) {
2091 // XXX. no corpus file chosen! let user know.
2095 if( count
!= 0 ) SetNumberOfTokens( count
);
2097 m_lexicon
->ClearAll();
2100 if( m_logging
) OpenLogFile();
2102 // Read words into lexicon from the corpus
2103 Q_ASSERT(!m_corpusFileName
.isEmpty());
2104 m_lexicon
->ReadCorpus(m_corpusFileName
, GetNumberOfTokens());
2108 if( suffix
) m_lexicon
->FindSuffixes( TRUE
);
2109 if( prefix
) m_lexicon
->FindPrefixes( TRUE
);
2114 if( suffix
) m_lexicon
->FindSuffixes();
2115 if( prefix
) m_lexicon
->FindPrefixes();
2119 if( m_logging
) CloseLogFile();
2121 // Clear the collection view
2122 m_collectionView
->clear();
2125 int SlashLoc
= m_corpusFileName
.findRev('\\');
2126 if( SlashLoc
< 0 ) SlashLoc
= m_corpusFileName
.findRev('/');
2128 if( m_projectDirectory
.length() == 0 ) m_projectDirectory
= m_corpusFileName
.left( SlashLoc
+ 1 );
2129 else if( m_projectDirectory
.at( m_projectDirectory
.length()-1 ) != '/' ) m_projectDirectory
= m_projectDirectory
+ "/";
2130 if( m_projectDirectory
.length() == 0 ) m_projectDirectory
= "./";
2132 m_projectName
= m_corpusFileName
.mid ( SlashLoc
+ 1 );
2133 int NameLoc
= m_projectName
.findRev(".");
2134 m_projectName
= m_projectName
.left( NameLoc
);
2137 if( m_goldStdFileName
.length() > 0 )
2139 m_goldStdOutputFile
= m_projectDirectory
+ m_projectName
+ "_GoldStandardComparison.txt";
2140 compareGoldStdSlot();
2143 saveFileActionSlot();
2146 emit
updateAllViewsSignal();
2150 // YuHu Add for output morphological cut corpus for MT
2151 // TODO: Need change after 2005/11/30 Fix after Lexicon is done
2152 void LinguisticaMainWindow::editCorpusForMT()
2156 QString FirstPiece, RemainingPiece;
2160 StringToParse* TempSedCuts;
2161 StringToParse::Iterator StringToParseIt;
2162 StringToPtrCStem SFCuts;
2163 StringToPtrCStem SedCuts;
2164 StringToCStem::Iterator SFIt;
2165 StringToCStem* TempSFCut;
2166 int Strategy; // we discussed the strategy 1, 2, 3, 4
2169 // Get the Lingustica analyses result SF or PF
2170 if ( !m_lexicon) return;
2171 TempSFCut = m_lexicon ->GetWords();
2173 for ( SFIt = TempSFCut ->begin(); SFIt != TempSFCut ->end(); SFIt++)
2175 theWord = SFIt.key();
2176 theCStem = &SFIt.data();
2177 SFCuts.insert(theWord, theCStem);
2181 if ( m_Words_Templates != NULL)
2183 TempSedCuts = m_Words_Templates ->GetParsedResult();
2184 for ( StringToParseIt = TempSedCuts ->begin(); StringToParseIt != TempSedCuts ->end(); StringToParseIt++)
2186 theWord = StringToParseIt.key();
2187 theParse = StringToParseIt.data();
2188 theCStem = new CStem(*theParse);
2189 SedCuts.insert(theWord, theCStem);
2193 // 3. Read MT Corpus File
2196 QString FileNameStrippedDot;
2197 QString outputMTFileName_SF;
2198 QString outputMTFileName_SED;
2201 MTFileName = QFileDialog::getOpenFileName( m_projectDirectory,
2205 "Choose a file to open" );
2207 if( !MTFileName.isEmpty() )
2216 FileNameStrippedDot = MTFileName.left(MTFileName.find(QString(".")));
2219 for ( Strategy =1; Strategy <=4; Strategy++)
2221 outputMTFileName_SF = FileNameStrippedDot + "_Output_SF_" + QString("%1").arg(Strategy) + ".txt";
2222 m_lexicon ->CutMtCorpusWithMorphologyAnalyses(MTFileName, outputMTFileName_SF,SFCuts,Strategy);
2225 if ( m_Words_Templates != NULL)
2227 for ( Strategy =1; Strategy <=4; Strategy++)
2229 outputMTFileName_SED = FileNameStrippedDot + "_Output_SED_" + QString("%1").arg(Strategy) + ".txt";
2230 m_Words_Templates ->CutMtCorpusWithMorphologyAnalyses(MTFileName, outputMTFileName_SED,SedCuts,Strategy);
2238 //////////////////////////////////////////////////////////////////////////////
2240 //////////////////////////////////////////////////////////////////////////////
2242 void LinguisticaMainWindow::testMultiDimensionDisplaySlot()
2244 int NumberOfSymbols
;
2247 IntToString listOfSymbols
;
2249 int NumberOfIterations
=100;
2251 NumberOfSymbols
= 4;
2254 // Update the GraphicView to Display the HMM multidimension data
2255 ptrData
= new double*[NumberOfSymbols
];
2256 for ( i
=0; i
<NumberOfSymbols
; i
++)
2258 ptrData
[i
] = new double[NumberOfStates
] ;
2261 // assign initial ptrData
2262 for(i
=0; i
<NumberOfSymbols
;i
++)
2264 listOfSymbols
.insert(i
, QString("s%1").arg(i
));
2265 for(j
=0; j
<NumberOfStates
; j
++)
2267 ptrData
[i
][j
] = 1.0 / NumberOfStates
;
2272 for (i
=0; i
<NumberOfIterations
; i
++)
2275 // Display on Graphic View
2276 updateSmallGraphicDisplaySlotForMultiDimensionData(NumberOfStates
,
2283 for(j
=0; j
<NumberOfSymbols
;j
++)
2285 ptrData
[j
][j
% NumberOfStates
] += 0.1 / NumberOfStates
;
2289 // Sleep for a short time : Is there any Qt sleep function ?
2291 for(j
=0; j
<500000; j
++)
2299 for(i
=0; i
<NumberOfSymbols
; i
++)
2301 delete [] ptrData
[i
];
2308 void LinguisticaMainWindow::goldwaterMethodSlot()
2310 QMessageBox::information ( this, "GoldwaterMethod", "Begin Goldwater Thesis Morphology Learning Algorithm!" );
2313 void LinguisticaMainWindow::suffixesCollapse_two_signaturesAction_activated()
2317 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
2318 CSignatureCollection
TheseSignatures (current_mini
);
2321 int NumberOfSignaturesSelected
= 0;
2323 // QListViewItem* selectedItem = NULL;
2325 m_collectionView
->setSelectionMode (Q3ListView::Extended
);
2327 Q3ListViewItemIterator
it( m_collectionView
);
2329 while ( it
.current() )
2331 if (it
.current()->isSelected() )
2333 NumberOfSignaturesSelected
++;
2334 CSignatureListViewItem
*item
= (CSignatureListViewItem
*) it
.current();
2335 TheseSignatures
<< item
->GetSignature();
2340 if (NumberOfSignaturesSelected
!= 2)
2342 QMessageBox::warning( m_lexicon
->GetDocument(),
2344 "Select exactly two signatures, and press command again",
2346 QMessageBox::NoButton
,
2347 QMessageBox::NoButton
);
2357 m_collectionView
->setSelectionMode (Q3ListView::Single
);
2359 void LinguisticaMainWindow::toggleMultipleSelectionSlot()
2361 if (m_collectionView
->selectionMode() == Q3ListView::Single
)
2363 m_collectionView
->setSelectionMode(Q3ListView::Extended
);
2366 m_collectionView
->setSelectionMode (Q3ListView::Single
);
2372 void LinguisticaMainWindow::addContentToCommandLine(QString content
)
2374 m_commandLine
->insert(content
);
2377 /** \page page1 The GUI: An overview
2379 \section sec The main screen
2380 This page contains the subsections \ref subsection1 and \ref subsection2.
2381 For more info see page \ref page2. Hello??
2382 \subsection subsection1 The first subsection
2384 \subsection subsection2 The second subsection
2387 ! \page page2 How strings are represented: The CParse class
2389 ! \page page3 Collection classes
2390 ! \page page4 The Lexicon class
2391 ! \page page5 A MiniLexicon: Signatures, Stems, Affixes
2396 void LinguisticaMainWindow::fsaTestFuncAction()
2398 if( m_lexicon
&& m_lexicon
->GetMiniCount())
2400 CMiniLexicon
* current_mini
= m_lexicon
->GetMiniLexicon(m_lexicon
->GetActiveMiniIndex());
2401 if(current_mini
->GetFSA())
2403 current_mini
->GetFSA()->ResetDisplay();
2404 current_mini
->GetFSA()->FSATestFunc();
2405 current_mini
->GetFSA()->FSAListDisplay(m_collectionView
,m_lexicon
->GetOutFilter(),false);