CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / linguisticamainwindow_treeview.cpp
blobe18088a374fcf8248d795f6b21a6d411e8850ecc
1 // Updating the main window’s tree view
2 // Copyright © 2009 The University of Chicago
3 #include "linguisticamainwindow.h"
5 #include "MiniLexicon.h"
6 #include "Lexicon.h"
7 #include "TreeViewItem.h"
8 #include "LPreferences.h"
9 #include "StateEmitHMM.h"
10 #include "CorpusWord.h"
11 #include "DLHistory.h"
12 #include "Suffix.h"
13 #include "Prefix.h"
14 #include "CorpusWordCollection.h"
15 #include "SignatureCollection.h"
16 #include "TemplateCollection.h"
17 #include "CompoundCollection.h"
18 #include "LinkerCollection.h"
19 #include "SuffixCollection.h"
20 #include "PrefixCollection.h"
21 #include "BiphoneCollection.h"
22 #include "PhoneCollection.h"
23 #include "StemCollection.h"
24 #include "WordCollection.h"
25 #include "POSCollection.h"
26 #include "AffixLocation.h"
28 /** \page page1 How to make a variable be displayed in the Tree View (left window)
30 Most of the functions here are sensitive to what information has been computed in CLexicon and
31 the MiniLexicons. A few are triggered under any conditions, but most are triggered only
32 if certain items have already been computed.
35 \section sec The main screen
40 void LinguisticaMainWindow::updateTreeViewSlot()
42 // Adapted from MFC version: CMyTree::UpdateUpperTree, CMyTree::UpdateStatistics
44 int count, // used for various counts
45 index; // mini-lexicon index
46 index = 0;
47 count = 0;
49 // bool add = TRUE;
51 CStem* pWord;
53 Q3ListViewItem * MiscItem = NULL,
54 * MiscItem1 = NULL,
55 * LexiconItem = NULL,
56 * WordsReadItem = NULL,
57 * PrefixesItem = NULL,
58 * SuffixesItem = NULL,
59 * WordsItem = NULL,
60 * CompoundsItem = NULL,
61 * ComponentItem = NULL,
62 * STRINGEDITITEM = NULL,
63 * CorpusWordsItem = NULL;
66 // Clear the tree
67 m_treeView->clear();
68 m_treeView->setFont( GetFontPreference( "Main" ) );
69 m_treeView->hideColumn(1);
71 //**************************************************************************************
72 // A NOTE ON THE ORGANIZATION OF THIS FUNCTION:
73 // The items are inserted into the tree in reverse order respective to their group. They
74 // are organized by depth here, i.e. what is connected to the root is the first group,
75 // then do the groups of items connected to this first group, etc. The only items that
76 // get their own name are those that have children. The rest use MiscItem
77 //**************************************************************************************
80 //======================================================================================//
81 // START CONNECTED DIRECTLY TO m_treeView
82 //======================================================================================//
85 count = GetNumberOfTokens();
86 if( count >= 0 )
88 MiscItem = new CTreeViewItem( m_treeView,
89 "Tokens requested: " + IntToStringWithCommas( count ),
90 TOKENS_REQUESTED );
91 MiscItem->setSelectable(false);
94 //======================================================================================//
96 if( m_lexicon->GetWords() && m_lexicon->GetMiniCount() )
98 count = m_lexicon->GetTokenCount();
99 if ( count >= 0 )
101 WordsReadItem = new CTreeViewItem( m_treeView,
102 "Tokens read: " + IntToStringWithCommas( count ) );
103 WordsReadItem->setSelectable(false);
104 WordsReadItem->setOpen(true);
107 //======================================================================================//
109 LexiconItem = new CTreeViewItem( m_treeView,
110 "Lexicon : click items to display them" );
111 LexiconItem->setSelectable(false);
112 LexiconItem->setOpen(true);
114 // add FSA at Lexixon level
115 if(m_lexicon->GetFSA())
116 static_cast<void>(new CTreeViewItem(LexiconItem, "FSA", FSA_DOC, index));
119 //======================================================================================//
121 if ( m_projectDirectory.length() )
123 MiscItem = new CTreeViewItem( m_treeView, "Project directory: " + m_projectDirectory );
124 MiscItem->setSelectable(false);
126 else
128 MiscItem = new CTreeViewItem( m_treeView, "No project directory." );
129 MiscItem->setSelectable(false);
132 //======================================================================================//
134 //SHOW INPUT FILE
135 if ( m_corpusFileName.length() )
137 MiscItem = new CTreeViewItem( m_treeView, "Corpus file: " + m_corpusFileName);
138 MiscItem->setSelectable(false);
141 //======================================================================================//
143 if ( m_logging )
145 MiscItem = new CTreeViewItem( m_treeView, "Log file (now on) " + GetLogFileName() );
146 MiscItem->setSelectable(false);
148 else
150 MiscItem = new CTreeViewItem( m_treeView, "Log file (now off) " + GetLogFileName() );
151 MiscItem->setSelectable(false);
154 //=================================================================================================
155 // END CONNECTED DIRECTLY TO m_treeView
156 // START CONNECTED TO LexiconItem
157 //=================================================================================================
159 if ( LexiconItem && m_lexicon->GetHMM() )
161 MiscItem = new CTreeViewItem( LexiconItem,
162 "HMM",
163 HMM_Document);
164 double dl = m_lexicon->GetHMM()->GetLogProbability();
165 MiscItem1 = new CTreeViewItem(MiscItem,"HMM description length: " + IntToStringWithCommas(int( dl) )
167 MiscItem1 = new CTreeViewItem(MiscItem,
168 "Iterations: " + IntToStringWithCommas( m_lexicon->GetHMM()->m_NumberOfIterations )
170 MiscItem1 = new CTreeViewItem(MiscItem,
171 "Number of states: " + IntToStringWithCommas( m_lexicon->GetHMM()->m_countOfStates )
174 MiscItem->setOpen(true);
176 //======================================================================================//
178 if( LexiconItem )
180 if( m_lexicon->GetDLHistory()->count() > 0 )
182 MiscItem = new CTreeViewItem( LexiconItem,
183 "Description length history",
184 DESCRIPTION_LENGTH_HISTORY );
188 //////////////////////////////
189 //// StringEdit Display
191 if ((LexiconItem != NULL) && (m_Words_InitialTemplates != NULL))
193 if ( m_Words_InitialTemplates ->GetCount() > 0)
195 STRINGEDITITEM = new CTreeViewItem( LexiconItem,
196 "StringEditDistanceTemplates: " + IntToStringWithCommas( 2 ),
197 STRINGEDITDISTANCE, -1);
199 count = m_Words_Templates ->GetCount();
200 if ( count != 0)
202 MiscItem = new CTreeViewItem( STRINGEDITITEM,
203 "StringEdit_Templates: " + IntToStringWithCommas( count ),
204 WORKINGSTRINGEDITTEMPLATES, -1);
208 count = m_Words_InitialTemplates ->GetCount();
209 MiscItem = new CTreeViewItem( STRINGEDITITEM,
210 "StringEdit_InitialTemplates: " + IntToStringWithCommas( count ),
211 INITIALSTRINGEDITTEMPLATES, -1);
215 count = 0;
216 Q3DictIterator<PrefixSet> it5( *m_lexicon->GetAllPrefixes() );
217 for( ; it5.current(); ++it5 )
219 count += it5.current()->count();
221 if( count > 0 )
223 PrefixesItem = new CTreeViewItem( LexiconItem,
224 "All Prefixes " + IntToStringWithCommas( count ),
225 ALL_PREFIXES );
226 PrefixesItem->setOpen( TRUE );
228 //======================================================================================//
229 count = 0;
230 Q3DictIterator<SuffixSet> it4( *m_lexicon->GetAllSuffixes() );
231 for( ; it4.current(); ++it4 )
233 count += it4.current()->count();
235 if( count > 0 )
237 SuffixesItem = new CTreeViewItem( LexiconItem,
238 "All Suffixes " + IntToStringWithCommas( count ),
239 ALL_SUFFIXES );
240 SuffixesItem->setOpen( TRUE );
242 //======================================================================================//
243 count = 0;
244 Q3DictIterator<StemSet> it1( *m_lexicon->GetAllStems() );
245 for( ; it1.current(); ++it1 )
247 count += it1.current()->count();
249 if( count > 0 )
251 MiscItem = new CTreeViewItem( LexiconItem,
252 "All Stems " + IntToStringWithCommas( count ),
253 ALL_STEMS );
255 //======================================================================================//
256 count = 0;
257 Q3DictIterator<StemSet> it2( *m_lexicon->GetAllWords() );
258 for( ; it2.current(); ++it2 )
260 count += it2.current()->count();
263 if( count > 0 )
265 WordsItem = new CTreeViewItem( LexiconItem,
266 "All Words " + IntToStringWithCommas( count ),
267 ALL_WORDS );
268 WordsItem->setOpen( TRUE );
270 //======================================================================================//
271 if( m_lexicon->GetMiniCount() )
273 for( index = m_lexicon->GetMiniSize() - 1; index >= 0; index-- )
275 if( m_lexicon->GetMiniLexicon( index ) )
276 MiscItem = GetMiniLexiconSubTree( LexiconItem, index );
279 //======================================================================================//
280 count = m_lexicon->GetCompounds()->GetCount();
281 if( count > 0 )
283 CompoundsItem = new CTreeViewItem( LexiconItem,
284 "Compounds " + IntToStringWithCommas( count ),
285 COMPOUNDS );
286 CompoundsItem->setOpen( TRUE );
287 int count2 = m_lexicon->GetCompounds()->GetComponents()->GetSize();
288 ComponentItem = new CTreeViewItem( CompoundsItem, "Components "+ IntToStringWithCommas (count2),
289 COMPOUND_COMPONENTS);
291 //======================================================================================//
293 count = m_lexicon->GetWords()->GetCount();
294 if( count > 0 )
296 CorpusWordsItem = new CTreeViewItem( LexiconItem,
297 "Corpus Words " + IntToStringWithCommas( count ),
298 CORPUS_WORDS );
299 CorpusWordsItem->setOpen( TRUE );
301 //=================================================================================================
302 // END CONNECTED TO LexiconItem
303 // START CONNECTED TO CorpusWordsItem
304 //=================================================================================================
306 count = 0;
307 if( CorpusWordsItem )
310 CCorpusWord* pCorpusWord;
311 CCorpusWordCollection* pWords = m_lexicon->GetWords();
313 pWords->Sort( KEY );
315 for( int i = 0; i < pWords->GetCount(); i++ )
317 pCorpusWord = pWords->GetAtSort(i);
319 if( pCorpusWord->Size() > 1 )
321 count++;
325 if( count > 0 )
327 MiscItem = new CTreeViewItem( CorpusWordsItem,
328 "Analyzed " + IntToStringWithCommas( count ),
329 ANALYZED_CORPUS_WORDS );
333 //=================================================================================================
334 // END CONNECTED TO CorpusWordsItem
335 // START CONNECTED TO WordsItem
336 //=================================================================================================
338 count = 0;
340 bool analyzed_exists;
341 Q3DictIterator<StemSet> it3( *m_lexicon->GetAllWords() );
342 for( ; it3.current(); ++it3 )
344 analyzed_exists = FALSE;
345 //for( pWord = it3.current()->first(); pWord; pWord = it3.current()->next() )
346 for (int z = 0; z < it3.current()->size(); z++)
348 pWord = it3.current()->at(z);
349 if( pWord->Size() > 1 )
351 analyzed_exists = TRUE;
352 count++;
357 if( count > 0 )
359 MiscItem = new CTreeViewItem( WordsItem,
360 "Analyzed " + IntToStringWithCommas( count ),
361 ALL_ANALYZED_WORDS );
364 //=================================================================================================
365 // END CONNECTED TO WordsItem
366 // START CONNECTED TO SuffixesItem
367 //=================================================================================================
369 count = 0;
371 Q3DictIterator<SignatureSet> it7( *m_lexicon->GetAllSuffixSigs() );
372 for( ; it7.current(); ++it7 )
374 count += it7.current()->count();
376 if( count > 0 )
378 MiscItem = new CTreeViewItem( SuffixesItem,
379 "Signatures " + IntToStringWithCommas( count ),
380 ALL_SUFFIX_SIGNATURES );
383 //=================================================================================================
384 // END CONNECTED TO SuffixesItem
385 // START CONNECTED TO PrefixesItem
386 //=================================================================================================
388 count = 0;
390 Q3DictIterator<SignatureSet> it6( *m_lexicon->GetAllPrefixSigs() );
391 for( ; it6.current(); ++it6 )
393 count += it6.current()->count();
395 if( count > 0 )
397 MiscItem = new CTreeViewItem( PrefixesItem,
398 "Signatures " + IntToStringWithCommas( count ),
399 ALL_PREFIX_SIGNATURES );
402 //=================================================================================================
403 // END CONNECTED TO PrefixesItem
404 // START CONNECTED TO WordsReadItem
405 //=================================================================================================
407 if( WordsReadItem )
409 if( m_lexicon->GetWords() )
411 count = m_lexicon->GetWords()->GetCount();
412 if( count > 0 )
414 MiscItem = new CTreeViewItem( WordsReadItem,
415 "Distinct types read: " + IntToStringWithCommas( count ) );
416 MiscItem->setSelectable(false);
420 //======================================================================================//
422 count = m_lexicon->GetCorpusCount();
423 if( count >= 0 )
425 MiscItem = new CTreeViewItem( WordsReadItem,
426 "Tokens included: " + IntToStringWithCommas( count ) );
427 MiscItem->setSelectable(false);
432 //=================================================================================================
433 // END CONNECTED TO WordsReadItem
434 // START CONNECTED TO CompoundsItem
435 //=================================================================================================
437 count = m_lexicon->GetLinkers()->GetCount();
438 if( count > 0 )
440 MiscItem = new CTreeViewItem( CompoundsItem,
441 "Linkers " + IntToStringWithCommas( count ),
442 LINKERS, index );
448 Q3ListViewItem* LinguisticaMainWindow::GetMiniLexiconSubTree(
449 Q3ListViewItem* parent, int index)
451 CMiniLexicon* lexicon = m_lexicon->GetMiniLexicon(index);
452 if (lexicon == 0)
453 // nothing to draw
454 return 0;
456 enum eAffixLocation affixLocation = lexicon->GetAffixLocation();
458 // Items are inserted into the tree in reverse order
459 // respective to their group. They are organized by depth here,
460 // i.e. what is connected to the root is the first group,
461 // then do the groups of items connected to this first group, etc.
462 // The only items that get their own name are those that have children.
464 Q3ListViewItem* LexiconItem =
465 // owned by parent
466 new CTreeViewItem(parent,
467 QString(
468 m_lexicon->GetActiveMiniIndex() == index
469 ? "Mini-Lexicon %1\t**ACTIVE**"
470 : "Mini-Lexicon %1")
471 .arg(index+1),
472 MINI_LEXICON, index);
473 LexiconItem->setSelectable(false);
474 LexiconItem->setOpen(true);
475 // START CONNECTED TO LexiconItem
476 if (m_lexicon->GetFSA() != 0) //get from lexicon, not mini-lexicon
477 static_cast<void>(new CTreeViewItem(
478 LexiconItem, "FSA", FSA_DOC, index));
480 // XXX. HMMLexemes, HMM Corpus Tokens?
482 if (LexiconItem != 0)
483 if (m_lexicon->GetDLHistory()->count() > 0)
484 static_cast<void>(new CTreeViewItem(
485 LexiconItem,
486 "Description length",
487 DESCRIPTION_LENGTH));
489 // Suffixes or prefixes
491 Q3ListViewItem* AffixesItem = 0;
492 if (is_initial(affixLocation)) {
493 // XXX. update to match suffix case
495 const int count = lexicon->GetPrefixes()->GetCount();
497 if (count > 0) {
498 AffixesItem = new CTreeViewItem(LexiconItem,
499 QString("Prefixes %1").arg(
500 IntToStringWithCommas(count)),
501 PREFIXES,
502 index);
503 AffixesItem->setOpen( true );
505 } else {
506 const int count = lexicon->GetSuffixes()->GetCount();
507 const int usecount = lexicon->GetSuffixes()->GetTotalUseCount();
508 lexicon->GetSuffixes()->RecomputeCorpusCount();
509 const int corpuscount = lexicon->GetSuffixes()->GetCorpusCount();
511 if (count > 0) {
512 AffixesItem = new CTreeViewItem(LexiconItem,
513 QString("Suffixes %1 : %2 : %3").arg(
514 IntToStringWithCommas(count),
515 IntToStringWithCommas(usecount),
516 IntToStringWithCommas(corpuscount)),
517 SUFFIXES,
518 index);
519 AffixesItem->setOpen(true);
524 int dummy;
525 const int count = lexicon->GetWords()->HowManyAreAnalyzed(
526 dummy, status_display());
527 if (count > 0) {
528 static_cast<void>(new CTreeViewItem(LexiconItem,
529 QString("Analyzed words %1").arg(
530 IntToStringWithCommas(count)),
531 ANALYZED_WORDS,
532 index));
536 Q3ListViewItem* WordsItem = 0;
538 const int count = lexicon->GetWords()->GetCount();
539 if (count > 0) {
540 QString caption = QString("Words %1 Z: %2")
541 .arg(IntToStringWithCommas(count))
542 .arg(lexicon->GetWords()->GetZ_Local());
543 WordsItem = new CTreeViewItem(LexiconItem,
544 caption, WORDS, index);
545 WordsItem->setOpen(true);
548 // END CONNECTED TO LexiconItem
549 // START CONNECTED TO WordsItem
551 const int count = lexicon->GetWords()->GetTrie()->GetCount();
552 if (count > 0) {
553 if (lexicon->GetWords()->GetReverseTrie() != 0) {
554 static_cast<void>(new CTreeViewItem(
555 WordsItem,
556 QString("Reverse trie %1")
557 .arg(IntToStringWithCommas(count)),
558 REVERSE_TRIE, index));
561 static_cast<void>(new CTreeViewItem(
562 WordsItem,
563 QString("Forward trie %1")
564 .arg(IntToStringWithCommas(count)),
565 TRIE, index));
570 // XXX. lexicon->GetVowels()?
573 const int tier1_bigrams = lexicon->GetWords()
574 ->GetPhonologicalContentTier1Bigrams();
575 // XXX. probably a typo.
576 if (tier1_bigrams != 0) {
577 static_cast<void>(new CTreeViewItem(
578 WordsItem,
579 QString("Unigram description length %1")
580 .arg(IntToStringWithCommas(
581 lexicon->GetWords()
582 ->GetPhonologicalContentUnigrams())),
583 UNIGRAM_INFORMATION, index));
586 if (tier1_bigrams != 0) {
587 static_cast<void>(new CTreeViewItem(
588 WordsItem,
589 QString("Bigram description length %1")
590 .arg(IntToStringWithCommas(tier1_bigrams)),
591 BIGRAM_INFORMATION, index));
595 if (const int distant_log_pr =
596 lexicon->GetWords()->GetDistantMI_Plog())
597 static_cast<void>(new CTreeViewItem(
598 WordsItem,
599 QString("Distant MI model plog: %1")
600 .arg(IntToStringWithCommas(distant_log_pr)),
601 BIGRAM_INFORMATION, index));
603 if (const int local_log_pr =
604 lexicon->GetWords()->GetLocalMI_Plog())
605 static_cast<void>(new CTreeViewItem(
606 WordsItem,
607 QString("Local MI model plog: %1")
608 .arg(IntToStringWithCommas(local_log_pr)),
609 BIGRAM_INFORMATION, index));
611 if (const double distant_denom =
612 lexicon->GetWords()->GetZ_Distant())
613 static_cast<void>(new CTreeViewItem(
614 WordsItem,
615 QString("Z (distant model): %1")
616 .arg(distant_denom),
617 BIGRAM_INFORMATION, index));
619 if (const double local_denom =
620 lexicon->GetWords()->GetZ_Local())
621 static_cast<void>(new CTreeViewItem(
622 WordsItem,
623 QString("Z (local) : %1")
624 .arg(local_denom),
625 BIGRAM_INFORMATION, index));
627 // Phones inside words
628 // Tier 2
629 if (CPhoneCollection* phones = lexicon->GetWords()->GetPhones_Tier2()) {
630 const int count = phones->GetCount();
631 const int totalcount = phones->GetCorpusCount();
633 if (count > 0) {
634 Q3ListViewItem* Tier2Item =
635 // owned by WordsItem
636 new CTreeViewItem(WordsItem,
637 "Tier 2 ",
638 PHONES_Tier2, index);
639 Tier2Item->setOpen(true);
641 static_cast<void>(new CTreeViewItem(Tier2Item,
642 QString("Phones %1 : %2")
643 .arg(IntToStringWithCommas(count),
644 IntToStringWithCommas(totalcount)),
645 PHONES_Tier2, index));
647 // Tier 2 biphones
648 CBiphoneCollection* biphones = phones->GetMyBiphones();
649 const int biphone_count = biphones->count();
650 const int total_biphone_count = biphones->m_TotalCount;
651 if (biphone_count > 0) {
652 static_cast<void>(new CTreeViewItem(
653 Tier2Item,
654 QString("Biphones %1 : %2")
655 .arg(IntToStringWithCommas(biphone_count),
656 IntToStringWithCommas(total_biphone_count)),
657 BIPHONES_Tier2, index));
659 if (const int local_score = lexicon->GetWords()
660 ->GetTier2_LocalMI_Score())
661 static_cast<void>(new CTreeViewItem(
662 Tier2Item,
663 QString("Tier 2 Local MI score %1")
664 .arg(IntToStringWithCommas(
665 local_score)),
666 TIER2MI, index));
668 if (const int distant_score = lexicon->GetWords()
669 ->GetTier2_DistantMI_Score())
670 static_cast<void>(new CTreeViewItem(
671 Tier2Item,
672 QString("Tier 2 Distant MI score %1")
673 .arg(IntToStringWithCommas(
674 distant_score)),
675 TIER2MI, index));
680 // Tier 1 Skeleton
682 CPhoneCollection* phones =
683 lexicon->GetWords()->GetPhones_Tier1_Skeleton();
684 const int count = phones->GetCount();
685 const int totalcount = phones->GetCorpusCount();
687 if (count > 0) {
688 Q3ListViewItem* Tier1Item =
689 // owned by WordsItem
690 new CTreeViewItem(WordsItem,
691 "Tier 1 Skeleton ",
692 PHONES_Tier1_Skeleton, index);
693 Tier1Item->setOpen(true);
695 static_cast<void>(new CTreeViewItem(
696 Tier1Item,
697 QString("Phones (skeleton) %1 : %2")
698 .arg(IntToStringWithCommas(count),
699 IntToStringWithCommas(totalcount)),
700 PHONES_Tier1_Skeleton, index));
702 CBiphoneCollection* biphones = phones->GetMyBiphones();
703 const int biphone_count = biphones->count();
704 const int biphone_totalcount = biphones->m_TotalCount;
705 if (biphone_count > 0) {
706 static_cast<void>(new CTreeViewItem(
707 Tier1Item,
708 QString("Biphones (skeleton) %1 : %2")
709 .arg(IntToStringWithCommas(biphone_count),
710 IntToStringWithCommas(biphone_totalcount)),
711 BIPHONES_Tier1_Skeleton, index));
717 // Tier 1
718 CPhoneCollection* phones = lexicon->GetWords()->GetPhones();
719 const int count = phones->GetCount();
720 const int totalcount = phones->GetCorpusCount();
722 if (count > 0) {
723 Q3ListViewItem* Tier1Item =
724 // owned by WordsItem
725 new CTreeViewItem(WordsItem,
726 "Tier 1 ",
727 PHONES, index);
728 Tier1Item->setOpen(true);
730 static_cast<void>(new CTreeViewItem(
731 Tier1Item,
732 QString("Phones %1 : %2")
733 .arg(IntToStringWithCommas(count),
734 IntToStringWithCommas(totalcount)),
735 PHONES, index));
737 CBiphoneCollection* biphones = phones->GetMyBiphones();
738 const int biphone_count = biphones->count();
739 const int biphone_totalcount = biphones->m_TotalCount;
740 if (biphone_count > 0) {
741 static_cast<void>(new CTreeViewItem(
742 Tier1Item,
743 QString("Biphones %1 : %2")
744 .arg(IntToStringWithCommas(biphone_count),
745 IntToStringWithCommas(biphone_totalcount)),
746 BIPHONES, index));
750 // END CONNECTED TO WordsItem
752 // START CONNECTED TO AffixesItem
754 const int count = lexicon->GetStems()->GetCount();
755 if (count > 0) {
756 static_cast<void>(new CTreeViewItem(
757 AffixesItem,
758 QString("Stems %1")
759 .arg(IntToStringWithCommas(count)),
760 STEMS, index));
765 const int count = lexicon->GetSignatures()->GetCount();
766 if (count > 0) {
767 static_cast<void>(new CTreeViewItem(
768 AffixesItem,
769 QString("Signatures %1")
770 .arg(IntToStringWithCommas(count)),
771 SIGNATURES, index));
775 if (LxPoSCollection* parts_of_speech = lexicon->GetPOS()) {
776 const int count = parts_of_speech->count();
778 static_cast<void>(new CTreeViewItem(AffixesItem,
779 QString("Parts of speech %1")
780 .arg(IntToStringWithCommas(count)),
781 POS, index));
784 return LexiconItem;