HowManyAreAnalyzed(): use status_user_agent to report progress
[linguistica.git] / linguisticamainwindow_treeview.cpp
blob71d7249011aad76463746410b2d9f58f54fdddde
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);
115 //======================================================================================//
117 if ( m_projectDirectory.length() )
119 MiscItem = new CTreeViewItem( m_treeView, "Project directory: " + m_projectDirectory );
120 MiscItem->setSelectable(false);
122 else
124 MiscItem = new CTreeViewItem( m_treeView, "No project directory." );
125 MiscItem->setSelectable(false);
128 //======================================================================================//
130 if ( m_logging )
132 MiscItem = new CTreeViewItem( m_treeView, "Log file (now on) " + GetLogFileName() );
133 MiscItem->setSelectable(false);
135 else
137 MiscItem = new CTreeViewItem( m_treeView, "Log file (now off) " + GetLogFileName() );
138 MiscItem->setSelectable(false);
141 //=================================================================================================
142 // END CONNECTED DIRECTLY TO m_treeView
143 // START CONNECTED TO LexiconItem
144 //=================================================================================================
146 if ( LexiconItem && m_lexicon->GetHMM() )
148 MiscItem = new CTreeViewItem( LexiconItem,
149 "HMM",
150 HMM_Document);
151 double dl = m_lexicon->GetHMM()->GetLogProbability();
152 MiscItem1 = new CTreeViewItem(MiscItem,"HMM description length: " + IntToStringWithCommas(int( dl) )
154 MiscItem1 = new CTreeViewItem(MiscItem,
155 "Iterations: " + IntToStringWithCommas( m_lexicon->GetHMM()->m_NumberOfIterations )
157 MiscItem1 = new CTreeViewItem(MiscItem,
158 "Number of states: " + IntToStringWithCommas( m_lexicon->GetHMM()->m_countOfStates )
161 MiscItem->setOpen(true);
163 //======================================================================================//
165 if( LexiconItem )
167 if( m_lexicon->GetDLHistory()->count() > 0 )
169 MiscItem = new CTreeViewItem( LexiconItem,
170 "Description length history",
171 DESCRIPTION_LENGTH_HISTORY );
175 //////////////////////////////
176 //// StringEdit Display
178 if ((LexiconItem != NULL) && (m_Words_InitialTemplates != NULL))
180 if ( m_Words_InitialTemplates ->GetCount() > 0)
182 STRINGEDITITEM = new CTreeViewItem( LexiconItem,
183 "StringEditDistanceTemplates: " + IntToStringWithCommas( 2 ),
184 STRINGEDITDISTANCE, -1);
186 count = m_Words_Templates ->GetCount();
187 if ( count != 0)
189 MiscItem = new CTreeViewItem( STRINGEDITITEM,
190 "StringEdit_Templates: " + IntToStringWithCommas( count ),
191 WORKINGSTRINGEDITTEMPLATES, -1);
195 count = m_Words_InitialTemplates ->GetCount();
196 MiscItem = new CTreeViewItem( STRINGEDITITEM,
197 "StringEdit_InitialTemplates: " + IntToStringWithCommas( count ),
198 INITIALSTRINGEDITTEMPLATES, -1);
202 count = 0;
203 Q3DictIterator<PrefixSet> it5( *m_lexicon->GetAllPrefixes() );
204 for( ; it5.current(); ++it5 )
206 count += it5.current()->count();
208 if( count > 0 )
210 PrefixesItem = new CTreeViewItem( LexiconItem,
211 "All Prefixes " + IntToStringWithCommas( count ),
212 ALL_PREFIXES );
213 PrefixesItem->setOpen( TRUE );
215 //======================================================================================//
216 count = 0;
217 Q3DictIterator<SuffixSet> it4( *m_lexicon->GetAllSuffixes() );
218 for( ; it4.current(); ++it4 )
220 count += it4.current()->count();
222 if( count > 0 )
224 SuffixesItem = new CTreeViewItem( LexiconItem,
225 "All Suffixes " + IntToStringWithCommas( count ),
226 ALL_SUFFIXES );
227 SuffixesItem->setOpen( TRUE );
229 //======================================================================================//
230 count = 0;
231 Q3DictIterator<StemSet> it1( *m_lexicon->GetAllStems() );
232 for( ; it1.current(); ++it1 )
234 count += it1.current()->count();
236 if( count > 0 )
238 MiscItem = new CTreeViewItem( LexiconItem,
239 "All Stems " + IntToStringWithCommas( count ),
240 ALL_STEMS );
242 //======================================================================================//
243 count = 0;
244 Q3DictIterator<StemSet> it2( *m_lexicon->GetAllWords() );
245 for( ; it2.current(); ++it2 )
247 count += it2.current()->count();
250 if( count > 0 )
252 WordsItem = new CTreeViewItem( LexiconItem,
253 "All Words " + IntToStringWithCommas( count ),
254 ALL_WORDS );
255 WordsItem->setOpen( TRUE );
257 //======================================================================================//
258 if( m_lexicon->GetMiniCount() )
260 for( index = m_lexicon->GetMiniSize() - 1; index >= 0; index-- )
262 if( m_lexicon->GetMiniLexicon( index ) )
263 MiscItem = GetMiniLexiconSubTree( LexiconItem, index );
266 //======================================================================================//
267 count = m_lexicon->GetCompounds()->GetCount();
268 if( count > 0 )
270 CompoundsItem = new CTreeViewItem( LexiconItem,
271 "Compounds " + IntToStringWithCommas( count ),
272 COMPOUNDS );
273 CompoundsItem->setOpen( TRUE );
274 int count2 = m_lexicon->GetCompounds()->GetComponents()->GetSize();
275 ComponentItem = new CTreeViewItem( CompoundsItem, "Components "+ IntToStringWithCommas (count2),
276 COMPOUND_COMPONENTS);
278 //======================================================================================//
280 count = m_lexicon->GetWords()->GetCount();
281 if( count > 0 )
283 CorpusWordsItem = new CTreeViewItem( LexiconItem,
284 "Corpus Words " + IntToStringWithCommas( count ),
285 CORPUS_WORDS );
286 CorpusWordsItem->setOpen( TRUE );
288 //=================================================================================================
289 // END CONNECTED TO LexiconItem
290 // START CONNECTED TO CorpusWordsItem
291 //=================================================================================================
293 count = 0;
294 if( CorpusWordsItem )
297 CCorpusWord* pCorpusWord;
298 CCorpusWordCollection* pWords = m_lexicon->GetWords();
300 pWords->Sort( KEY );
302 for( int i = 0; i < pWords->GetCount(); i++ )
304 pCorpusWord = pWords->GetAtSort(i);
306 if( pCorpusWord->Size() > 1 )
308 count++;
312 if( count > 0 )
314 MiscItem = new CTreeViewItem( CorpusWordsItem,
315 "Analyzed " + IntToStringWithCommas( count ),
316 ANALYZED_CORPUS_WORDS );
320 //=================================================================================================
321 // END CONNECTED TO CorpusWordsItem
322 // START CONNECTED TO WordsItem
323 //=================================================================================================
325 count = 0;
327 bool analyzed_exists;
328 Q3DictIterator<StemSet> it3( *m_lexicon->GetAllWords() );
329 for( ; it3.current(); ++it3 )
331 analyzed_exists = FALSE;
332 //for( pWord = it3.current()->first(); pWord; pWord = it3.current()->next() )
333 for (int z = 0; z < it3.current()->size(); z++)
335 pWord = it3.current()->at(z);
336 if( pWord->Size() > 1 )
338 analyzed_exists = TRUE;
339 count++;
344 if( count > 0 )
346 MiscItem = new CTreeViewItem( WordsItem,
347 "Analyzed " + IntToStringWithCommas( count ),
348 ALL_ANALYZED_WORDS );
351 //=================================================================================================
352 // END CONNECTED TO WordsItem
353 // START CONNECTED TO SuffixesItem
354 //=================================================================================================
356 count = 0;
358 Q3DictIterator<SignatureSet> it7( *m_lexicon->GetAllSuffixSigs() );
359 for( ; it7.current(); ++it7 )
361 count += it7.current()->count();
363 if( count > 0 )
365 MiscItem = new CTreeViewItem( SuffixesItem,
366 "Signatures " + IntToStringWithCommas( count ),
367 ALL_SUFFIX_SIGNATURES );
370 //=================================================================================================
371 // END CONNECTED TO SuffixesItem
372 // START CONNECTED TO PrefixesItem
373 //=================================================================================================
375 count = 0;
377 Q3DictIterator<SignatureSet> it6( *m_lexicon->GetAllPrefixSigs() );
378 for( ; it6.current(); ++it6 )
380 count += it6.current()->count();
382 if( count > 0 )
384 MiscItem = new CTreeViewItem( PrefixesItem,
385 "Signatures " + IntToStringWithCommas( count ),
386 ALL_PREFIX_SIGNATURES );
389 //=================================================================================================
390 // END CONNECTED TO PrefixesItem
391 // START CONNECTED TO WordsReadItem
392 //=================================================================================================
394 if( WordsReadItem )
396 if( m_lexicon->GetWords() )
398 count = m_lexicon->GetWords()->GetCount();
399 if( count > 0 )
401 MiscItem = new CTreeViewItem( WordsReadItem,
402 "Distinct types read: " + IntToStringWithCommas( count ) );
403 MiscItem->setSelectable(false);
407 //======================================================================================//
409 count = m_lexicon->GetCorpusCount();
410 if( count >= 0 )
412 MiscItem = new CTreeViewItem( WordsReadItem,
413 "Tokens included: " + IntToStringWithCommas( count ) );
414 MiscItem->setSelectable(false);
419 //=================================================================================================
420 // END CONNECTED TO WordsReadItem
421 // START CONNECTED TO CompoundsItem
422 //=================================================================================================
424 count = m_lexicon->GetLinkers()->GetCount();
425 if( count > 0 )
427 MiscItem = new CTreeViewItem( CompoundsItem,
428 "Linkers " + IntToStringWithCommas( count ),
429 LINKERS, index );
435 Q3ListViewItem* LinguisticaMainWindow::GetMiniLexiconSubTree(
436 Q3ListViewItem* parent, int index)
438 CMiniLexicon* lexicon = m_lexicon->GetMiniLexicon(index);
439 if (lexicon == 0)
440 // nothing to draw
441 return 0;
443 enum eAffixLocation affixLocation = lexicon->GetAffixLocation();
445 // Items are inserted into the tree in reverse order
446 // respective to their group. They are organized by depth here,
447 // i.e. what is connected to the root is the first group,
448 // then do the groups of items connected to this first group, etc.
449 // The only items that get their own name are those that have children.
451 Q3ListViewItem* LexiconItem =
452 // owned by parent
453 new CTreeViewItem(parent,
454 QString(
455 m_lexicon->GetActiveMiniIndex() == index
456 ? "Mini-Lexicon %1\t**ACTIVE**"
457 : "Mini-Lexicon %1")
458 .arg(index+1),
459 MINI_LEXICON, index);
460 LexiconItem->setSelectable(false);
461 LexiconItem->setOpen(true);
462 // START CONNECTED TO LexiconItem
463 if (lexicon->GetFSA() != 0)
464 static_cast<void>(new CTreeViewItem(
465 LexiconItem, "FSA", FSA_DOC, index));
467 // XXX. HMMLexemes, HMM Corpus Tokens?
469 if (LexiconItem != 0)
470 if (m_lexicon->GetDLHistory()->count() > 0)
471 static_cast<void>(new CTreeViewItem(
472 LexiconItem,
473 "Description length",
474 DESCRIPTION_LENGTH));
476 // Suffixes or prefixes
478 Q3ListViewItem* AffixesItem = 0;
479 if (is_initial(affixLocation)) {
480 // XXX. update to match suffix case
482 const int count = lexicon->GetPrefixes()->GetCount();
484 if (count > 0) {
485 AffixesItem = new CTreeViewItem(LexiconItem,
486 QString("Prefixes %1").arg(
487 IntToStringWithCommas(count)),
488 PREFIXES,
489 index);
490 AffixesItem->setOpen( true );
492 } else {
493 const int count = lexicon->GetSuffixes()->GetCount();
494 const int usecount = lexicon->GetSuffixes()->GetTotalUseCount();
495 lexicon->GetSuffixes()->RecomputeCorpusCount();
496 const int corpuscount = lexicon->GetSuffixes()->GetCorpusCount();
498 if (count > 0) {
499 AffixesItem = new CTreeViewItem(LexiconItem,
500 QString("Suffixes %1 : %2 : %3").arg(
501 IntToStringWithCommas(count),
502 IntToStringWithCommas(usecount),
503 IntToStringWithCommas(corpuscount)),
504 SUFFIXES,
505 index);
506 AffixesItem->setOpen(true);
511 int dummy;
512 const int count = lexicon->GetWords()->HowManyAreAnalyzed(
513 dummy, status_display());
514 if (count > 0) {
515 static_cast<void>(new CTreeViewItem(LexiconItem,
516 QString("Analyzed words %1").arg(
517 IntToStringWithCommas(count)),
518 ANALYZED_WORDS,
519 index));
523 Q3ListViewItem* WordsItem = 0;
525 const int count = lexicon->GetWords()->GetCount();
526 if (count > 0) {
527 QString caption = QString("Words %1 Z: %2")
528 .arg(IntToStringWithCommas(count))
529 .arg(lexicon->GetWords()->GetZ_Local());
530 WordsItem = new CTreeViewItem(LexiconItem,
531 caption, WORDS, index);
532 WordsItem->setOpen(true);
535 // END CONNECTED TO LexiconItem
536 // START CONNECTED TO WordsItem
538 const int count = lexicon->GetWords()->GetTrie()->GetCount();
539 if (count > 0) {
540 if (lexicon->GetWords()->GetReverseTrie() != 0) {
541 static_cast<void>(new CTreeViewItem(
542 WordsItem,
543 QString("Reverse trie %1")
544 .arg(IntToStringWithCommas(count)),
545 REVERSE_TRIE, index));
548 static_cast<void>(new CTreeViewItem(
549 WordsItem,
550 QString("Forward trie %1")
551 .arg(IntToStringWithCommas(count)),
552 TRIE, index));
557 // XXX. lexicon->GetVowels()?
560 const int tier1_bigrams = lexicon->GetWords()
561 ->GetPhonologicalContentTier1Bigrams();
562 // XXX. probably a typo.
563 if (tier1_bigrams != 0) {
564 static_cast<void>(new CTreeViewItem(
565 WordsItem,
566 QString("Unigram description length %1")
567 .arg(IntToStringWithCommas(
568 lexicon->GetWords()
569 ->GetPhonologicalContentUnigrams())),
570 UNIGRAM_INFORMATION, index));
573 if (tier1_bigrams != 0) {
574 static_cast<void>(new CTreeViewItem(
575 WordsItem,
576 QString("Bigram description length %1")
577 .arg(IntToStringWithCommas(tier1_bigrams)),
578 BIGRAM_INFORMATION, index));
582 if (const int distant_log_pr =
583 lexicon->GetWords()->GetDistantMI_Plog())
584 static_cast<void>(new CTreeViewItem(
585 WordsItem,
586 QString("Distant MI model plog: %1")
587 .arg(IntToStringWithCommas(distant_log_pr)),
588 BIGRAM_INFORMATION, index));
590 if (const int local_log_pr =
591 lexicon->GetWords()->GetLocalMI_Plog())
592 static_cast<void>(new CTreeViewItem(
593 WordsItem,
594 QString("Local MI model plog: %1")
595 .arg(IntToStringWithCommas(local_log_pr)),
596 BIGRAM_INFORMATION, index));
598 if (const double distant_denom =
599 lexicon->GetWords()->GetZ_Distant())
600 static_cast<void>(new CTreeViewItem(
601 WordsItem,
602 QString("Z (distant model): %1")
603 .arg(distant_denom),
604 BIGRAM_INFORMATION, index));
606 if (const double local_denom =
607 lexicon->GetWords()->GetZ_Local())
608 static_cast<void>(new CTreeViewItem(
609 WordsItem,
610 QString("Z (local) : %1")
611 .arg(local_denom),
612 BIGRAM_INFORMATION, index));
614 // Phones inside words
615 // Tier 2
616 if (CPhoneCollection* phones = lexicon->GetWords()->GetPhones_Tier2()) {
617 const int count = phones->GetCount();
618 const int totalcount = phones->GetCorpusCount();
620 if (count > 0) {
621 Q3ListViewItem* Tier2Item =
622 // owned by WordsItem
623 new CTreeViewItem(WordsItem,
624 "Tier 2 ",
625 PHONES_Tier2, index);
626 Tier2Item->setOpen(true);
628 static_cast<void>(new CTreeViewItem(Tier2Item,
629 QString("Phones %1 : %2")
630 .arg(IntToStringWithCommas(count),
631 IntToStringWithCommas(totalcount)),
632 PHONES_Tier2, index));
634 // Tier 2 biphones
635 CBiphoneCollection* biphones = phones->GetMyBiphones();
636 const int biphone_count = biphones->count();
637 const int total_biphone_count = biphones->m_TotalCount;
638 if (biphone_count > 0) {
639 static_cast<void>(new CTreeViewItem(
640 Tier2Item,
641 QString("Biphones %1 : %2")
642 .arg(IntToStringWithCommas(biphone_count),
643 IntToStringWithCommas(total_biphone_count)),
644 BIPHONES_Tier2, index));
646 if (const int local_score = lexicon->GetWords()
647 ->GetTier2_LocalMI_Score())
648 static_cast<void>(new CTreeViewItem(
649 Tier2Item,
650 QString("Tier 2 Local MI score %1")
651 .arg(IntToStringWithCommas(
652 local_score)),
653 TIER2MI, index));
655 if (const int distant_score = lexicon->GetWords()
656 ->GetTier2_DistantMI_Score())
657 static_cast<void>(new CTreeViewItem(
658 Tier2Item,
659 QString("Tier 2 Distant MI score %1")
660 .arg(IntToStringWithCommas(
661 distant_score)),
662 TIER2MI, index));
667 // Tier 1 Skeleton
669 CPhoneCollection* phones =
670 lexicon->GetWords()->GetPhones_Tier1_Skeleton();
671 const int count = phones->GetCount();
672 const int totalcount = phones->GetCorpusCount();
674 if (count > 0) {
675 Q3ListViewItem* Tier1Item =
676 // owned by WordsItem
677 new CTreeViewItem(WordsItem,
678 "Tier 1 Skeleton ",
679 PHONES_Tier1_Skeleton, index);
680 Tier1Item->setOpen(true);
682 static_cast<void>(new CTreeViewItem(
683 Tier1Item,
684 QString("Phones (skeleton) %1 : %2")
685 .arg(IntToStringWithCommas(count),
686 IntToStringWithCommas(totalcount)),
687 PHONES_Tier1_Skeleton, index));
689 CBiphoneCollection* biphones = phones->GetMyBiphones();
690 const int biphone_count = biphones->count();
691 const int biphone_totalcount = biphones->m_TotalCount;
692 if (biphone_count > 0) {
693 static_cast<void>(new CTreeViewItem(
694 Tier1Item,
695 QString("Biphones (skeleton) %1 : %2")
696 .arg(IntToStringWithCommas(biphone_count),
697 IntToStringWithCommas(biphone_totalcount)),
698 BIPHONES_Tier1_Skeleton, index));
704 // Tier 1
705 CPhoneCollection* phones = lexicon->GetWords()->GetPhones();
706 const int count = phones->GetCount();
707 const int totalcount = phones->GetCorpusCount();
709 if (count > 0) {
710 Q3ListViewItem* Tier1Item =
711 // owned by WordsItem
712 new CTreeViewItem(WordsItem,
713 "Tier 1 ",
714 PHONES, index);
715 Tier1Item->setOpen(true);
717 static_cast<void>(new CTreeViewItem(
718 Tier1Item,
719 QString("Phones %1 : %2")
720 .arg(IntToStringWithCommas(count),
721 IntToStringWithCommas(totalcount)),
722 PHONES, index));
724 CBiphoneCollection* biphones = phones->GetMyBiphones();
725 const int biphone_count = biphones->count();
726 const int biphone_totalcount = biphones->m_TotalCount;
727 if (biphone_count > 0) {
728 static_cast<void>(new CTreeViewItem(
729 Tier1Item,
730 QString("Biphones %1 : %2")
731 .arg(IntToStringWithCommas(biphone_count),
732 IntToStringWithCommas(biphone_totalcount)),
733 BIPHONES, index));
737 // END CONNECTED TO WordsItem
739 // START CONNECTED TO AffixesItem
741 const int count = lexicon->GetStems()->GetCount();
742 if (count > 0) {
743 static_cast<void>(new CTreeViewItem(
744 AffixesItem,
745 QString("Stems %1")
746 .arg(IntToStringWithCommas(count)),
747 STEMS, index));
752 const int count = lexicon->GetSignatures()->GetCount();
753 if (count > 0) {
754 static_cast<void>(new CTreeViewItem(
755 AffixesItem,
756 QString("Signatures %1")
757 .arg(IntToStringWithCommas(count)),
758 SIGNATURES, index));
762 if (LxPoSCollection* parts_of_speech = lexicon->GetPOS()) {
763 const int count = parts_of_speech->count();
765 static_cast<void>(new CTreeViewItem(AffixesItem,
766 QString("Parts of speech %1")
767 .arg(IntToStringWithCommas(count)),
768 POS, index));
771 return LexiconItem;