From 13e3809657f454a1b977036c197e05b934aa912b Mon Sep 17 00:00:00 2001 From: David Wallis Date: Wed, 30 Jun 2021 13:40:29 +0100 Subject: [PATCH 1/2] Update Nuget Packages to latest version --- NLPHelloWorld/NLPHelloWorld.csproj | 10 +++++----- NLPHelloWorldRules/NLPHelloWorldRules.csproj | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NLPHelloWorld/NLPHelloWorld.csproj b/NLPHelloWorld/NLPHelloWorld.csproj index 0f33086..5171e1a 100644 --- a/NLPHelloWorld/NLPHelloWorld.csproj +++ b/NLPHelloWorld/NLPHelloWorld.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/NLPHelloWorldRules/NLPHelloWorldRules.csproj b/NLPHelloWorldRules/NLPHelloWorldRules.csproj index 1d9d90a..2020745 100644 --- a/NLPHelloWorldRules/NLPHelloWorldRules.csproj +++ b/NLPHelloWorldRules/NLPHelloWorldRules.csproj @@ -12,9 +12,9 @@ - - - + + + From 3bc6939b4305b7ac8a36c63d83b71854165b9248 Mon Sep 17 00:00:00 2001 From: David Wallis Date: Wed, 30 Jun 2021 16:22:36 +0100 Subject: [PATCH 2/2] Add complete example for using production rules/prefixes --- NLPHelloWorldRules/HowToDefinePrefixes.cs | 3 ++- NLPHelloWorldRules/HowToUseAPrefix.cs | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 NLPHelloWorldRules/HowToUseAPrefix.cs diff --git a/NLPHelloWorldRules/HowToDefinePrefixes.cs b/NLPHelloWorldRules/HowToDefinePrefixes.cs index a4d7dd2..93150b7 100644 --- a/NLPHelloWorldRules/HowToDefinePrefixes.cs +++ b/NLPHelloWorldRules/HowToDefinePrefixes.cs @@ -5,6 +5,8 @@ using AboditNLP.Preposition; using AboditNLP.Question; using AboditNLP.Punctuation; +using AboditNLP.Noun; + namespace NLPHelloWorldRules { @@ -26,7 +28,6 @@ public class Prefix public string OptionalResponsePrefix { get; set; } } - public partial class SampleRules : INLPRule { [ProductionRule] diff --git a/NLPHelloWorldRules/HowToUseAPrefix.cs b/NLPHelloWorldRules/HowToUseAPrefix.cs new file mode 100644 index 0000000..e267b9f --- /dev/null +++ b/NLPHelloWorldRules/HowToUseAPrefix.cs @@ -0,0 +1,19 @@ +using System.Data; +using System.Linq; +using Abodit.Expressions; +using Abodit.Meta; +using AboditNLP; +using AboditNLP.Attributes; + +namespace NLPHelloWorldRules +{ + public partial class SampleRules : INLPRule + { + public NLPActionResult GrammarDumpWithPrefix(Prefix prefix, IAmbiguous tokenAmbiguous) + { + st.Say(prefix.OptionalResponsePrefix); + intent.GrammarDump(st, tokenAmbiguous); + return NLPActionResult.None; + } + } +}