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

Commit 921c20f

Browse files
xieofxiedarrenj
authored andcommitted
[Weather] update lu (#2451)
* [] () is separated in en, zh due to ludown's bug * None is added from General * Use CheckWeatherValue instead of GetForecast
1 parent ff378e1 commit 921c20f

File tree

9 files changed

+2206
-109
lines changed

9 files changed

+2206
-109
lines changed

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/de/WeatherSkill.lu

Lines changed: 334 additions & 16 deletions
Large diffs are not rendered by default.

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/en/WeatherSkill.lu

Lines changed: 433 additions & 25 deletions
Large diffs are not rendered by default.

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/es/WeatherSkill.lu

Lines changed: 330 additions & 16 deletions
Large diffs are not rendered by default.

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/fr/WeatherSkill.lu

Lines changed: 329 additions & 16 deletions
Large diffs are not rendered by default.

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/it/WeatherSkill.lu

Lines changed: 332 additions & 16 deletions
Large diffs are not rendered by default.

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/zh/General.lu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,14 @@
194194
- 请帮忙
195195
- 请给我一些援助
196196

197+
197198
## Logout
198199
- 签出
199200
- 忘了我吧
200201
- 注销
201202
- 登出
203+
204+
202205
## None
203206
- 全部都要
204207
- 我想要所有这些

skills/csharp/experimental/weatherskill/Deployment/Resources/LU/zh/WeatherSkill.lu

Lines changed: 403 additions & 16 deletions
Large diffs are not rendered by default.

skills/csharp/experimental/weatherskill/Dialogs/MainDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public MainDialog(
8686

8787
switch (intent)
8888
{
89-
case WeatherSkillLuis.Intent.GetForecast:
89+
case WeatherSkillLuis.Intent.CheckWeatherValue:
9090
{
9191
await dc.BeginDialogAsync(nameof(ForecastDialog));
9292
break;

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

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,76 @@
99
using Microsoft.Bot.Builder.AI.Luis;
1010
namespace Luis
1111
{
12-
public class WeatherSkillLuis: IRecognizerConvert
12+
public partial class WeatherSkillLuis: IRecognizerConvert
1313
{
14+
[JsonProperty("text")]
1415
public string Text;
16+
17+
[JsonProperty("alteredText")]
1518
public string AlteredText;
19+
1620
public enum Intent {
21+
ChangeTemperatureUnit,
22+
CheckWeatherTime,
23+
CheckWeatherValue,
24+
GetWeatherAdvisory,
1725
None,
18-
GetForecast
26+
QueryWeather
1927
};
28+
[JsonProperty("intents")]
2029
public Dictionary<Intent, IntentScore> Intents;
2130

2231
public class _Entities
2332
{
33+
// Simple entities
34+
public string[] Historic;
35+
36+
public string[] SuitableFor;
37+
38+
public string[] WeatherCondition;
39+
40+
public string[] WeatherRange;
2441

2542
// Built-in entities
43+
public DateTimeSpec[] datetime;
44+
45+
public Dimension[] dimension;
46+
2647
public GeographyV2[] geographyV2;
2748

49+
public Temperature[] temperature;
50+
51+
// Lists
52+
public string[][] AdditionalWeatherCondition;
53+
54+
public string[][] WindDirectionUnit;
55+
2856
// Instance
2957
public class _Instance
3058
{
59+
public InstanceData[] AdditionalWeatherCondition;
60+
public InstanceData[] Historic;
61+
public InstanceData[] SuitableFor;
62+
public InstanceData[] WeatherCondition;
63+
public InstanceData[] WeatherRange;
64+
public InstanceData[] WindDirectionUnit;
65+
public InstanceData[] datetime;
66+
public InstanceData[] dimension;
3167
public InstanceData[] geographyV2;
68+
public InstanceData[] temperature;
3269
}
3370
[JsonProperty("$instance")]
3471
public _Instance _instance;
3572
}
73+
[JsonProperty("entities")]
3674
public _Entities Entities;
3775

3876
[JsonExtensionData(ReadData = true, WriteData = true)]
3977
public IDictionary<string, object> Properties {get; set; }
4078

4179
public void Convert(dynamic result)
4280
{
43-
var app = JsonConvert.DeserializeObject<WeatherSkillLuis>(JsonConvert.SerializeObject(result));
81+
var app = JsonConvert.DeserializeObject<WeatherSkillLuis>(JsonConvert.SerializeObject(result, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }));
4482
Text = app.Text;
4583
AlteredText = app.AlteredText;
4684
Intents = app.Intents;

0 commit comments

Comments
 (0)