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

Commit 0c3aa86

Browse files
xieofxieryanisgrig
authored andcommitted
update GeographyV2 (#1995) (#1996)
1 parent 0c723d0 commit 0c3aa86

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

skills/src/csharp/experimental/restaurantbooking/Dialogs/SkillDialogBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ protected async Task DigestLuisResult(DialogContext dc, ReservationLuis luisResu
195195
}
196196
}
197197

198-
if (entities.geographyV2_City != null)
198+
if (entities.geographyV2 != null)
199199
{
200-
state.Booking.Location = entities.geographyV2_City.First<string>();
200+
state.Booking.Location = entities.geographyV2.First().Location;
201201
}
202202

203203
// Establishing attendee count can be problematic as the number entity can be picked up for poorly qualified

skills/src/csharp/experimental/restaurantbooking/Services/ReservationLuis.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class _Entities
2828

2929
// Built-in entities
3030
public DateTimeSpec[] datetime;
31-
public string[] geographyV2_City;
31+
public GeographyV2[] geographyV2;
3232
public double[] number;
3333

3434
// Lists
@@ -54,7 +54,7 @@ public class _Instance
5454
{
5555
public InstanceData[] people;
5656
public InstanceData[] datetime;
57-
public InstanceData[] geographyV2_City;
57+
public InstanceData[] geographyV2;
5858
public InstanceData[] number;
5959
public InstanceData[] cuisine;
6060
public InstanceData[] attendees;

skills/src/csharp/experimental/weatherskill/Dialogs/SkillDialogBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ protected async Task DigestLuisResult(DialogContext dc)
183183
{
184184
var entities = state.LuisResult.Entities;
185185

186-
if (entities.geographyV2_city != null)
186+
if (entities.geographyV2 != null)
187187
{
188-
state.Geography = entities.geographyV2_city[0];
188+
state.Geography = entities.geographyV2[0].Location;
189189
}
190190
}
191191
}

skills/src/csharp/experimental/weatherskill/Services/WeatherSkillLuis.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public class _Entities
2323
{
2424

2525
// Built-in entities
26-
public string[] geographyV2_city;
26+
public GeographyV2[] geographyV2;
2727

2828
// Instance
2929
public class _Instance
3030
{
31-
public InstanceData[] geographyV2_city;
31+
public InstanceData[] geographyV2;
3232
}
3333
[JsonProperty("$instance")]
3434
public _Instance _instance;

skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/MainDialog.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,9 @@ private async Task DigestLuisResult(DialogContext dc, PointOfInterestLuis luisRe
376376
// ADDRESS overwrites geographyV2
377377
var sb = new StringBuilder();
378378

379-
if (entities.geographyV2_poi != null)
379+
if (entities.geographyV2 != null)
380380
{
381-
sb.AppendJoin(" ", entities.geographyV2_poi);
382-
}
383-
384-
if (entities.geographyV2_city != null)
385-
{
386-
sb.AppendJoin(" ", entities.geographyV2_city);
381+
sb.AppendJoin(" ", entities.geographyV2.Select(geography => geography.Location));
387382
}
388383

389384
if (sb.Length > 0)

skills/src/csharp/pointofinterestskill/pointofinterestskill/Services/PointOfInterestLuis.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Collections.Generic;
99
using Microsoft.Bot.Builder;
1010
using Microsoft.Bot.Builder.AI.Luis;
11+
1112
namespace Luis
1213
{
1314
public partial class PointOfInterestLuis: IRecognizerConvert
@@ -31,9 +32,7 @@ public class _Entities
3132

3233
// Built-in entities
3334
public double[] number;
34-
// Workaround. Remove them when combined to geographV2[] in 4.5
35-
public string[] geographyV2_poi;
36-
public string[] geographyV2_city;
35+
public GeographyV2[] geographyV2;
3736

3837
// Lists
3938
public string[][] ROUTE_TYPE;
@@ -44,8 +43,7 @@ public class _Instance
4443
public InstanceData[] KEYWORD;
4544
public InstanceData[] ADDRESS;
4645
public InstanceData[] number;
47-
public InstanceData[] geographyV2_poi;
48-
public InstanceData[] geographyV2_city;
46+
public InstanceData[] geographyV2;
4947
public InstanceData[] ROUTE_TYPE;
5048
}
5149
[JsonProperty("$instance")]

0 commit comments

Comments
 (0)