Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ internal override async Task<RecognizerResult> RecognizeInternalAsync(ITurnConte
{
recognizerResult = new RecognizerResult
{
Text = utterance,
Intents = new Dictionary<string, IntentScore>() { { string.Empty, new IntentScore() { Score = 1.0 } } },
Entities = new JObject(),
Text = utterance
};
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ private async Task<RecognizerResult> RecognizeAsync(ITurnContext turnContext, st
{
recognizerResult = new RecognizerResult
{
Text = utterance,
Intents = new Dictionary<string, IntentScore>() { { string.Empty, new IntentScore() { Score = 1.0 } } },
Entities = new JObject(),
Text = utterance
};
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ public override async Task<RecognizerResult> RecognizeAsync(DialogContext dialog
var recognizerResult = new RecognizerResult()
{
Text = text,
Intents = new Dictionary<string, IntentScore>(),
};

if (string.IsNullOrWhiteSpace(text))
{
// nothing to recognize, return empty recognizerResult
return recognizerResult;
}

// add entities from regexrecgonizer to the entities pool
var entityPool = new List<Entity>();
Expand Down
4 changes: 1 addition & 3 deletions tests/Microsoft.Bot.Builder.AI.LUIS.Tests/LuisOracleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ public async Task NullUtterance()
Assert.IsNull(result.AlteredText);
Assert.AreEqual(utterance, result.Text);
Assert.IsNotNull(result.Intents);
Assert.AreEqual(1, result.Intents.Count);
Assert.IsNotNull(result.Intents[string.Empty]);
Assert.AreEqual(result.GetTopScoringIntent(), (string.Empty, 1.0));
Assert.AreEqual(0, result.Intents.Count);
Assert.IsNotNull(result.Entities);
Assert.AreEqual(0, result.Entities.Count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ public async Task NullUtterance()
Assert.IsNull(result.AlteredText);
Assert.AreEqual(utterance, result.Text);
Assert.IsNotNull(result.Intents);
Assert.AreEqual(1, result.Intents.Count);
Assert.IsNotNull(result.Intents[string.Empty]);
Assert.AreEqual(result.GetTopScoringIntent(), (string.Empty, 1.0));
Assert.AreEqual(0, result.Intents.Count);
Assert.IsNotNull(result.Entities);
Assert.AreEqual(0, result.Entities.Count);
}
Expand Down