Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

update GeographyV2 (#1995) #1996

Merged
merged 1 commit into from
Aug 1, 2019
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 @@ -195,9 +195,9 @@ protected async Task DigestLuisResult(DialogContext dc, ReservationLuis luisResu
}
}

if (entities.geographyV2_City != null)
if (entities.geographyV2 != null)
{
state.Booking.Location = entities.geographyV2_City.First<string>();
state.Booking.Location = entities.geographyV2.First().Location;
}

// Establishing attendee count can be problematic as the number entity can be picked up for poorly qualified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class _Entities

// Built-in entities
public DateTimeSpec[] datetime;
public string[] geographyV2_City;
public GeographyV2[] geographyV2;
public double[] number;

// Lists
Expand All @@ -54,7 +54,7 @@ public class _Instance
{
public InstanceData[] people;
public InstanceData[] datetime;
public InstanceData[] geographyV2_City;
public InstanceData[] geographyV2;
public InstanceData[] number;
public InstanceData[] cuisine;
public InstanceData[] attendees;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ protected async Task DigestLuisResult(DialogContext dc)
{
var entities = state.LuisResult.Entities;

if (entities.geographyV2_city != null)
if (entities.geographyV2 != null)
{
state.Geography = entities.geographyV2_city[0];
state.Geography = entities.geographyV2[0].Location;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public class _Entities
{

// Built-in entities
public string[] geographyV2_city;
public GeographyV2[] geographyV2;

// Instance
public class _Instance
{
public InstanceData[] geographyV2_city;
public InstanceData[] geographyV2;
}
[JsonProperty("$instance")]
public _Instance _instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,9 @@ private async Task DigestLuisResult(DialogContext dc, PointOfInterestLuis luisRe
// ADDRESS overwrites geographyV2
var sb = new StringBuilder();

if (entities.geographyV2_poi != null)
if (entities.geographyV2 != null)
{
sb.AppendJoin(" ", entities.geographyV2_poi);
}

if (entities.geographyV2_city != null)
{
sb.AppendJoin(" ", entities.geographyV2_city);
sb.AppendJoin(" ", entities.geographyV2.Select(geography => geography.Location));
}

if (sb.Length > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Collections.Generic;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.AI.Luis;

namespace Luis
{
public partial class PointOfInterestLuis: IRecognizerConvert
Expand All @@ -31,9 +32,7 @@ public class _Entities

// Built-in entities
public double[] number;
// Workaround. Remove them when combined to geographV2[] in 4.5
public string[] geographyV2_poi;
public string[] geographyV2_city;
public GeographyV2[] geographyV2;

// Lists
public string[][] ROUTE_TYPE;
Expand All @@ -44,8 +43,7 @@ public class _Instance
public InstanceData[] KEYWORD;
public InstanceData[] ADDRESS;
public InstanceData[] number;
public InstanceData[] geographyV2_poi;
public InstanceData[] geographyV2_city;
public InstanceData[] geographyV2;
public InstanceData[] ROUTE_TYPE;
}
[JsonProperty("$instance")]
Expand Down