Skip to content

Commit

Permalink
Revert irrelevant changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaxwell3 committed May 2, 2024
1 parent 4e32711 commit 044a91d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
<command id="CmdParseWordsInCurrentText" label="Parse Words in Te_xt" message="ParseWordsInCurrentText"/>
<command id="CmdClearSelectedWordParserAnalyses" label="Clear Current Parser _Analyses" message="ClearSelectedWordParserAnalyses"/>
<command id="CmdReInitializeParser" label="Re_load Grammar / Lexicon" message="ReInitParser" tooltip="Reloads data from the Grammar and Lexicon, so the parser uses your latest changes."/>
<command id="CmdShowConflictsInCurrentText" label="Show Conflicts in Text" message="ShowConflictsInCurrentText" tooltip="Parses text and shows conflicts between user approval and parser approval."/>
<command id="CmdImportWordSet" label="_Import Word Set..." message="ImportWordSet"/>
<command id="CmdImportWordSet" label="_Import Word Set..." message="ImportWordSet"/>
<command id="CmdChooseXAmpleParser" label="Default Parser (XAmple)" message="ChooseParser">
<parameters parser="XAmple"/>
</command>
Expand Down Expand Up @@ -277,11 +276,10 @@
<item command="CmdChooseXAmpleParser"/>
<item command="CmdChooseHCParser"/>
</menu>
<item command="CmdShowConflictsInCurrentText"/>
<item command="CmdEditParserParameters"/>
<item command="CmdEditParserParameters"/>
</menu>
<include path="Extensions/*/AreaConfigurationExtension.xml" query="root/menubar/*"/>
</menubar>
</menubar>
<!-- ********************************************************** -->
<!-- ************************ menuAddOn *********************** -->
<!-- ********************************************************** -->
Expand Down
24 changes: 1 addition & 23 deletions Src/LexText/ParserCore/ParserScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public override void DoWork()
private readonly int[] m_queueCounts = new int[5];
private volatile bool m_tryAWordDialogRunning;
private TaskReport m_TaskReport;
private Dictionary<IWfiWordform, bool> m_wordformProcessed = null;

/// -----------------------------------------------------------------------------------
/// <summary>
Expand Down Expand Up @@ -288,20 +287,10 @@ public void ScheduleOneWordformForUpdate(IWfiWordform wordform, ParserPriority p
m_thread.EnqueueWork(priority, new UpdateWordformWork(this, priority, wordform));
}

public void ScheduleWordformsForUpdate(IEnumerable<IWfiWordform> wordforms, ParserPriority priority, bool showConflicts)
public void ScheduleWordformsForUpdate(IEnumerable<IWfiWordform> wordforms, ParserPriority priority)
{
CheckDisposed();

m_wordformProcessed = null;
if (showConflicts)
{
// Keep track of which wordforms have been processed.
m_wordformProcessed = new Dictionary<IWfiWordform, bool>();
foreach (var wordform in wordforms)
{
m_wordformProcessed[wordform] = false;
}
}
foreach (var wordform in wordforms)
ScheduleOneWordformForUpdate(wordform, priority);
}
Expand All @@ -327,17 +316,6 @@ private void HandleTaskUpdate(TaskReport task)
private void ParseFiler_WordformUpdated(object sender, WordformUpdatedEventArgs e)
{
DecrementQueueCount(e.Priority);
if (m_wordformProcessed != null && m_wordformProcessed.ContainsKey(e.Wordform))
{
m_wordformProcessed[e.Wordform] = true;
// See if we are done.
foreach (var key in m_wordformProcessed.Keys)
{
if (!m_wordformProcessed[key])
return;
}
// Display the wordforms in the Wordforms window.
}
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Src/LexText/ParserUI/ParserConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ public IAsyncResult BeginTryAWord(string sForm, bool fDoTrace, int[] sSelectTrac
return this;
}

public void UpdateWordforms(IEnumerable<IWfiWordform> wordforms, ParserPriority priority, bool showConflicts = false)
public void UpdateWordforms(IEnumerable<IWfiWordform> wordforms, ParserPriority priority)
{
CheckDisposed();
m_scheduler.ScheduleWordformsForUpdate(wordforms, priority, showConflicts);
m_scheduler.ScheduleWordformsForUpdate(wordforms, priority);
}

public void UpdateWordform(IWfiWordform wordform, ParserPriority priority)
Expand Down
7 changes: 3 additions & 4 deletions Src/LexText/ParserUI/ParserListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,20 +481,19 @@ public bool OnDisplayParseWordsInCurrentText(object commandObject, ref UIItemDis
return true; //we handled this.
}

public bool OnShowConflictsInCurrentText(object argument)
public bool OnParseWordsInCurrentText(object argument)
{
CheckDisposed();

if (ConnectToParser())
{
IStText text = CurrentText;
IEnumerable<IWfiWordform> wordforms = text.UniqueWordforms();
m_parserConnection.UpdateWordforms(wordforms, ParserPriority.Medium, true);
m_parserConnection.UpdateWordforms(wordforms, ParserPriority.Medium);
}

return true; //we handled this.
return true; //we handled this.
}

public bool OnParseAllWords(object argument)
{
CheckDisposed();
Expand Down

0 comments on commit 044a91d

Please sign in to comment.